[SERVER-82157] Bazel scons integration will sometimes fail to compile due to nonexistent output dirs Created: 12/Oct/23  Updated: 29/Oct/23  Resolved: 13/Oct/23

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

Type: Bug Priority: Major - P3
Reporter: Zack Winter Assignee: Zack Winter
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Right now the scons-bazel integration performs a copy step to move the artifacts from the bazel ouput dir to the scons ouput dir. The copy logic requires the scons output directory for that target to exist.

This doesn't play well with the current issue where we always build all bazel targets (SERVER-81923). It appears that scons will not create the output directory for targets not explicitly requested on the CLI, triggering the following error:

rm build/fast -r; python3 ./buildscripts/scons.py BAZEL_BUILD_ENABLED=1 --build-profile=fast --ninja=disabled --link-model=dynamic -j 200 --modules= build/fast/mongo/platform/libvisibility_test_libcommon.a
 
...
Running bazel build command: /home/ubuntu/mongo/bazelisk build //src/mongo/platform:visibility_test_libcommon //src/mongo/db/commands:fsync_locked --//bazel/config:compiler_type=clang --dynamic_mode=fully
 
INFO: Analyzed 2 targets (0 packages loaded, 0 targets configured).
INFO: Found 2 targets...
INFO: Elapsed time: 0.333s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
 
scons: *** [build/fast/mongo/platform/libvisibility_test_libcommon.a] /home/ubuntu/mongo/build/fast/mongo/db/commands/libfsync_locked.a: No such file or directory
scons: building terminated because of errors.



 Comments   
Comment by Githook User [ 13/Oct/23 ]

Author:

{'name': 'Zack Winter', 'email': 'zack.winter@mongodb.com', 'username': 'zackwintermdb'}

Message: SERVER-82157 always create scons output dirs before copying over bazel bins
Branch: master
https://github.com/mongodb/mongo/commit/d2b9d9bbf49a427ed699804fd0cf889ea5dc2c6a

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