Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-54262

Cannot use --build-tools=next with scons 4.1

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
      None
    • ALL
    • Dev Platform 2021-02-22, Dev Platform 2021-03-08

      I wanted to do an experiment with SCons 4, and discovered that it doesn't work with --build-tools=next on master.

      $VIRTUAL_ENV/bin/scons --variables-files=etc/scons/xcode_macosx.vars configure
      

      Works on my macOS machine, but

      $VIRTUAL_ENV/bin/scons --variables-files=etc/scons/xcode_macosx.vars configure --build-tools=next
      

      does not. It fails during the configure checks:

      scons: Reading SConscript files ...
      scons: running with args /Users/acm/.virtualenvs/mongo/bin/python3 /Users/acm/.virtualenvs/mongo/bin/scons --variables-files=etc/scons/xcode_macosx.vars configure --build-tools=next
      Using variable customization file /Users/acm/.scons/site_scons/mongo_custom_variables.py
      Using variable customization file etc/scons/xcode_macosx.vars
      Mkdir("build/scons")
      scons version: 4.1.0.post1
      python version: 3 9 1 'final' 0
      CC is /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
      CXX is /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++
      /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ resolves to /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
      Checking if C++ compiler "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" is GCC... no
      Checking if C++ compiler "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++" is clang... yes
      Checking if C compiler "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" is clang... yes
      Detected a x86_64 processor
      Checking if target OS macOS is supported by the toolchain... yes
      Checking if C compiler is clang 7.0 (or Apple XCode 10.2) or newer...yes
      Checking if C++ compiler is clang 7.0 (or Apple XCode 10.2) or newer...yes
      Checking for sufficient macOS target version minimum... yes
      Checking if linker supports -fuse-ld=lld... no
      Checking if linker supports -fuse-ld=gold... no
      Checking whether the C compiler works... yes
      Checking whether the C++ compiler works... yes
      Checking that the C++ compiler can link a C++ program... no
      C++ compiler /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ can't link C++ programs
      

      Looking in config.log shows that SCons has failed to substitute something, expanding it to a python stringification rather than having called the function:

      Compiling build/scons/opt/sconf_temp/conftest_737c003a897167642b70f8cdde8a0eaf_1_a86c4b69e2021206a6777b5b8a971ae1.o
      scons: Configure: yes
      
      scons: Configure: Checking that the C++ compiler can link a C++ program...
      build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.cpp <-
        |
        |#include <iostream>
        |#include <cstdlib>
        |
        |int main() {
        |    std::cout << "Hello, World" << std::endl;
        |    return EXIT_SUCCESS;
        |}
        |
      Compiling build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.o
      Linking build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0_2e6d0cf7ce9340931b3db66029152374
      sh: -c: line 0: syntax error near unexpected token `('
      sh: -c: line 0: `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -o "build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0_2e6d0cf7ce9340931b3db66029152374" -Wl,-syslibroot,/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -target darwin17.0.0 -arch x86_64 -Wl,-bind_at_load -Wl,-fatal_warnings "build/scons/opt/sconf_temp/conftest_ac30bfea77045c1c67c4f51773b51414_0.o" functools.partial(<function get_syslibdeps at 0x1058eda60>, debug=None, shared=False) -lresolv'
      scons: Configure: no
      

      Note the functools.partial(<function get_syslibdeps at 0x1058eda60>, in there.

            Assignee:
            ryan.egesdahl@mongodb.com Ryan Egesdahl (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: