[SERVER-64803] Format Macros bug when building the server w/ static linking Created: 22/Mar/22  Updated: 29/Oct/23  Resolved: 21/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.0.0-rc3, 6.1.0-rc0

Type: Bug Priority: Major - P3
Reporter: Maddie Zechar Assignee: Ryan Egesdahl (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
Operating System: ALL
Backport Requested:
v6.0
Sprint: Dev Platform 2022-04-18, Dev Platform 2022-05-02
Participants:

 Description   

I ran into an issue trying to build the server on my ubuntu1804-workstation with static linking.

scons command:
./buildscripts/scons.py --ninja generate-ninja --modules= --variables-files=etc/scons/mongodbtoolchain_stable_gcc.vars --link-model=static --dbg=on --opt=off ICECC=icecc CCACHE=ccache

then running ninja resulted in this error:
[405/4643 ( 8%) 29.614s] Compiling build/debug/mongo/db/index/duplicate_key_tracker.o
ICECC[8003] 17:14:29: flush_writebuf() failed Connection reset by peer
ICECC[8003] 17:14:29: write of source chunk to host 10.122.1.92
ICECC[8003] 17:14:29: failed Connection reset by peer
ICECC[8003] 17:14:29: got exception Error 15 - write to host failed (10.122.1.92)
[2100/4643 ( 45%) 981.709s] Compiling build/debug/mongo/db/s/balancer/balancer_commands_scheduler_impl.o
ICECC[20521] 17:30:18: flush_writebuf() failed Connection reset by peer
ICECC[20521] 17:30:18: write of source chunk to host 10.122.1.92
ICECC[20521] 17:30:18: failed Connection reset by peer
ICECC[20521] 17:30:18: got exception Error 15 - write to host failed (10.122.1.92)
[3097/4643 ( 66%) 1581.883s] Compiling build/debug/mongo/s/transaction_router.o
ICECC[27856] 17:40:16: flush_writebuf() failed Connection reset by peer
ICECC[27856] 17:40:16: write of source chunk to host 10.122.1.92
ICECC[27856] 17:40:16: failed Connection reset by peer
ICECC[27856] 17:40:16: got exception Error 15 - write to host failed (10.122.1.92)
[4220/4643 ( 90%) 1665.042s] Compiling build/debug/third_party/mozjs/platform/x86_64/linux/build/Unified_cpp_js_src14.o
In file included from src/third_party/mozjs/platform/x86_64/linux/build/Unified_cpp_js_src14.cpp:29:
src/third_party/mozjs/extract/js/src/vm/BytecodeUtil.cpp:13: warning: "__STDC_FORMAT_MACROS" redefined
#define __STDC_FORMAT_MACROS

<command-line>: note: this is the location of the previous definition
[4643/4643 (100%) 1802.534s] Install build/debug/install/bin/mongod

I fixed it by reverting this commit https://github.com/mongodb/mongo/commit/86da2a644b2a7bcb2ad6c0ea463e7ddc8ca6c6ac and then rebuilding.



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

Author:

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

Message: SERVER-64803 Check for C99 libc headers during build

(cherry picked from commit 8e9d52279220f790eb1aac6e64679b8cf11501a2)
Branch: v6.0
https://github.com/mongodb/mongo/commit/f4feff2da95f845a573e40ca71fb36f8a80ee6d8

Comment by Ryan Egesdahl (Inactive) [ 21/Apr/22 ]

For the sake of later archaeologists, this problem was caused by an upgrade to MozJS to support MacOS ARM and only happened on RHEL 6 due to an old glibc version. Its occurrence was limited to our performance build hosts, which are currently running RHEL 6, though we are as of this writing in the process of determining how best to update them. We never backported the MozJS upgrade to any branch that still supports RHEL 6.0, so this would never have occurred on a supported release build.

Comment by Githook User [ 20/Apr/22 ]

Author:

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

Message: SERVER-64803 Check for C99 libc headers during build
Branch: master
https://github.com/mongodb/mongo/commit/8e9d52279220f790eb1aac6e64679b8cf11501a2

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