summaryrefslogtreecommitdiff
path: root/dev-db/mongodb/files/mongodb-5.0.2-fix-scons.patch
blob: f66e52f1c9edd6cb0870cca3cbc4bdd83b4fb776 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
wrt PATH:
"""
https://jira.mongodb.org/browse/SERVER-94430 Upstream respond:

> we intentionally do not ingest the environment PATH as this makes build
> reproducibility and hermiticity much harder. Instead, you should set the
> absolute paths to the tools you want to use on the command line, instead of
> relying on the PATH.

Gentoo bug https://bugs.gentoo.org/829340

In Gentoo, we have LLVM slotted and we put clang in /usr/lib/llvm/18/bin (or
whatever), not in /usr/bin, and if upstream strip PATH and construct it
themselves, they surely won't contain this location.

So we add PATH backup for scons.
"""
--- a/SConstruct
+++ b/SConstruct
@@ -2366,7 +2366,6 @@ if env.TargetOSIs('posix'):
 
     # -Winvalid-pch Warn if a precompiled header (see Precompiled Headers) is found in the search path but can't be used.
     env.Append( CCFLAGS=["-fasynchronous-unwind-tables",
-                         "-ggdb" if not env.TargetOSIs('emscripten') else "-g",
                          "-Wall",
                          "-Wsign-compare",
                          "-Wno-unknown-pragmas",
@@ -2422,6 +2421,8 @@ if env.TargetOSIs('posix'):
 
     # env.Append( " -Wconversion" ) TODO: this doesn't really work yet
     env.Append( CXXFLAGS=["-Woverloaded-virtual"] )
+    env.Append( CXXFLAGS=os.environ['CXXFLAGS'] )
+    env.Append( LINKFLAGS=os.environ['LDFLAGS'] )
 
     # On OS X, clang doesn't want the pthread flag at link time, or it
     # issues warnings which make it impossible for us to declare link
@@ -2473,8 +2474,8 @@ if env.TargetOSIs('posix'):
             ],
         )
 
-    #make scons colorgcc friendly
-    for key in ('HOME', 'TERM'):
+    #make scons colorgcc, distcc, ccache friendly
+    for key in ('HOME', 'PATH', 'TERM'):
         try:
             env['ENV'][key] = os.environ[key]
         except KeyError: