[build2] Boost package

Boris Kolpackov boris at codesynthesis.com
Wed Nov 7 12:37:38 UTC 2018


Klaim - Joël Lamotte <mjklaim at gmail.com> writes:

> While I have some ideas of how to do it, could you clarify what you
> mean here by "making a build2 package out of vcpkg"?
> Do you mean, as I initially understood it, "translate the vcpkg cmake
> instructions to build2 buildfiles"?

Here is a high-level overview of the idea (note that it's still fuzzy
in a few areas).

1. Create a build2 build system module that provides a link-rule that
   can build a library out of/using vcpkg's uniform CMake interface.

   More specifically, build2 currently has a rule that can build you
   a library (lib{}) out of C/C++ source files (c{}, cxx{}) by calling
   the compiler and linker directly (I am simplifying a bit, but that's
   good enough for this situation). There is no reason why there cannot
   be another rule that can build you a library out of something else
   and/or in a different way. So the idea is to create a rule that can
   build a library by using the vcpkg's uniform CMake interface.

2. Given this rule, we can then take vcpkg's helper scripts and whatever
   else it needs to build things and package it into individual build2
   packages.

   Again, more specifically, we can create the vcpkg helper package that
   contains the common helpers (and, in the long run, probably the above
   build system module) with each library package containing the package-
   specific helpers and depending on the vcpkg package.

   Each library package will also contain normal build2 infrastructure,
   a buildfile that lists the lib{} target, etc. But instead of having
   'using cxx' in its root.build, it will have something like
   'using vcpkg-cmake' or some such.

   Hopefully we will be able to produce these packages automatically or
   almost automatically based on the vcpkg's CONTROL files (see ports/
   subdirectory).

The big unknown in this plan that needs further research is how uniform
the vcpkg's CMake interface and whether it will allow us to build things
that we need (like shared libraries on non-Windows platforms, etc).


> Although that seems like a good part of a solution, I'm not sure how
> it would work in practice. Our experience with some of the distributed
> compilation tools were catastrophic unfortunately.

Yes, one of build2's goals is to make it reliable and generally
available.


> I might be able to do some checks of this at dayjob (is distributed
> build already ready?).

Not yet. However, the C/C++ compilation model in build2 is already setup
with this in mind (things like partial preprocessing, etc) and the good
news (and also the reason for many "catastrophic" experiences) is that
it seem to be working pretty well.



More information about the users mailing list