-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Dump the Bazel RBE containers to the local system and point clang/gcc at the appropriate system library/include directories inside via specifying a sysroot parameter
Audit of a build created with --config=local on an ubuntu system
> 1. All 10,036 declared aquery inputs are under external/. No inputs reside in /usr, /lib, /etc, or any other host path.
> 2. mongo_with_debug-2.params has zero absolute host paths. Every path is Bazel-relative — external/... or bazel-out/....
> 3. All -L flags point inside Bazel-managed trees:
> - external/mongo_toolchain_v5/stow/gcc-v5/lib/gcc/aarch64-mongodb-linux/14.2.0 (toolchain's own libgcc)
> - external/mongo_toolchain_v5/v5/lib, .../v5/lib64 (toolchain's libstdc++ etc.)
> - The sysroot adds external/rbe_sysroot/sysroot/lib/aarch64-linux-gnu/, usr/lib/aarch64-linux-gnu/, etc. via --sysroot.
> 4. The linker binary itself is external/mongo_toolchain_v5/stow/llvm-v5/bin/clang++ (visible in the link command) — the toolchain ships
> its own clang/lld, not the host's.
> 5. CRT objects and libc came from the sysroot: crt1.o, crti.o, crtn.o, Scrt1.o, libc.so, ld-linux-aarch64.so.1 are all in
> external/rbe_sysroot/sysroot/lib/aarch64-linux-gnu/.
Follow up work:
1. Set up tooling to evaluate that the build is hermetic (no files outside of the repo root pulled in as dependencies)
2. Set up tooling to periodically rebuild install-dist on an old commit on each platform that alerts upon checksum drift
3. Set up s390x/ppc rhel8+rhel9 containers to enable this over there
4. Get the green light for MacOS cross compilation in production, which already is fully reproducible since it doesn't use local system libraries
5. Figure out what to do with windows (cross compile or figure out some way to guarantee that all inputs on the local system don't drift)