[SERVER-38674] --ssl=off builds emit a scons warning Created: 17/Dec/18  Updated: 29/Oct/23  Resolved: 24/Jan/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.0.7, 4.1.8

Type: Bug Priority: Major - P3
Reporter: Gabriel Russell (Inactive) Assignee: Mathew Robinson (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:
v4.0
Sprint: Dev Tools 2019-01-28
Participants:

 Description   

 [2018/12/17 00:09:03.866]     -j$(grep -c ^processor /proc/cpuinfo) --ssl=off --variables-files=etc/scons/mongodbtoolchain_gcc.vars --enable-free-mon=off --enable-http-client=off --release --use-new-tools --build-mongoreplay="true" --detect-odr-violations            \
 [2018/12/17 00:09:03.866]     --cache=nolinked --cache-dir='/efs/f384a95c-1f42-50fb-b6c9-7ac3d59f9359/scons-cache' $extra_args                                                \
 [2018/12/17 00:09:03.866]     core tools dbtest integration_tests dist dist-debugsymbols distsrc-tgz   MONGO_VERSION=4.1.6-193-g0a29c7a7c5 || exit_status=$?

results in:

 [2018/12/17 00:09:19.973] scons: warning: Two different environments were specified for target ssl_manager_none.o,
 [2018/12/17 00:09:19.973] 	but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $PROGCXXFLAGS $CCFLAGS $PROGCCFLAGS $_CCCOMCOM $SOURCES
 [2018/12/17 00:09:19.973] File "/data/mci/dd27e9b32be13edac90608db64750c68/src/src/mongo/util/net/SConscript", line 144, in <module>

it's probably the result of some work done in the embedded project eliminating the dependency on ssl-something

an example task



 Comments   
Comment by Githook User [ 11/Feb/19 ]

Author:

{'name': 'Mathew Robinson', 'email': 'chasinglogic@gmail.com', 'username': 'chasinglogic'}

Message: SERVER-38674 Remove SCons warning with --ssl=off

(cherry picked from commit ccbd643a6a782a72712ce6cc76ed1f568900d326)
Branch: v4.0
https://github.com/mongodb/mongo/commit/77b9250464bc7f4f9acf0457a8a601d6637707b0

Comment by Githook User [ 24/Jan/19 ]

Author:

{'email': 'chasinglogic@gmail.com', 'name': 'Mathew Robinson', 'username': 'chasinglogic'}

Message: SERVER-38674 Remove SCons warning with --ssl=off
Branch: master
https://github.com/mongodb/mongo/commit/ccbd643a6a782a72712ce6cc76ed1f568900d326

Comment by Mathew Robinson (Inactive) [ 18/Jan/19 ]

It's specifically related to the file name, if the target name is none it works without warning.

Comment by Andrew Morrow (Inactive) [ 18/Jan/19 ]

And the next question, as gabriel.russell rightly points out, is to find out whether this is something we have broken, or something that is broken in SCons itself.

Comment by Andrew Morrow (Inactive) [ 18/Jan/19 ]

Might be worth refining the test a little bit. Is it the target name or the source file name (or both!) that causes the issue?

Comment by Mathew Robinson (Inactive) [ 18/Jan/19 ]

(.venv) @homebase ➜  mongo git:(ssl-off-warning) ✗ SCONSFLAGS=""; python ./buildscripts/scons.py --ssl=off --enable-http-client=off --enable-free-mon=off -Q
scons version: 2.5.0
python version: 2 7 15 'final' 0
Compiling build/opt/mongo/util/net/ssl_manager_some.o

Renamed to none:

(.venv) @homebase ➜  mongo git:(ssl-off-warning) ls -l src/mongo/util/net | grep ssl_manager
-rw-r--r--   1 chasinglogic  staff  39536 Jan 17 07:54 ssl_manager.cpp
-rw-r--r--   1 chasinglogic  staff  10059 Jan 17 07:54 ssl_manager.h
-rw-r--r--   1 chasinglogic  staff  61593 Jan 17 07:54 ssl_manager_apple.cpp
-rw-r--r--   1 chasinglogic  staff   1835 Jan 18 12:45 ssl_manager_none.cpp
-rw-r--r--   1 chasinglogic  staff  69043 Jan 17 07:54 ssl_manager_openssl.cpp
-rw-r--r--   1 chasinglogic  staff  17245 Jan 17 07:54 ssl_manager_test.cpp
-rw-r--r--   1 chasinglogic  staff  67519 Jan 17 07:54 ssl_manager_windows.cpp
(.venv) @homebase ➜  mongo git:(ssl-off-warning) SCONSFLAGS=""; python ./buildscripts/scons.py --ssl=off --enable-http-client=off --enable-free-mon=off -Q
scons version: 2.5.0
python version: 2 7 15 'final' 0
 
scons: warning: Two different environments were specified for target ssl_manager_none.o,
	but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $PROGCXXFLAGS $CCFLAGS $PROGCCFLAGS $_CCCOMCOM $SOURCES

Comment by Mathew Robinson (Inactive) [ 18/Jan/19 ]

Renaming the file to not have none in the name seems to remove this warning...

diff --git a/src/mongo/util/net/SConscript b/src/mongo/util/net/SConscript
index 86c7f01297..56056a3768 100644
--- a/src/mongo/util/net/SConscript
+++ b/src/mongo/util/net/SConscript
@@ -135,16 +135,16 @@ env.Library(
     ],
 )
 
