Skip to content

Conversation

tmewett
Copy link

@tmewett tmewett commented Aug 15, 2025

This is a showcase of baselibs building with all system dependencies for all libraries and tools, for demonstration and discussion.

The S-CORE infrastructure team has been discussing how S-CORE can be integrated into a wider system. It is usually requirements for integrators that:

  • they can control all dependencies and tools in a centralised manner, e.g. via a meta-build tool such as Bitbake or BuildStream
  • no pre-built binaries are brought in by any component

Currently, S-CORE components do not meet either of these requirements, because:

  • all dependencies are pinned to exact versions and pulled in by Bazel
  • a specific pre-built compiler is downloaded
  • pre-built libraries are downloaded from Ubuntu (though this one is just a temporary workaround)

This PR modifies baselibs to address these points. All dependencies now must be installed in the system in order to build. For me on Ubuntu, that means installing these packages:

g++ libacl1-dev libcap-dev libseccomp-dev valgrind libboost-container1.83-dev nlohmann-json3-dev

I had to delete some JSON tests because:

- they use tmpnam
- tmpnam causes the linker to emit a warning, since it's unsafe
- Bazel linking rules treat warnings as errors

I tried adding the linkopt -Wl,--no-fatal-warnings but it had no effect.
@lurtz
Copy link
Contributor

lurtz commented Aug 18, 2025

I guess this goes hand in hand with #15

@opajonk
Copy link

opajonk commented Aug 19, 2025

I guess this goes hand in hand with #15

Yes, probably. The devcontainer could supply these dependencies for "development host builds", of course.

@tmewett
Copy link
Author

tmewett commented Aug 21, 2025

By the way, my system GCC is version 13. I've been trying to build with 14 and 15 too, and they pick up a lot of new errors with baselibs, such missing #includes. So this PR will only build with GCC 13 and lower.

common --//score/json:base_library=nlohmann
common --extra_toolchains=@gcc_toolchain//:host_gcc_12
build --incompatible_strict_action_env
build --cxxopt=-std=c++17 --cxxopt=-Wno-error=deprecated-declarations --cxxopt=-Wno-error=self-move --cxxopt=-Wno-error=pessimizing-move
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a good solution for compiler flags, since this .bazelrc is not applied when building this project as a dependenciy via another Bazel project.

A better approach would be to define a toolchain in Bazel which just wraps the system compiler and exposes flags as features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants