Uploaded image for project: 'Swift'
  1. Swift
  2. SR-12726

Can't build apple/swift `master` on macOS with Command Line Tools installed

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Labels:
      None
    • Environment:

      Catalina 10.15.4 or Mojave 10.14.6, both with Xcode 11.4.1, Command Line Tools version: 11.4.1.0.1.1586360307

      Description

      When building the compiler master branch (this is not reproducible with swift-5.2-branch scheme) on macOS with Command Line Tools installed, swift/lib/Immediate/Immediate.cpp fails to build with these errors:

      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMARK_STATIC_DEFINE -DGTEST_HAS_RTTI=0 -DHAVE_LIBEDIT -DSWIFT_ENABLE_RUNTIME_FUNCTION_COUNTERS -D_DEBUG -D_STDC_CONSTANT_MACROS -DSTDC_FORMAT_MACROS -D_STDC_LIMIT_MACROS -Ilib/Immediate -I/Users/maxd/Documents/swift-source-test/swift/lib/Immediate -Iinclude -I/Users/maxd/Documents/swift-source-test/swift/include -I/Users/maxd/Documents/swift-source-test/llvm-project/llvm/include -I/Users/maxd/Documents/swift-source-test/build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/include -I/Users/maxd/Documents/swift-source-test/llvm-project/clang/include -I/Users/maxd/Documents/swift-source-test/build/Ninja-RelWithDebInfoAssert/llvm-macosx-x86_64/tools/clang/include -I/Users/maxd/Documents/swift-source-test/cmark/src -I/Users/maxd/Documents/swift-source-test/build/Ninja-RelWithDebInfoAssert/cmark-macosx-x86_64/src -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -Wno-unknown-warning-option -Werror=unguarded-availability-new -fno-stack-protector -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-class-memaccess -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -Werror=switch -Wdocumentation -Wimplicit-fallthrough -Wunreachable-code -Woverloaded-virtual -DOBJC_OLD_DISPATCH_PROTOTYPES=0 -O2 -isysroot /Applications/Xcode-11.4.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -UNDEBUG -fno-exceptions -fno-rtti -Werror=gnu -target x86_64-apple-macosx10.9 -isysroot /Applications/Xcode-11.4.1.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -arch x86_64 -F/../../../Developer/Library/Frameworks -mmacosx-version-min=10.9 -O2 -g -UNDEBUG -std=c++14 -MD -MT lib/Immediate/CMakeFiles/swiftImmediate.dir/Immediate.cpp.o -MF lib/Immediate/CMakeFiles/swiftImmediate.dir/Immediate.cpp.o.d -o lib/Immediate/CMakeFiles/swiftImmediate.dir/Immediate.cpp.o -c /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/Immediate.cpp
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/Immediate.cpp:19:
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/ImmediateImpl.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/swift/include/swift/AST/LinkLibrary.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallString.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallVector.h:19:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/MathExtras.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/SwapByteOrder.h:18:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/DataTypes.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm-c/DataTypes.h:28:
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:317:9: error: no member named 'signbit' in the global namespace
      using ::signbit;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:318:9: error: no member named 'fpclassify' in the global namespace
      using ::fpclassify;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:319:9: error: no member named 'isfinite' in the global namespace; did you mean 'finite'?
      using ::isfinite;
      {{ ~~^}}
      /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/math.h:749:12: note: 'finite' declared here
      extern int finite(double)
      {{ ^}}
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/Immediate.cpp:19:
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/ImmediateImpl.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/swift/include/swift/AST/LinkLibrary.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallString.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallVector.h:19:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/MathExtras.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/SwapByteOrder.h:18:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/DataTypes.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm-c/DataTypes.h:28:
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:320:9: error: no member named 'isinf' in the global namespace
      using ::isinf;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:321:9: error: no member named 'isnan' in the global namespace
      using ::isnan;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:322:9: error: no member named 'isnormal' in the global namespace
      using ::isnormal;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:323:7: error: no member named 'isgreater' in the global namespace; did you mean '::std::greater'?
      using ::isgreater;
      {{ ^~}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:731:29: note: '::std::greater' declared here
      struct _LIBCPP_TEMPLATE_VIS greater : binary_function<_Tp, _Tp, bool>
      {{ ^}}
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/Immediate.cpp:19:
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/ImmediateImpl.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/swift/include/swift/AST/LinkLibrary.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallString.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallVector.h:19:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/MathExtras.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/SwapByteOrder.h:18:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/DataTypes.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm-c/DataTypes.h:28:
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:324:7: error: no member named 'isgreaterequal' in the global namespace; did you mean '::std::greater_equal'?
      using ::isgreaterequal;
      {{ ^~}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/functional:760:29: note: '::std::greater_equal' declared here
      struct _LIBCPP_TEMPLATE_VIS greater_equal : binary_function<_Tp, _Tp, bool>
      {{ ^}}
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/Immediate.cpp:19:
      In file included from /Users/maxd/Documents/swift-source-test/swift/lib/Immediate/ImmediateImpl.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/swift/include/swift/AST/LinkLibrary.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallString.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/ADT/SmallVector.h:19:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/MathExtras.h:17:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/SwapByteOrder.h:18:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm/Support/DataTypes.h:16:
      In file included from /Users/maxd/Documents/swift-source-test/llvm-project/llvm/include/llvm-c/DataTypes.h:28:
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:325:9: error: no member named 'isless' in the global namespace
      using ::isless;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:326:9: error: no member named 'islessequal' in the global namespace
      using ::islessequal;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:327:9: error: no member named 'islessgreater' in the global namespace
      using ::islessgreater;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:328:9: error: no member named 'isunordered' in the global namespace
      using ::isunordered;
      {{ ~~^}}
      /Applications/Xcode-11.4.1.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/cmath:329:9: error: no member named 'isunordered' in the global namespace
      using ::isunordered;
      {{ ~~^}}
      13 errors generated.

      The culprit is this flag in build command -isystem /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include

      The flag is only added when CommandLineTools are installed. Removing the flag from the invocation allows the build command to pass, but there's no known way to force the build system to not to add that flag breaking the build, other than deleting the /Library/Developer/CommandLineTools directory.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              max.desiatov Max Desiatov
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: