[build2] Installation Configuration Variables: Absolute Paths, Config Location, Version Tag

Boris Kolpackov boris at codesynthesis.com
Thu Apr 22 13:27:35 UTC 2021


The second part of the reply.

Markus Pawellek via users <users at build2.org> writes:

> Furthermore, I would like to request a new feature.
> In my opinion, another 'config.install' variable
> for specifying the location of the program's system configuration files,
> like in the following, could be useful.
> 
> config.install.etc    = data_root/etc
> config.install.config = etc/<project>

Traditionally, config.install.etc is the directory for project's
configuration files. In my experience, it's up to the project to
decide whether they want to install directly into etc/ (normally
the case if there is a single configuration file), or into a
subdirectory (normally the case if there are multiple), or into
both.

And currently this can be achieved both from inside the project:

file{myprog.conf}: install = etc/$project/

Or from the outside by whomever is installing the program:

$ b config.install.etc='data_root/etc/<project>'

So having config.install.config seems to only add a convenience
alias. Or am I missing something?


> The build system would then be able to create the given directory
> and copy default system configuration files that are given by the
> project when installing it.
>
> Also this absolute path could be inserted into a generated C++ file.

This is already possible as shown above (and by my other reply;
nothing prevents you from calling $install.resolve(etc/$project/)).


> Additionally, if different versions of a project are allowed
> and need different configurations and/or resource files,
> the tag '<version>' would come in handy
> when defining the directories of the installation,
> like in the following.
> 
> config.install.data   = share/<private>/<project>/<version>
> config.install.config = etc/<private>/<project>/<version>

Yes, I think that's a good idea. I've implemented it and it will
be available with the tomorrow's restage.



More information about the users mailing list