conan: What causes error message: ERROR: 'settings.arch' value not defined?
Conan 1.6.1
Hi,
We have a structure like the following (simplified):
PkgA requires PkgB PkgB requires PkgC
PkgA has no settings attribute PkgB has settings = “os”, “compiler”, “build_type”, “arch” PkgC has no settings attribute
if we run (for PkgA):
conan install PkgA-recipe -if <build dir>
conan build PkgA-recipe -bf <build dir> -sf <src folder>
conan export-pkg PkgA-recipe dev/test -bf <build dir>
we get the error ERROR: PkgB ‘settings.arch’ value not defined. The output from conan suggests that the conan export-pkg command successfully exporting the package, but failed before the package() method is called.
if we run (for PkgA):
conan create PkgA-recipe dev/test
it works fine.
To stop the error for the local build we added settings = “os”, “compiler”, “build_type”, “arch” to PkgA but we don’t understand why this was required.
Any guidance on what we may have done wrong?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 17 (9 by maintainers)
Hi, @ManuelMeraz!
See your issue, do you know you can compose profiles or even pass several of them to the same command?
Take a look at Profile includes, if your profile is defined in the file
my_profile
(in your local folder) it can include a default one:and also at profile composition, you can pass several profiles to the same command:
Yes! I knew about that, but the way you just showed me in that exampled makes it very clear that it is perfect for my use case. I never thought about applying that to my specific case.
I can do what I was originally doing, I just need to include the default one and those settings will then be defined. Perfect. That is exactly what I needed 😃. Thank you.
--profile
options is used currently only when there is no conaninfo.txt file present in the installation directory. For example, if you run the local commands and then try toconan export-pkg
, it will use the info in the conaninfo.txt.The PR mentioned before changes that behavior to always use the profile or settings if specified.