Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-14701] CMake complains about unknown arguments when running the build script #57051

Closed
WowbaggersLiquidLunch opened this issue Jun 2, 2021 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@WowbaggersLiquidLunch
Copy link
Collaborator

Previous ID SR-14701
Radar None
Original Reporter @WowbaggersLiquidLunch
Type Bug
Status Resolved
Resolution Done
Environment

macOS 10.15.7 (19H1217)
Xcode 12.4 (12D4e)
CMake 3.20.3

Additional Detail from JIRA
Votes 0
Component/s Project Infrastructure
Labels Bug
Assignee None
Priority Medium

md5: b0fc42b1037795cf03f5cad3572db130

Issue Description:

When running the build script with the recommended flags, CMake complains about "unknown argument RelWithDebInfo". If the build script is run with --debug-swift, then it complains about "unknown argument Debug".

Git hashes:

$ utils/update-checkout --dump-hashes
{
    "https-clone-pattern": "https://github.com/%s.git", 
    "ssh-clone-pattern": "git@github.com:%s.git", 
    "repos": {
        "sourcekit-lsp": {
            "remote": {
                "id": "apple/sourcekit-lsp"
            }
        }, 
        "indexstore-db": {
            "remote": {
                "id": "apple/indexstore-db"
            }
        }, 
        "llbuild": {
            "remote": {
                "id": "apple/swift-llbuild"
            }
        }, 
        "swift-xcode-playground-support": {
            "remote": {
                "id": "apple/swift-xcode-playground-support"
            }
        }, 
        "swift-syntax": {
            "remote": {
                "id": "apple/swift-syntax"
            }
        }, 
        "swift-corelibs-xctest": {
            "remote": {
                "id": "apple/swift-corelibs-xctest"
            }
        }, 
        "swiftpm": {
            "remote": {
                "id": "apple/swift-package-manager"
            }
        }, 
        "swift-tools-support-core": {
            "remote": {
                "id": "apple/swift-tools-support-core"
            }
        }, 
        "cmake": {
            "platforms": [
                "Linux"
            ], 
            "remote": {
                "id": "KitWare/CMake"
            }
        }, 
        "swift-driver": {
            "remote": {
                "id": "apple/swift-driver"
            }
        }, 
        "yams": {
            "remote": {
                "id": "jpsim/Yams"
            }
        }, 
        "icu": {
            "platforms": [
                "Linux"
            ], 
            "remote": {
                "id": "unicode-org/icu"
            }
        }, 
        "swift-corelibs-foundation": {
            "remote": {
                "id": "apple/swift-corelibs-foundation"
            }
        }, 
        "llvm-project": {
            "remote": {
                "id": "apple/llvm-project"
            }
        }, 
        "swift-argument-parser": {
            "remote": {
                "id": "apple/swift-argument-parser"
            }
        }, 
        "ninja": {
            "remote": {
                "id": "ninja-build/ninja"
            }
        }, 
        "swift-integration-tests": {
            "remote": {
                "id": "apple/swift-integration-tests"
            }
        }, 
        "swift": {
            "remote": {
                "id": "apple/swift"
            }
        }, 
        "swift-crypto": {
            "remote": {
                "id": "apple/swift-crypto"
            }
        }, 
        "swift-stress-tester": {
            "remote": {
                "id": "apple/swift-stress-tester"
            }
        }, 
        "cmark": {
            "remote": {
                "id": "apple/swift-cmark"
            }
        }, 
        "swift-format": {
            "remote": {
                "id": "apple/swift-format"
            }
        }, 
        "swift-corelibs-libdispatch": {
            "remote": {
                "id": "apple/swift-corelibs-libdispatch"
            }
        }
    }, 
    "branch-schemes": {
        "repro": {
            "repos": {
                "sourcekit-lsp": "09da6a4f961720b81687567ce8afea633cbd0f44", 
                "swift-syntax": "18880228fa4de8c3368d66ead6f4e0dfd4c7f1f9", 
                "llbuild": "3c99ab56a357a2099bce3fd478a81e77ca81270d", 
                "swift-xcode-playground-support": "dd0d8c8d121d2f20664e4779a3d29482a55908bb", 
                "indexstore-db": "b90fa0bd7b4db02c34ad292813f3ae236e5c8764", 
                "swift-corelibs-xctest": "dd599d04b0d17e5be3de5fd31101e7edda5d2b42", 
                "swiftpm": "b0e0388c4832494fe159d2f10152a8cb677d5d66", 
                "swift-tools-support-core": "fc5b8a59326cb0530572abc5b0de042fdbb4a024", 
                "cmake": "skip", 
                "swift-driver": "d880e2e5755bf1a462dfae2d286a3c254020598b", 
                "yams": "51ef46468fda5a0fa1a201b8843791d0149d3c01", 
                "icu": "skip", 
                "swift-corelibs-foundation": "cc5fc93a9946e82d659f79e1bd991b96eba3fcdf", 
                "llvm-project": "08f96c278ca01fbfc5f48c74b040d8867b7749b8", 
                "swift-argument-parser": "986d191f94cec88f6350056da59c2e59e83d1229", 
                "ninja": "e72d1d581c945c158ed68d9bc48911063022a2c6", 
                "swift-integration-tests": "8220958e758fff87d8dea502f6d7f3c6dde9dab0", 
                "swift": "a8ae9525aa4b2f75ad8b5dc75966ec205cdc355d", 
                "swift-crypto": "0141f53dd525706c803b0c20aa8ad36f9ecd45e5", 
                "swift-stress-tester": "b4abc5a5917334f4960699315f5c34ca138d25f4", 
                "cmark": "9c8096a23f44794bde297452d87c455fc4f76d42", 
                "swift-format": "5a3fe7a30f27d6e60281c89afab08f90a611424a", 
                "swift-corelibs-libdispatch": "34f383d34450d47dd5bdfdf675fcdaa0d0ec8031"
            }, 
            "aliases": [
                "repro"
            ]
        }
    }
}

Output from the build script:

$ utils/build-script --clean --skip-build-benchmarks --skip-ios --skip-watchos --skip-tvos --swift-darwin-supported-archs "$(uname -m)" --sccache --release-debuginfo --swift-disable-dead-stripping --test --skip-test-cmark --xcode
[utils/build-script] NOTE: Using toolchain default
Ensuring the sccache server is running...
+ /usr/local/bin/sccache --show-stats
+ /usr/libexec/PlistBuddy -c 'Print :SupportedTargets:macosx:Archs' /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/SDKSettings.plist
Starting clean build now.
+ rm -rf /Users/jizhuojie/Projects/swift-project/build/Xcode-RelWithDebInfoAssert
+ mkdir -p /Users/jizhuojie/Projects/swift-project/build/Xcode-RelWithDebInfoAssert
--- Building earlyswiftdriver ---
+ /Users/jizhuojie/Projects/swift-project/swift-driver/Utilities/build-script-helper.py build --package-path /Users/jizhuojie/Projects/swift-project/swift-driver --build-path /Users/jizhuojie/Projects/swift-project/build/Xcode-RelWithDebInfoAssert/earlyswiftdriver-macosx-x86_64 --configuration release --toolchain /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --ninja-bin /usr/local/bin/ninja --cmake-bin /usr/local/bin/cmake --local_compiler_build
Building Swift Driver dependency: llbuild
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_C_COMPILER


