conan-package-tools icon indicating copy to clipboard operation
conan-package-tools copied to clipboard

os setting is missing

Open sixten-hilborn opened this issue 8 years ago • 2 comments

Hi,

I would expect the ConanMultiPackager's builds to have the os setting since this setting is available in most other contexts. I currently want to disable Linux 32 bit builds like this:

builder = ConanMultiPackager()
builder.add_common_builds(...)
builder.builds = [
    [settings, options]
    for settings, options in builder.builds
    if not (settings["os"] == "Linux" and settings["arch"] == "x86")
]

However it is obvious from the source that os is never defined:

Traceback (most recent call last):
  File "build.py", line 11, in <module>
    if not (settings["os"] == "Linux" and settings["arch"] == "x86")
KeyError: 'os'

I suppose os may also be valuable in the future if cross compilation is supported.

sixten-hilborn avatar Jan 21 '17 00:01 sixten-hilborn

I can proceed with implementation

I'm novice in conan, according to my understanding this feature can be implemented just by handling additional environment variables CONAN_OS_NAME and CONAN_OS_VERSION because arch already handled by CONAN_ARCHS

@sixten-hilborn @lasote is my vision correct?

CAMOBAP avatar Jun 24 '18 21:06 CAMOBAP

additional environment variables CONAN_OS_NAME and CONAN_OS_VERSION

No, the issue here is that conan package tools is always using the current operating system as the os setting. I agree with @sixten-hilborn that probably the add_common_builds should generate also the builds with the os setting (adjusted to the current system). This way, if the os is taken into account we will start supporting cross building, but I'm sure we will need to change some more things.

lasote avatar Jun 27 '18 06:06 lasote