-
Notifications
You must be signed in to change notification settings - Fork 981
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
[feature] Separate settings/options attributes for build & host contexts #8292
Comments
That's a difficult one you can not do that with the Android NDK, but how to verify that the NDK works? you need to build various different packages, cmake, autoconf, makefile based, ...... for an other build dependency, like a code generator, I am just interested that the executable file is in the path, and there I do not need the host profile at all, just the build one. So I do thing that there are different levels of testing
The unit test for a build dependency package might be just some sanity checks, However, #7688 is a valid use case, because something you need both, the host and the target to create a package. That's also difficult, but might lead in the right direction and provide a way to have 2 profiles available. I have no idea how much should go into the test method, but I do fear that it becomes easy to make the test method requirements too complex and too costly. |
Hi @theodelrieu There are too many different things in this issue, maybe we need to split them (not now, in the future) into separate discussions. One tip: the constraint of settings in recipes like We are aware of the limitations of This is very good information, it will be useful for the new graph and cross building model, this is highlighting a need, it could be a new "recipe type" or maybe a new "relation type", and there could be a |
I don't think this should be
Glad to hear, looking forward to the discussions.
Indeed, I'm only restricting settings like that in code samples ;) |
About testing packages that are to be used as @theodelrieu we did some early research about this topic here (https://github.com/jgsogo/conan-poc-graph-cpp), but we need to allocate more time to keep working on the conceptualization before proposing actual implementation. IMO, not only the role of the relation (which can only be fully declared by the consumer) but the visibility (interface, public, private) should be added to the About options/settings related to target machine on your first commit: when you build the compiler-like package (android-ndk, gcc,...) you need information about the target (possible binaries that can be generated when using this compiler-like package) in order to grab/build/package libraries that will be used when using the compiler. At this moment, when building the compiler-like package you have only some constraints but not all the settings (it can build debug/release, different ios, different android API levels,...). You will only have all the settings-target defined when you are actually using the compiler-like package as a build-requires (and those settings will be the host ones).
As you can see, we are abandoning the idea of propagating... in favor of validating, which is much easier to implement and probably to understand and code in the recipes. But still no news about #7688 and how to match host profile with the cross-compiler when there are different packages (different package-id) of the cross-compiler for different host profiles... right now, it needs to be manually done by the user: the user provides matching information in the profiles and the recipe can raise if they didn't match. Does it worth the effort and complexity to propagate options to other contexts? ATM, we don't have a clear idea on how to do it (not even syntax). |
Conan 2.0 has settled on the There are some tests for these "toolchain" cases like android, libcxx, gcc in https://github.com/conan-io/conan/blob/develop2/conans/test/integration/build_requires/test_toolchain_packages.py. Some highlights:
Closing this issue as solved in 2.0, feedback welcome. |
Hello,
I'm currently migrating all my recipes to be compatible with dual profiles, and I've encountered two issues with toolchain-like packages.
recipe-declared
options
andsettings
must be thetarget
onesThis is a direct consequence of the fact that there is no way to specify options/settings for a specific context.
Therefore,
options
becomes the target ones, or rather the intersection ofbuild_options/host_options/target_options
(same forsettings
), and thus must be given a value, even if it will be unused in a context and even deleted in thepackage_id
method.Otherwise, Conan will complain:
ERROR: darwin-toolchain/1.1.0: 'settings.arch' value not defined
.test_package
becomes uselessSince
test_package
uses the same profile that was used to create the package, it cannot work for toolchain packages.When creating the
android_ndk_installer
package with themacos-x86_64
profile, it will requireandroid_ndk_installer
withos=Macos
, which makes no sense. Also, no compiler flags will be set, assettings_target
are not defined:The only workaround I found is to completely remove the
test_package
folders from my toolchain recipes.Proposed improvement
There should be a way to specify separate
settings
/options
:To be extra specific and avoid confusion,
settings
could instead be namedsettings_host
, that waysettings
would only be used by regular recipes.New sections should be introduced in profiles as well, like @jgsogo mentioned in #7688 (comment).
Looking forward to your inputs!
PS:
I've talked with some peoples of the Conan team about the idea of having separate recipe types, since toolchains are quite different than regular libraries. This could be a feature introduced in Conan 2.0, and I think that this proposal is a building block of it.
The text was updated successfully, but these errors were encountered: