Skip to content

Stop using libraries and header files from external/ #743

@nyh

Description

@nyh

Note: this is a controversial suggestion.

Originally, OSv's makefile assumed that the build machine has a C++ compiler, but any libraries or header files which we needed during compilation we took from an "external/*" submodule - where we put a specific known version of these libraries and headers (we usually took those from some version of Fedora). We did this for two reasons: first, repeatable builds (build result doesn't change when the build machine is upgraded), and second cross compilation (distributions often come with a cross-compiler, but not cross-compiled libraries).

But unfortunately, as OSv lived through several releases of distributions, compilers and libraries, the whole "external/" idea crumbled like a house of cards: Certain versions of gcc (remember that gcc itself was not included in external/) required certain versions of libgcc_s, certain versions of libstdc++ only went with certain versions of libgcc_s and gcc, libraries (such as Boost) pre-compiled with one version of libstdc++ would sometimes not work with other versions of libstdc++. So more and more, we changed the makefile to take libraries and header files from the build machine - not from external/.

However, we didn't finish this conversion, there are still libraries and headers in external/, and we still have places which use them and cause bugs - see for example issues #738, #619, #687, and probably #690.

I think we should do the following:

  1. Remove libraries and headers from external/
  2. Remove the build_env/ option from Makefile
  3. Make sure that usr.manifest.skel takes libraries from the build machine, not external/
  4. Fix the Makefile of various modules like cloud-init (see On Fedora 23, cloud-init module does does not run #738) which still take libraries or headers from external.
  5. For cross, compilation, write a script which fetches the relevant libraries for your cross-compiler. I.e., if you're running on Fedora 23 x86-64 a cross compiler for aarch64, we need to fetch the libraries from the aarch64 distribution of Fedora 23 (but can use the header files already installed on the host).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions