Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[question] Pre-built binaries: how to name packages for each build configuration? #4475

Closed
iiknd opened this issue Feb 6, 2019 · 6 comments
Assignees

Comments

@iiknd
Copy link

iiknd commented Feb 6, 2019

Hi,

Conan version 1.11.2

We have a build system which produces the binaries. We have multiple build targets, including cross-compilations. Also for each target we have multiple configurations, for example:

  • Windows7, x86, MSVC2015, OpenSSL=yes, zlib=yes, ....
  • Windows10, x86, MSVC2015, OpenSSL=yes, zlib=yes, feature-x=yes, ...
  • Windows10, x86_64, MSVC2017, OpenSSL=yes, zlib=yes, feature-y=yes, ...
  • macOS, x86_64, ...
  • Windows-host, Android target, ...
  • Linux-host, Android target, ...
  • ...

I got started by creating a conan recipe and package for one build configuration which packages
the pre-built binaries. I quickly noticed that how to name the packages so that their names won't conflict per build configuration?

For example:

the-project/1.0@companyname/rc1

Should I "extend" the channel for this purpose, something like:

the-project/1.0@companyname/rc1/windows7/x86/msvc2015/openssl-zlib-feature-x
the-project/1.0@companyname/rc1/windows10/x86/msvc2015/openssl-zlib-feature-x
the-project/1.0@companyname/rc1/windows10/x86_64/msvc2017/openssl-zlib-feature-y
the-project/1.0@companyname/rc1/macOS/x86_64/clang/feature-z
...

Or is there some other way I haven't noticed yet?

@memsharded
Copy link
Member

Hi @unzap

No, you shouldn't extend the channel.

This feature is built-in in Conan. Every different binary configuration will be automatically managed by Conan, assigning it a "binary-ID", which is the hash of the configuration: settings, options, dependencies.

You can read more about this in:

Even if you are creating packages from pre-built binaries (you might want to have a look to conan export-pkg command), the same principle applies.

You might want to have a look how configuration is managed in profiles: https://docs.conan.io/en/latest/using_packages/using_profiles.html

@iiknd
Copy link
Author

iiknd commented Feb 6, 2019

Hi @memsharded

ok, so I tried the following:

# pre-built binaries exist, built with openssl enabled
conan export-pkg -f conanfile.py the-project/1.0@companyname/rc1 -s os=Linux -o openssl=True
conan upload the-project/1.0@companyname/rc1 --all -r=local_conan_server
# clean working dir
# pre-built binaries exist, built with openssl disabled
conan export-pkg -f conanfile.py the-project/1.0@companyname/rc1 -s os=Linux -o openssl=False
conan upload the-project/1.0@companyname/rc1 --all -r=local_conan_server

Looking into ".conan_server/data/....../package" I can see two hash/sha checksum -folder:

6a7635c82eb73cf8a944b3f5141099a8aa2ae060/0
90ee443cae5dd5c1b4861766ac14dc6fae231a92/0

Peeking the contents of each conaninfo.txt I can confirm that the passed option -o openssl=True|False is reflected in the content,

[Options]
openssl=True # or False for the other package

But I'm still unable to "query" which build variants for the package "the-project/1.0@companyname/rc1" actually exists on the (local) conan server?

conan inspect the-project/1.0@companyname/rc1 -r=local_conan_server

Shows only the options available in the recipe

options:
openssl: [True, False]

I can't see that the server actually has these two build variants of that package (reference)?

So is there a way to inspect/query/print out all the existing build variants for the given reference ("the-project/1.0@companyname/rc1"), something like:

conan inspect --show-used-build-options the-project/1.0@companyname/rc1 -r=local_conan_server

options_used_to_build_this_package:
host_os: Windows
host_os_version: 7
host_os_arch: x86_64
os: Android
arch: ARMv7
openssl: True
...

options_used_to_build_this_package:
host_os: Windows
host_os_version: 7
host_os_arch: x86_64
os: Android
arch: ARMv7
openssl: False
...

@memsharded
Copy link
Member

memsharded commented Feb 6, 2019

yes, that would be the search:

$ conan search the-project/1.0@companyname/rc1 -r=local_conan_server

You could use the --table=file.html for outputting an html summary of it if you have many binaries.

You can have a look to the "getting started" section in the docs: https://docs.conan.io/en/latest/getting_started.html#inspecting-dependencies

@iiknd
Copy link
Author

iiknd commented Feb 6, 2019

That's the command I was looking for, thanks! I did read the docs and tried "info" and "inspect" but failed to notice the "search" command so far.

@uilianries
Copy link
Member

Hi all! I think we can close this one.

Also, the same question could be closed on Stack Overflow:

https://stackoverflow.com/questions/54536418/conan-io-recipe-how-to-define-inspection-properties-of-each-build-configuratio

@memsharded
Copy link
Member

Sure, lets close it. Do not hesitate @unzap to further comment or open new issues. Thanks!

@ghost ghost removed the stage: triaging label Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants