[SERVER-42889] Scons failing with --config=force Created: 19/Aug/19  Updated: 29/Oct/23  Resolved: 09/Sep/19

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

Type: Bug Priority: Major - P3
Reporter: Charlie Swanson Assignee: Mathew Robinson (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-43183 Cleanup doConfigure in SConstruct Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Dev Tools 2019-09-09, Dev Tools 2019-09-23
Participants:

 Description   

it looks like my compile stopped working recently with the following error:

./buildscripts/scons.py --variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars \                                                                                                                                                                 (master|✚3…)
    CCFLAGS='-gsplit-dwarf' --link-model=dynamic --config=force \
    MONGO_VERSION='0.0.0' MONGO_GIT_HASH='unknown' \
    VARIANT_DIR=ninja --icecream \
    mongod
...
KeyError: 'MONGO_MODULES':
  File "/home/charlie/github/new-mongo/SConstruct", line 3686:
    env = doConfigure( env )
  File "/home/charlie/github/new-mongo/SConstruct", line 3587:
    if 'enterprise' not in env['MONGO_MODULES']:
  File "/home/charlie/github/new-mongo/src/third_party/scons-3.1.1/scons-local-3.1.1/SCons/Environment.py", line 410:
    return self._dict[key]

Removing the --config=force fixed the issue.



 Comments   
Comment by Githook User [ 05/Sep/19 ]

Author:

{'username': 'chasinglogic', 'email': 'mathew.robinson@mongodb.com', 'name': 'Mathew Robinson'}

Message: SERVER-42889 Consistently use the configure context env in doConfigure
Branch: master
https://github.com/mongodb/mongo/commit/5164447331290ea11bfcad48194317517821c78c

Comment by Mathew Robinson (Inactive) [ 03/Sep/19 ]

This is caused by our modules system expecting the configure context env attribute to point to the global environment object.

With SCons 3.1.1 we fixed it such that override environments are inherited so when we ask for the env from the configure context we're getting it's override environment and not the pointer to the global env that it used to return.

This is a bug in the modules system it should have required an explicit env from the start and I'm working on a patch now.

Comment by Charlie Swanson [ 19/Aug/19 ]

Yes I plan to.

Comment by Andrew Morrow (Inactive) [ 19/Aug/19 ]

Can you try not using it for a while and see if everything still works?

Comment by Charlie Swanson [ 19/Aug/19 ]

I do not remember the details. At some point it entered my tool belt along with things like "just nuke the build directory and start again" as a thing that sometimes works to make compile happen.

Comment by Andrew Morrow (Inactive) [ 19/Aug/19 ]

Why are you using --config=force?

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