[build2] Recommended way to override build2 configuration CLI arguments

Boris Kolpackov boris at codesynthesis.com
Thu Mar 7 14:20:43 UTC 2019


Matthew Krupcale <mkrupcale at matthewkrupcale.com> writes:

> My desire is to have the proj-static/build/config.build specify
> `config.bin.lib=static` despite the first/default CLI value of
> `config.bin.lib=shared`, and I would like to make this override using
> a CLI argument rather than modifying the file directly.

Ok, that makes sense.


> Alternatively--and this may break some of the symmetry/consistency in
> the current design to reject overriding the same variable multiple
> times--we could allow only on the CLI to override options of the same
> visibility / scope by simply taking the last value in said visibility
> / scope when parsing the CLI. Thoughts?

Yes, I think this is the correct approach. The reason it hasn't been
done right away is the append/prepend (+=/=+) complication. For them
it would be sensible to combine the values but that might not be
easy to do correctly because we don't yet know their types. So I will
need to look into append/prepend in more detail. But can add support
for straight assignment in the meantime, if that would be helpful.



More information about the users mailing list