[SERVER-47598] locally installed mongodbtoolchains can affect remote icecream builds Created: 16/Apr/20  Updated: 29/Oct/23  Resolved: 18/Aug/20

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

Type: Bug Priority: Major - P3
Reporter: Eric Cox (Inactive) Assignee: Andrew Morrow (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-49466 Introduce a --build-tools=next flag t... Closed
is depended on by SERVER-39392 Invariant in PlanStage::dispose alway... Closed
Related
related to SERVER-39392 Invariant in PlanStage::dispose alway... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.4
Steps To Reproduce:

Modify a local mongodbtoolchain installation to break behavior.
In this case, Drew's toolchain contained a patched binutils. I was able to reproduce the bug by running

$ rm -rf build // from mongo root

$PY buildscripts/scons.py -j8 \
      --link-model=dynamic \
      --modules=“” \
      --variables-files= --variables-files=./etc/scons/mongodbtoolchain_stable_gcc.vars  \
      ICECC=icecc CCACHE= \
      build/opt/third_party/libshim_unwind.so

The error manifests as

mkdir -p /home/eric/repos/mongo/build/scons/icecc && ICECC_VERSION_TMP=$(/usr/bin/icecc-create-env --gcc /opt/mongodbtoolchain/v3/bin/gcc /opt/mongodbtoolchain/v3/bin/g++ | awk '/^creating .*\.tar\.gz/ { print $2 }') && mv $ICECC_VERSION_TMP build/scons/icecc/opt_mongodbtoolchain_v3_bin_gcc_opt_mongodbtoolchain_v3_bin_g++.tar.gz
Compiling build/opt/third_party/shim_unwind.dyn.o
Linking build/opt/third_party/libshim_unwind.so
/opt/mongodbtoolchain/revisions/91aa820a4e15ec424e214cdc861c1f4aa575a72c/stow/gcc-v3.fox/lib/gcc/x86_64-mongodb-linux/8.2.0/../../../../x86_64-mongodb-linux/bin/ld.gold: warning: build/opt/third_party/shim_unwind.dyn.o: section .debug_str contains incorrectly aligned strings; the alignment of those strings won't be preserved
/opt/mongodbtoolchain/revisions/91aa820a4e15ec424e214cdc861c1f4aa575a72c/stow/gcc-v3.fox/lib/gcc/x86_64-mongodb-linux/8.2.0/../../../../x86_64-mongodb-linux/bin/ld.gold: error: treating warnings as errors
collect2: error: ld returned 1 exit status
scons: *** [build/opt/third_party/libshim_unwind.so] Error 1
scons: building terminated because of errors.
build/opt/third_party/libshim_unwind.so failed: Error 1 

Sprint: Dev Platform 2020-05-04, Dev Platform 2020-05-18, Dev Platform 2020-06-01, Dev Platform 2020-06-15, Dev Platform 2020-06-29, Dev Platform 2020-07-13, Dev Platform 2020-07-27, Dev Platform 2020-08-10, Dev Platform 2020-08-24
Participants:

 Description   

My dynamic build was broken due to warnings being marked as errors. The warnings were showed up as,
warning: build/opt/third_party/shim_unwind.dyn.o: section .debug_str contains incorrectly aligned strings; the alignment of those strings won't be preserved

I was able to hack around this by using `--disable-warnings-as-errors` in my scons invocation.

I am running 
icecc --version
ICECC 1.1

OS

No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

Toolchain version

91aa820a4e15ec424e214cdc861c1f4aa575a72c



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

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-50363 Merge --build-tools=next into stable

Merging the following fixes into the stable version of the build tools
and migrate fully from --ninja=next to the --build-tools=next:

(cherry picked from commit 78bb3f3c8a658a5a9fec8d55864e426382f68bd0)
Branch: v4.4
https://github.com/mongodb/mongo/commit/e7f6696a96db5438a269c5e67a06ff9e05cb897a

Comment by Githook User [ 07/Oct/20 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-50363 Merge --build-tools=next into stable

Merging the following fixes into the stable version of the build tools
and migrate fully from --ninja=next to the --build-tools=next:

(cherry picked from commit 78bb3f3c8a658a5a9fec8d55864e426382f68bd0)
Branch: v4.4
https://github.com/mongodb/mongo/commit/7b93770e0835087c023ae3e3f36eeb46d204767f

Comment by Githook User [ 06/Oct/20 ]

Author:

{'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}

Message: SERVER-50363 Merge --build-tools=next into stable

Merging the following fixes into the stable version of the build tools
and migrate fully from --ninja=next to the --build-tools=next:

Comment by Githook User [ 18/Aug/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-47598 Refactor ICECC_VERSION handling

(cherry picked from commit 0662433ac038f4f3cf137a1be30ca245c180e990)
Branch: v4.4
https://github.com/mongodb/mongo/commit/5797394f7e4215b82e5adf424ffeba41ea7a34b8

Comment by Andrew Morrow (Inactive) [ 18/Aug/20 ]

The fix is available (currently only on master, but on v4.4 shortly) under the --build=next flag.

Comment by Githook User [ 18/Aug/20 ]

Author:

{'name': 'Andrew Morrow', 'email': 'acm@mongodb.com', 'username': 'acmorrow'}

Message: SERVER-47598 Refactor ICECC_VERSION handling
Branch: master
https://github.com/mongodb/mongo/commit/0662433ac038f4f3cf137a1be30ca245c180e990

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