How to generate/modify the default profile?

See original GitHub issue

Before version 0.25 the conan.conf file contained the default settings of conan. conan.conf was generated on the very first call to conan. So simply calling conan would generate the default settings.

In version 0.25/0.25.1 the default settings from conan.conf have been removed. The idea is to have different profiles under ~/.conan/profiles/ and use them according to the build environment/settings. I think this covers the major points.

The problem is that the default profile, ~/.conan/profiles/default is not generated unless I call conan install. On the other hand calling conan install without any arguments or paths to a recipe will fail and returns a non zero error code.

  1. I would like to know why the default profile is not generated during the very first call to conan?
  2. Is there a way to generate the default profile without getting a non zero error code from conan? During building of our docker/vagrant images I am failing the build process if any of the commands fail. This is causing all of docker/vagrant build pipelines to fail.

I used to create pseudo “profiles” before each build by calling conan config set arch/build_type/.... I assume since you have moved to profiles you don’t use the settings in conan.conf file any more.

  1. Is there a way to create a profile with a similar command? I know the profiles are simple text files but I prefer to create the profiles using a conan command rather than creating a text file under the profiles folder. Something like conan profile create custom_profile -s arch=x86 -s build_type=Debug and any unspecified option is inherited from the default profile.

Thanks

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (10 by maintainers)

github_iconTop GitHub Comments

5reactions
liberforcecommented, Apr 3, 2018

As the option is not mentionned here: conan profile new foo --detect will create a filled profile named foo.

3reactions
memshardedcommented, Jul 25, 2017

Sorry for breaking this. When we moved the [settings_defaults] to a default profile, we did the migration to not break, but we didn’t consider the usage of conan config to set the default profile, because we mostly use it to config conan config variables, but not the [settings_defaults], cause the most recommended approach was already to use profiles.

So if you were using conan config to do it, it won’t be possible directly with conan 0.25.

How are you calling conan? Shell scripts? CI scripts? Don’t you have some way to capture the error code? Currently there is no way that conan install will not fail without a conanfile. You might install some existing package, with conan install Pkg/version@user/channel but that would be slower and unnecessary.

I think the best workaround at the moment would be running something like:

$ printf "[settings]\narch=x86\nbuild_type=Debug\n...." > /home/user/.conan/profiles/default

We will be adding the equivalent to conan config for profiles asap (0.26). We have to think about the UX, I am not sure that the default behavior taking unspecified options from the default would be the easiest to understand, as there should be an option to create totally new profiles, independent of the default. Maybe another different subcommand. I will post here any progress. Thanks very much for reporting this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize the default user profile by using CopyProfile
You can use the CopyProfile setting to customize a user profile and then copy that profile to the default user profile.
Read more >
Creating a custom default user profile in Windows 10 - YouTube
Here's how to create a customized default user profile in Windows 10, and some tricks to help you get around the limitations of...
Read more >
How to customize Windows 11 default profiles | SmartDeploy
Right-click on the newly created GPO, then click Edit. Navigate to Computer Configuration > Policies > Administrative Templates > Windows ...
Read more >
How can I configure default settings for new users?
Logon as an Administrator · Start the System Control Panel Applet (Start - Settings - Control Panel - System) · Click the User...
Read more >
A Better Way to Customize the Windows Default Profile
Editing the Default Profile Permalink ... To edit the default profile, we'll use the command line tool REG to mount and make changes...
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