[build2] build2 0.14.0 released

Boris Kolpackov boris at codesynthesis.com
Mon Nov 1 14:14:47 UTC 2021

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

> On Mon, Oct 25, 2021 at 6:31 AM Boris Kolpackov <boris at codesynthesis.com> wrote:
> >
> > I am not sure what you mean by config.install=false here
> The intent is to prevent installing the ODB dependencies because I
> don't want to distribute the bundled beta version libraries. I don't
> remember how I came up with this configuration and can't seem to find
> a record of it on the mailing lists or documentation, but I thought
> this was the proper method somehow. I probably just got the idea from
> "install = false" found in buildfiles to prevent installing a
> particular target set.

I checked and I can confirm there is no config.install variable (yet).

> > the straightforward solution would be to not build liba{}'s if you don't
> > want to install them.
> They are built as static libraries specifically in order to bundle
> them and not distribute them as separate artifacts.

Ah, I see, that makes sense.

> If there's no way to avoid installing the static libraries, I can just
> install them and then delete them for the actual package distribution,
> but I suppose it might be good to allow an exception for static
> libraries to not be required for installation of dependent artifacts.

Yes, this is actually a deep rabbit hole. First, here is a minimal
reproducer of this situation:

bdep new --vcs=none -t lib libhello
bdep new --vcs=none -t exe hello

sed -i -e 's/#import/import/' hello/hello/buildfile

b configure: libhello/ config.bin.lib=static
b configure: hello/ config.import.libhello=libhello/ \

b install: hello/ '!config.install.scope=project'
error: incompatible libhello/libhello/liba{hello} build
  info: library is built not for install
  info: while updating (for install) hello/hello/exe{hello}

The first fix that comes to mind is to remove this check for static
libraries. But that's not quite correct in our model because a library
might build differently when for install (a typical example is to
embed some installation paths where to find resources). If we simply
remove the check, then the executable will be linked to the wrong
build of the library.

So it feels like we should still build it "as if for install" but
actually not install it. We could do this by introducing something
like config.install=false but perhaps a more elegant solution is to
only apply config.install.scope for the install operation itself and
not for the update-for-install pre-operation.

I've tried this change it works for the above test case. Do you see
any issues with going this route?

More information about the users mailing list