I think it would be useful to be able to configure a default profile so there is no need to add the profile argument to every conan command. Most of the time people use the same tools, settings, ... especially with the new build_requires feature profiles will be used more often. Having to specify the same profile is cumbersome and error-prone.
The default profile name should be optional so there is no need to configure one and thus it would be backwards compatible.
I guess that using a profile called "conan_default" or something similar if present, wouldn't break things and achieve the result.
@lasote Maybe reconsider the settings_defaults of conan.conf too?
@memsharded Sure, if we introduce a default profile the default settings from conan.conf have to be moved to the default profile. We should prepare a migration and keep some comments in the conan.conf file saying: Default settings moved to ./profiles/conan_default. And be careful with the docs, for sure. People can freak out.
Or just have an additional entry "default_profile" in the conan.conf referring the name of the profile. If none is configured, everything works like it does now, otherwise the respective profile is used. This way one can easily switch the default profile without renaming the profile file or even go back to not using a profile at all.
+1 . Sounds very good, also because the config can be set via conan command, which is convenient.
It feels a little inconsistent for me, to have a default profile and default settings in a conf, but it could be done later.
the default settings from conan.conf would be moved to a default profile, I guess. But the used default profile name is not hardcoded it is defined in conan.conf
Default profile is now available in 0.25, including a migration from the old [settings_defaults] from conan.conf
Was this changed again, or do I have to setup a default profile myself (_conan 0.30.3_)?
conan profile list gives default on windows but No profiles defined on Linux/Debian 9.1. Fresh install of conan in the latter case. Has it been implicitly added on Windows at some point?
Edit.
I'm using include(default) in custom profiles, which fails in latter case.
Edit 2.
Okay, so after running a "dummy" conan install a default profile was generated (listed by conan profile list). Is there a reason not to have default from fresh install? If so, how do I force-generate one? IMO default should always be there & perhaps non-removable.
The default profile will be created first time it is needed if it doesn't exist, running the auto-detection. If you remove it in windows and write conan profile list it should be empty too.
I wouldn't recommend including the default profile, but your own, fixed one. In fact, for production I wouldn't say the default profile is recommended. How do you plan to manage your profiles? I would recommend using conan config install. Then, if a default profile exists or not becomes irrelevant.
Currently I'm using it to default all values in my profiles using include(default), since I only atm need to specify a single setting: compiler.libcxx=libstdc++11.
The reason I'm using profiles (instead of just -s) is to be platform agnostic: If it's on Windows/MSVC, an empty profile is selected, if Linux/GCC/Clang, a profile with only compiler.libcxx=libstdc++11 is selected. Both have include(default) at the top, as per documentation. If I ever need more settings/profiles, it's easy to modify/add.
If the default profile is auto-added when needed that could be fine, but currently the above case does not trigger this (which if so it should).
Not sure how conan config install works, but I'm guessing I'll have to supply the "zip file" containing all values, right? As mentioned above, this is not what I want. As of now I'm only interested in the default settings auto-detected from current environment by conan (I don't want multiple places to specify compiler etc, I want conan to auto-detect it since I'm using docker containers and there will ever only be one toolchain available at build-time).
So... Do you have any workaround for generating the default profile so that it is available when specifying a profile using include(default)? Apparently running a failing dummy conan install does not generate it...
Yes, sure, and it is not a workaround, it is explicit creation of the profile:
$ conan profile new default --detect
Hope it helps. Cheers!
Ah, perfect!
Thanks!
This PR: https://github.com/conan-io/conan/pull/2233 that is about to be included in the beta for 1.0, might help and further automate this making the above step unnecessary :)
Ir would also be nice to have a way to set this from the environment (maybe CONAN_DEFAULT_PROFILE?). That would make it easy for IDE configurations like Qt Creator kits / visual studio configurations to set corresponding conan profile to be used if the project files calling conan install (e.g. https://github.com/conan-io/cmake-conan)
@puetzk
You mean like the default_profile var in the [general] section in the conan.conf, but with an environment variable? Please, open a new issue for this, I think it is a valid issue, but better to track it in a new issue. Thanks!