-
Type: Improvement
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Build
-
Fully Compatible
-
0
As part of the bazel migration, we want to remove converted scons nodes as soon as possible. Unfortunately as long as SCons is building the top level libraries, it needs to be aware of all transitive dependencies to use in its link args (-l directive) even after they've been converted to bazel.
To achieve this, the plan is to create "thin targets" that encapsulate the dependency chain of all bazel targets underneath, without including the source file information usually included in a scons target.
Ex for the dependency chain a -> b -> c, where "a" is a program and "b" and "c" have been converted to bazel:
SConstruct:
env.Program( name="a" LIBDEPS=["b", ...] ) env.ThinTarget( name="b" )
BUILD.bzl:
cc_library(name="b", deps=["c"], src=["b.cpp"]) cc_library(name="c", src=["c.cpp"])
This allows us to avoid the double-implementation issue since the top level target is just a shallow reference (it's just a name).
The implementation we've discussed is to have SCons invoke "bazel query" on the thin target to pull out the dependency tree underneath and then copy over the resulting artifacts as usual.
- depends on
-
SERVER-80630 Support Install system
- Closed
-
SERVER-87291 Add bazel build up front option to scons
- Closed
- is related to
-
SERVER-80959 Add default set of targets to execute in CI
- Closed