shipping nightly and bldenv is a recipe for flag days
Today, we ship
/opt/onbld/bin/bldenv in the developer/build/onbld package. These tools necessarily require a lot of knowledge of the build, as they are responsible for correctly orchestrating it through the environment and the sequence of commands that are executed. As such, any change to these tools can become a flag day between the older shipped version of the tool installed on the build machine, and the version of the tool included in the repository where it can match the rest of the source.
These tools really present two interfaces:
- upward, to the user: the flags and environment file overrides that the user specifies as input to
nightlymight be considered if not stable, at least not a good target for capricious change, as both humans and build scripts tend to depend on invoking them a particular way
- downward, to the Makefile infrastructure and the build itself:
nightlysets environment variables in a particular way, and invokes
maketargets and other commands in the gate source in a particular sequence
The latter interface should be considered totally private, so that we can evolve and improve the build system as a whole. While an apparently correct build may at times result from using a
nightly from outside the gate, the only way to be sure is to use the one that matches the rest of the source.
As of #11224, both
bldenv are directly executable in-place in the source tree, even without running
dmake setup. We should stop shipping them in the
onbld package. We can leave them in the tools proto area for compatibility with existing CI/CD tools and scripts that expect to find them there after doing
Updated by Alexander Pyhalov 2 months ago
I've checked, in OI we use nightly and buildenv to build
1) illumos-gate - nightly is used as
time $(ENV) -i ./usr/src/tools/scripts/nightly illumos.sh
2) slim_source (Caiman) - uses own nightly copy as
cp usr/src/tools/env/nightly $(BUILD_DIR)/$(MACH)/nightly && \ chmod u+wx $(BUILD_DIR)/$(MACH)/nightly && \ NIGHTLY="$(BUILD_DIR)/$(MACH)/nightly"
3) gfx-drm - uses own bldenv copy as
cp tools/bldenv $(BUILD_DIR)/$(MACH)/bldenv && \ BLDENV=$(BUILD_DIR)/$(MACH)/bldenv
So, we should be safe if nightly/bldenv is not packaged.