Building Swift Driver dependency: TSC
Building Swift Driver dependency: Argument Parser
Building Swift Driver dependency: Yams
Building Swift Driver for target: x86_64-apple-macosx10.15
--- Building cmark ---
+ pushd /Users/jizhuojie/Projects/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-x86_64
+ /usr/local/bin/cmake -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo '-DCMAKE_C_FLAGS=-Wno-unknown-warning-option -Werror=unguarded-availability-new -arch x86_64 -target x86_64-apple-macosx10.9 -fno-stack-protector' '-DCMAKE_CXX_FLAGS=-Wno-unknown-warning-option -Werror=unguarded-availability-new -arch x86_64 -target x86_64-apple-macosx10.9 -fno-stack-protector' -DCMAKE_OSX_SYSROOT:PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET=10.9 -DCMAKE_OSX_ARCHITECTURES=x86_64 -G Xcode -DCMAKE_C_COMPILER_LAUNCHER:PATH=/usr/local/bin/sccache -DCMAKE_CXX_COMPILER_LAUNCHER:PATH=/usr/local/bin/sccache -DCMAKE_C_COMPILER_LAUNCHER:PATH=/usr/local/bin/sccache -DCMAKE_CXX_COMPILER_LAUNCHER:PATH=/usr/local/bin/sccache -DCMAKE_C_COMPILER:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -DCMAKE_LIBTOOL:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool -DCMAKE_AR:PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar '-DCMAKE_CONFIGURATION_TYPES=Debug;Release;MinSizeRel;RelWithDebInfo' -DLLVM_VERSION_MAJOR:STRING=10 -DLLVM_VERSION_MINOR:STRING=0 -DLLVM_VERSION_PATCH:STRING=0 -DCLANG_VERSION_MAJOR:STRING=10 -DCLANG_VERSION_MINOR:STRING=0 -DCLANG_VERSION_PATCH:STRING=0 -DSWIFT_DARWIN_SUPPORTED_ARCHS:STRING=x86_64 -DSWIFT_DISABLE_DEAD_STRIPPING:BOOL=TRUE '-DCMAKE_IGNORE_PATH=/usr/lib;/usr/local/lib;/lib' -DPKG_CONFIG_EXECUTABLE=/usr/bin/false /Users/jizhuojie/Projects/swift-project/cmark
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test HAVE_FLAG_ADDRESS_SANITIZER
-- Performing Test HAVE_FLAG_ADDRESS_SANITIZER - Failed
-- Performing Test HAVE_FLAG_SANITIZE_ADDRESS
-- Performing Test HAVE_FLAG_SANITIZE_ADDRESS - Failed
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- Looking for stdbool.h
-- Looking for stdbool.h - found
-- Performing Test HAVE___BUILTIN_EXPECT
-- Performing Test HAVE___BUILTIN_EXPECT - Success
-- Performing Test HAVE___ATTRIBUTE__
-- Performing Test HAVE___ATTRIBUTE__ - Success
-- Found PythonInterp: /usr/local/bin/python3 (found suitable version "3.9.5", minimum required is "3") 
-- Configuring done
-- Generating done
CMake Warning:
  Manually-specified variables were not used by the project:

    CLANG_VERSION_MAJOR
    CLANG_VERSION_MINOR
    CLANG_VERSION_PATCH
    CMAKE_LIBTOOL
    LLVM_VERSION_MAJOR
    LLVM_VERSION_MINOR
    LLVM_VERSION_PATCH
    PKG_CONFIG_EXECUTABLE
    SWIFT_DARWIN_SUPPORTED_ARCHS
    SWIFT_DISABLE_DEAD_STRIPPING


-- Build files have been written to: /Users/jizhuojie/Projects/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-x86_64
+ popd
+ /usr/local/bin/cmake --build /Users/jizhuojie/Projects/swift-project/build/Xcode-RelWithDebInfoAssert/cmark-macosx-x86_64 RelWithDebInfo
Unknown argument RelWithDebInfo
Usage: cmake --build [<dir> | --preset <preset>] [options] [-- [native-options]]
Options:
  <dir>          = Project binary directory to be built.
  --preset <preset>, --preset=<preset>
                 = Specify a build preset.
  --list-presets
                 = List available build presets.
  --parallel [<jobs>], -j [<jobs>]
                 = Build in parallel using the given number of jobs. 
                   If <jobs> is omitted the native build tool's 
                   default number is used.
                   The CMAKE_BUILD_PARALLEL_LEVEL environment variable
                   specifies a default parallel level when this option
                   is not given.
  --target <tgt>..., -t <tgt>... 
                 = Build <tgt> instead of default targets.
  --config <cfg> = For multi-configuration tools, choose <cfg>.
  --clean-first  = Build target 'clean' first, then build.
                   (To clean only, use --target 'clean'.)
  --verbose, -v  = Enable verbose output - if supported - including
                   the build commands to be executed. 
  --             = Pass remaining options to the native tool.
ERROR: command terminated with a non-zero exit status 1, aborting
@typesanitizer
Copy link

Seeing this same issue as well. What's missing is that there needs to be a --config before the RelWithDebInfo. For some reason, that's no longer the case when --xcode is used.

@typesanitizer
Copy link

PR with fix: #37751

@typesanitizer
Copy link

PR merged, onto the next build issue. 🙂

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.
Projects
None yet
Development

No branches or pull requests

2 participants