[SERVER-64757] Improve error messages when scons fails to generate-ninja on Windows Created: 21/Mar/22  Updated: 29/Oct/23  Resolved: 13/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.2, 4.4.14, 5.0.8, 6.0.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Richard Samuels (Inactive) Assignee: Richard Samuels (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.3, v5.0, v4.4
Sprint: Dev Platform 2022-04-04, Dev Platform 2022-04-18
Participants:

 Description   

I attempted to run the generate-ninja target on Windows in a Cygwin Terminal (through RDP) with the following scons invocation:

python buildscripts/scons.py --ssl MONGO_DISTMOD=windows CPPPATH="c:/sasl/include c:/snmp/include" LIBPATH="c:/sasl/lib c:/snmp/lib" -j$(( $(grep -c ^processor /proc/cpuinfo) / 2 )) --win-version-min=win10 --ninja generate-ninja

and was greeted to this error message:

scons: done reading SConscript files.
scons: Building targets ...
scons: *** [build\opt\mongo\db\index\sort_key_generator.obj] Exception : Could not resolve path for cl dependency on node 'build\opt\mongo\db\index\sort_key_generator.ob
j'
scons: building terminated because of errors.
build\opt\mongo\db\index\sort_key_generator.obj failed: Exception : Could not resolve path for cl dependency on node 'build\opt\mongo\db\index\sort_key_generator.obj'

The cause of this error was that I did not run vcvarsall.bat amd64, so scons did not have the correct environment variables set. Can we emit a more helpful error message in this situation? 

Dan Moody's suggestion was:

Could not resolve path for $TOOL dependency on node $TARGET, you may need to setup your shell environment for ninja builds.

 



 Comments   
Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Richard Samuels', 'email': 'richard.l.samuels@gmail.com', 'username': 'richardsamuels'}

Message: SERVER-64757 Improve error messages when scons fails to generate-ninja on Windows

(cherry picked from commit 4db485642f9d1d3675308e8415da27c4ef212b79)
Branch: v5.0
https://github.com/mongodb/mongo/commit/3c078de17292a93d369921c0f1178eddb4dc5ed8

Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Richard Samuels', 'email': 'richard.l.samuels@gmail.com', 'username': 'richardsamuels'}

Message: SERVER-64757 Improve error messages when scons fails to generate-ninja on Windows

(cherry picked from commit 4db485642f9d1d3675308e8415da27c4ef212b79)
Branch: v5.3
https://github.com/mongodb/mongo/commit/6ad9b9b8d780d1c400c44ad1bcc9051232ac8b4a

Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Richard Samuels', 'email': 'richard.l.samuels@gmail.com', 'username': 'richardsamuels'}

Message: SERVER-64757 Improve error messages when scons fails to generate-ninja on Windows

(cherry picked from commit 4db485642f9d1d3675308e8415da27c4ef212b79)
Branch: v4.4
https://github.com/mongodb/mongo/commit/1114c6f99f229c6ff7d79d19f8b7b0cede65e349

Comment by Githook User [ 12/Apr/22 ]

Author:

{'name': 'Richard Samuels', 'email': 'richard.l.samuels@gmail.com', 'username': 'richardsamuels'}

Message: SERVER-64757 Improve error messages when scons fails to generate-ninja on Windows
Branch: master
https://github.com/mongodb/mongo/commit/4db485642f9d1d3675308e8415da27c4ef212b79

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