[build2] Kconfig support in build2

Boris Kolpackov boris at codesynthesis.com
Wed Jan 27 10:34:42 UTC 2021


Matthew Krupcale via users <users at build2.org> writes:

> > I think the best place is to get it as part of build2-toolchain (see
> > the above note for details).
> 
> I'm currently[2] using the tarballs at
> https://stage.build2.org/1/build2/ since I'd like to use the
> individual project tarballs for the respective Fedora package.

Yes, that will also work.


> One thing I noticed is that building libbuild2-kconfig[3] required
> building twice: once with the project's buildfile compiler arguments
> and once additionally with the config.* CLI provided arguments:
> 
> + cd libbuild2-kconfig-0.1.0
> + /usr/bin/b [...]
> libbuild2-kconfig-0.1.0-a.0.20210108084836.3687e4b95226/
> libbuild2-kconfig-tests-0.1.0-a.0.20210108084836.3687e4b95226/
> config.bin.lib=both
> '!config.import.libbuild2_kconfig=libbuild2-kconfig-0.1.0-a.0.20210108084836.3687e4b95226/'

A build system module must not be built in the same build configuration
as a project that loads it (libbuild2-kconfig-tests in this case). What
happens in this case is that the module is updated in two build contexts
as part of the the same build system invocation, which is, to borrow a
C++ term, UB-NDR (undefined behavior, no diagnostics required). See class
context[1] for details.

The way I would arrange this build is along these lines:

/usr/bin/b [...] libbuild2-kconfig/

/usr/bin/b [...] libbuild2-kconfig-tests/ \
'!config.import.libbuild2_kconfig=libbuild2-kconfig/'

[1] https://github.com/build2/build2/blob/master/libbuild2/context.hxx#L101



More information about the users mailing list