Skip to content

[feature] Serialize build configuration for later use #18369

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

Open
1 task done
jasal82 opened this issue May 27, 2025 · 1 comment
Open
1 task done

[feature] Serialize build configuration for later use #18369

jasal82 opened this issue May 27, 2025 · 1 comment
Assignees

Comments

@jasal82
Copy link
Contributor

jasal82 commented May 27, 2025

What is your suggestion?

It would be very helpful if Conan could serialize all build configuration (settings, options, conf, etc) for a specific build into a file that I can use later as input to another Conan command instead of having to replicate all of the original command line arguments. For example, let's assume we run a build like this:

conan build . -pr:h host_profile -pr:h additional_host_profile -pr:b build_profile -c:h user.custom:myconf=123 -o:b "pkg/*:enable=True --lockfile-out=build.lock --build-conf-out=build.conf"

Then I want to be able to run a custom command later that replicates all of the build configuration and dependency graph by doing

conan custom:command --lockfile=build.lock --build-conf=build.conf

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide
@jasal82 jasal82 changed the title [feature] Serialize configuration for later use [feature] Serialize build configuration for later use May 27, 2025
@memsharded memsharded self-assigned this May 28, 2025
@memsharded
Copy link
Member

Hi @jasal82

Thanks for your suggestion.

I think this escapes a bit of the functionality and UX expected by a command line tool in general.
The shells have utilities in order to avoid having to retype things, for example, just storing the args in a variable, like (in windows):

set "MYARGS=-pr=default --build=missing -o *:shared=True -s compiler.cppstd=20"
conan create . %MYARGS%

or using some terminal, shell capabilities, like:

  • Use history up to get to the previous command
  • shell shortcut to go to the beginning of line quickly
  • type the new command

I think this is probably even less keystrokes than having to remember to type --build-conf-out=build.conf in advance, and then having to type --build-conf=build.conf later.

Furthermore, to implement this, it would be necessary either a bunch of messing with the Python args, as it would be necessary to intercept the --build-conf argument, deserialize it, then inject those values dynamically in any other args, which might potentially conflict with user provider args (and then the discussion would be which one should have more precedence), or adding new extra custom logic in absolutely all Conan commands, which is a bit overkill.

I think this feature is a bit too costly and outside of the scope for the value, marking it as unplanned, but thanks very much for the feedback anyway!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants