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: Add conan config init
command
#6959
Conversation
* remove return
Hi @e-i-n-s I am not sure if I understood correctly the pain that you are trying to solve. And why not What you are explaining needs to be executed by every Conan client installation, in CI, by developers in their machines. While the Can you please clarify your intent? Thanks! |
@memsharded Our pain is if we use There are lot of compiler related changes in the settings.yml (i.e. #6911, #6772). Do I understand correctly that |
Hi @e-i-n-s I am sorry, but you are still maintaining a custom settings.yml. 😄 You are doing it in every Conan installation, in every developer machine and every CI server. Here:
The only difference that I am suggesting is doing that operation once, controlled by the admin/maintainer, and storing that changed settings.yml in a place, where all Conan clients can sync from it. Way more robust to operate, you don't rely on having that custom script on every developer machine. What if that script needs updating, how are you managing that? Are you in the CppLang slack? If you are there, we might discuss live, maybe that helps to understand better. |
@memsharded |
It seems there is still a good case that it is very convenient to initialize the conan cache with the default things, so this command might make sense. It might be also a convenient place to also create the default profile if not there, as the |
I think there is something around the config we are not covering yet. For me it'd make sense to have a command like
But how to deal with it when you just want to get the default content for one of those files? I usually want the default for About the underlying pain in this PR: to add a line to the
IMO it would make sense as a hook: the logic will check for I know this comment can be a little bit offtopic, but probably I need some more context from that slack chat. |
Not sure I agree. Hooks so far are orthogonal checks to recipes flows, while this lies much on the Conan client configuration side. I agree that it would be nice to have some idea how this can be extended in the future for other cases, as only initialization one file, but I would certainly want to keep this as simple as possible in this first iteration. I don't think the way to go is to do this work on the users/developers/ci machines, but have them provided by |
I totally agree some kind of With that command, the pain described here can be solved. I was just trying to offer an alternative, I don't see any limitation why we can't add a hook executor not related to recipes, so we let users "to customize the client behavior without modifying the client sources". |
Thanks for the contribution! Merged, will be in 1.26. I see the docs are TBD, if you can please contribute them that would be great. If not possible, please let us know. Thanks! |
Changelog: Feature: Add
conan config init
command.Docs: conan-io/docs#1704
develop
branch, documenting this one.Background:
We need to customize the
settings.yml
file, because we need to add thedistro
setting as described in https://docs.conan.io/en/latest/extending/custom_settings.html#adding-new-settings.We don't like to maintain our own
settings.yml
, because this means for every new release ofclang
orgcc
we would need to update thesettings.yml
.To automatically create the
settings.yml
(and the other configuration files) I propose to introduce theconan config init
command.Our workflow:
conan config init
settings.yml
conan install [...]
or other conan commands.