-# env.Library(
-#     target='ssl_manager_none',
-#     source=[
-#         "ssl_manager_none.cpp",
-#     ],
-#     LIBDEPS=[
-#         '$BUILD_DIR/mongo/base',
-#         'ssl_options',
-#     ],
-# )
+env.Library(
+    target='ssl_manager_some',
+    source=[
+        "ssl_manager_some.cpp",
+    ],
+    LIBDEPS=[
+        '$BUILD_DIR/mongo/base',
+        'ssl_options',
+    ],
+)
 
 
 env.Library(
@@ -153,7 +153,7 @@ env.Library(
         "ssl_dummy.cpp",
     ],
     LIBDEPS=[
-        'ssl_manager_impl' if get_option('ssl') == 'on' else 'ssl_manager_none',
+        'ssl_manager_impl' if get_option('ssl') == 'on' else 'ssl_manager_some',
     ],
 )

(.venv) @homebase ➜  mongo git:(ssl-off-warning) ✗ ls -l src/mongo/util/net | grep ssl_manager
-rw-r--r--   1 chasinglogic  staff  39536 Jan 17 07:54 ssl_manager.cpp
-rw-r--r--   1 chasinglogic  staff  10059 Jan 17 07:54 ssl_manager.h
-rw-r--r--   1 chasinglogic  staff  61593 Jan 17 07:54 ssl_manager_apple.cpp
-rw-r--r--   1 chasinglogic  staff  69043 Jan 17 07:54 ssl_manager_openssl.cpp
-rw-r--r--   1 chasinglogic  staff   1835 Jan 17 07:54 ssl_manager_some.cpp
-rw-r--r--   1 chasinglogic  staff  17245 Jan 17 07:54 ssl_manager_test.cpp
-rw-r--r--   1 chasinglogic  staff  67519 Jan 17 07:54 ssl_manager_windows.cpp
(.venv) @homebase ➜  mongo git:(ssl-off-warning) ✗

Comment by Mathew Robinson (Inactive) [ 18/Jan/19 ]

I have confirmed this still occurs on Scons 3.0.3:

@homebase ➜  mongo git:(ssl-off-warning) ✗ SCONSFLAGS=""; scons --ssl=off --enable-http-client=off --enable-free-mon=off -Q --debug=findlibs
scons version: 3.0.3
python version: 2 7 15 'final' 0
 
scons: warning: Two different environments were specified for target ssl_manager_none.o,
	but they appear to have the same action: $CXX -o $TARGET -c $CXXFLAGS $PROGCXXFLAGS $CCFLAGS $PROGCCFLAGS $_CCCOMCOM $SOURCES

Using PDB I can see that the File node has an explicit builder set:

(Pdb) tlist[0].is_explicit
1
(Pdb)

Comment by Andrew Morrow (Inactive) [ 15/Jan/19 ]

mathew.robinson - Handing this off to you, CC bdbaddog.

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