[SERVER-60972] Have compilation log the MONGO_VERSION and note its impact on `releases.h` Created: 25/Oct/21  Updated: 27/Oct/23  Resolved: 15/Dec/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Daniel Gottlieb (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: Dev Platform 2021-11-15, Dev Platform 2021-11-29, Dev Platform 2021-12-13, Dev Platform 2021-12-27
Participants:

 Description   

Successful compilation now requires a correct MONGO_VERSION variable that creates a releases.h header from a template containing FCV constants the rest of the checked in code references.

If this file is generated from a bad MONGO_VERSION value (i.e: 5.1 when the code references FCV 5.2), this results in compile errors that often require expert help to diagnose and solve.

In an effort to make these issues more self-diagnosable, I'd like to see:

  • Everytime compilation is invoked, either via ninja or scons and with changed files, the (evaluated) value of MONGO_VERSION being used should be reported in its own log line.
  • A following log line reporting that the releases.h file is generated using that as its primary input.

As an example, we could perhaps add the plused (+) lines to the example output:

Creating 'build/newninja/mongo/config.h'
+ MONGO_VERSION evaluated to 5.2.0-alpha
+ releases.h is being regenerated with current FCV value of 5.2
/bin/icerun /opt/mongodbtoolchain/v3/bin/python3 buildscripts/cheetah_source_generator.py -o build/newninja/mongo/idl/feature_flag_test.idl src/mongo/idl/feature_flag_test.idl.tpl src/mongo/util/version/releases.yml 5.2.0-alpha
Creating 'build/newninja/mongo/util/version_constants.h'
Creating 'build/newninja/third_party/third_party_shim.cpp'
Creating 'build/newninja/third_party/wiredtiger/wiredtiger.h'
mkdir -p build/scons/icecream && ICECC_VERSION_TMP=$(/bin/icecc-create-env --clang /opt/mongodbtoolchain/v3/bin/clang /opt/mongodbtoolchain/v3/bin/clang++ | awk '/^creating .*\.tar\.gz/ { print $2 }') && mv $ICECC_VERSION_TMP build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz
tar xfO build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz | shasum -b -a 256 - | awk '{ print $1 }' > build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz.sha256
ln -f build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz build/scons/icecream/icecream_py_sha256_$(cat build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz.sha256).tar.gz
echo /home/dgottlieb/xgen/mongo/build/scons/icecream/icecream_py_sha256_$(cat build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz.sha256).tar.gz > build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz.sha256.path
<lambda>([None], ["build/scons/icecream/icecc-create-env._opt_mongodbtoolchain_v3_bin_clang_opt_mongodbtoolchain_v3_bin_clang++.tar.gz.sha256.path"])
Creating 'build/scons/icecream/run-icecc.sh'
Chmod("build/scons/icecream/run-icecc.sh", "u+x")
scons: done building targets.
[4671/4671 (100%) 290.366s] Install bin/db_unittest_test


Generated at Thu Feb 08 05:51:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.