question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[feature] Option to set default profile:build and profile:host in conanfile

See original GitHub issue

Summary Can we get an option to specify a default profile:build and profile:host in the conanfile?

Nice to haves:

  • Allow for profile:build to use a variable for the current architecture (eg, so it will use a linux_x64 profile if you’re on a linux_x64 machine)
  • Allow a ‘none’ value for profile:host, so that the user is forced to enter a value on the commandline.
  • Allow values specified as command line args to override defaults specified in conanfile

Justification: On firmware projects that require cross-compilation, profile:build is generally going to be the current architecture of the machine the developer is using, and profile:host will almost always be the embedded device architecture (eg, an ARM toolchain).

Given that omitting profile:build and profile:host from the commandline makes significant changes to the build, I feel like this would end up being a common pitfall when getting new developers up to speed on a conan project. I think it would be less confusing if I could specify default values in the conanfile, but still be able to override them as needed.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
db4commented, Feb 25, 2021

@solvingj I never knew that settings could be specified this way for individual packages. That’s exactly what I need, thanks a lot!

1reaction
solvingjcommented, Feb 25, 2021

I’m pretty novice on the cross-build implications. Would it work to add this to the settings of your build_profile?

    [settings]
    cmake:arch=x86_64
    cmake:build_type=Release
Read more comments on GitHub >

github_iconTop Results From Across the Web

Profiles — conan 1.56.0 documentation
Profiles allows users to set a complete configuration set for settings, options, environment variables, and build requirements in a file.
Read more >
Profiles — conan 1.34.1 documentation
Profiles allows users to set a complete configuration set for settings, options, environment variables, and build requirements in a file.
Read more >
Attributes — conan 1.50.2 documentation
The attribute default_options has the purpose of defining the default values for the options if the consumer (consuming recipe, project, profile or the...
Read more >
conan create — conan 1.55.0 documentation
Builds a binary package for a recipe (conanfile.py). Uses the specified configuration in a profile or in -s settings, -o options, etc.
Read more >
How to cross-compile your applications using Conan: host ...
In the previous examples, we learned how to use a conanfile.py or conanfile.txt to ... --build=missing --profile:host=someprofile --profile:build=default.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found