swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.2k stars 10.32k forks source link

[SR-3042] compile swift error: unknown setting: llvm-enable-assertions #45632

Open swift-ci opened 7 years ago

swift-ci commented 7 years ago
Previous ID SR-3042
Radar None
Original Reporter netroby (JIRA User)
Type Bug
Environment ubuntu 16.10 x64
Additional Detail from JIRA | | | |------------------|-----------------| |Votes | 0 | |Component/s | | |Labels | Bug | |Assignee | netroby (JIRA) | |Priority | Medium | Watchers: @shahmishal md5: dad76c31e519077834ded3afc3c58cd9

Issue Description:

huzhifeng@s ~/software/swift-swift-3.0.1-PREVIEW-3 $ ./utils/build-script -r -t      
+ mkdir -p /home/huzhifeng/software/build/Ninja-RelWithDebInfoAssert
+ env HOST_VARIABLE_linux_x86_64__SWIFT_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_RUN_BENCHMARK_TARGETS= HOST_VARIABLE_linux_x86_64__SWIFT_SDKS=LINUX HOST_VARIABLE_linux_x86_64__SWIFT_STDLIB_TARGETS=swift-test-stdlib-linux-x86_64 HOST_VARIABLE_linux_x86_64__SWIFT_TEST_TARGETS=check-swift-linux-x86_64 /home/huzhifeng/software/swift/utils/build-script-impl --workspace /home/huzhifeng/software --build-dir /home/huzhifeng/software/build/Ninja-RelWithDebInfoAssert --install-prefix /usr --host-target linux-x86_64 --stdlib-deployment-targets linux-x86_64 --host-cc /usr/bin/clang --host-cxx /usr/bin/clang++ --darwin-xcrun-toolchain default --darwin-deployment-version-osx=10.9 --darwin-deployment-version-ios=7.0 --darwin-deployment-version-tvos=9.0 --darwin-deployment-version-watchos=2.0 --cmake /usr/bin/cmake --cmark-build-type RelWithDebInfo --llvm-build-type RelWithDebInfo --swift-build-type RelWithDebInfo --swift-stdlib-build-type RelWithDebInfo --lldb-build-type RelWithDebInfo --foundation-build-type RelWithDebInfo --libdispatch-build-type RelWithDebInfo --xctest-build-type RelWithDebInfo --llvm-enable-assertions true --swift-enable-assertions true --swift-stdlib-enable-assertions true --swift-analyze-code-coverage false --cmake-generator Ninja --build-jobs 4 '--common-cmake-options=-G Ninja -DCMAKE_C_COMPILER:PATH=/usr/bin/clang -DCMAKE_CXX_COMPILER:PATH=/usr/bin/clang++' --build-args=-j4 --build-stdlib-deployment-targets all --ninja-bin=/usr/bin/ninja --skip-build-foundation --skip-build-xctest --skip-build-lldb --skip-build-llbuild --skip-build-libdispatch --skip-build-swiftpm --skip-build-playgroundlogger --skip-build-playgroundsupport --build-swift-dynamic-stdlib --build-swift-dynamic-sdk-overlay --skip-build-ios-device --skip-build-ios-simulator --skip-build-tvos-device --skip-build-tvos-simulator --skip-build-watchos-device --skip-build-watchos-simulator --skip-build-android --skip-test-ios-host --skip-test-ios-simulator --skip-test-tvos-host --skip-test-tvos-simulator --skip-test-watchos-host --skip-test-watchos-simulator --skip-test-android-host --skip-test-benchmarks --skip-test-optimized --android-deploy-device-path /data/local/tmp --llvm-lit-args=-sv
error: unknown setting: llvm-enable-assertions
Usage: build-script-impl [--help|-h] [ --SETTING=VALUE | --SETTING VALUE | --SETTING ]*
belkadan commented 7 years ago

erg (JIRA User), @shahmishal, did anything change in preview 3?

swift-ci commented 7 years ago

Comment by Doug Coleman (JIRA)

Preview 3 has the flag. It got removed in master by 14b2dd52967b6cfb2957ec907fc04ad2b82abf0d.

shahmishal commented 7 years ago

Can you please provide the swift sha you are building from?

Thanks,
Mishal Shah

swift-ci commented 7 years ago

Comment by zhifeng hu (JIRA)

I download the file from https://github.com/apple/swift/archive/swift-3.0.1-PREVIEW-3.zip
And try to build . but i am got failed.

swift-ci commented 7 years ago

Comment by zhifeng hu (JIRA)

Missing build guide for build from download source . like swift-3.0.1-PREVIEW-3

swift-ci commented 7 years ago

Comment by zhifeng hu (JIRA)

I will try to build swift-3.0.1-GM-CANDIDATE.

swift-ci commented 7 years ago

Comment by zhifeng hu (JIRA)

huzhifeng@s ~/software/swift-code/swift-swift-3.0.1-GM-CANDIDATE $ utils/build-script -r -t

Still can not build with 3.0.1 GM

I am working on Ubuntu 16.10 x64

swift-ci commented 7 years ago

Comment by Doug Coleman (JIRA)

Hi Zhifeng,

I would recommend building from github rather than from the .zip, but I just tried it and I'm not getting your error at all.

Here's what worked for me:

bash```
wget https://github.com/apple/swift/archive/swift-3.0.1-PREVIEW-3.zip
unzip swift-3.0.1-PREVIEW-3.zip
mv swift-swift-3.0.1-PREVIEW-3 swift
cd swift
./utils/update-checkout --clone-with-ssh --skip-repository swift
./utils/build-script -r -t
```

To build from github:

bash```
git clone git@github.com:apple/swift.git
cd swift
./utils/update-checkout --clone-with-ssh
./utils/build-script -r -t
```

If you grep for ``llvm-enable-assertions`` you will see that it exists:

```
erg@rad:\~/swift$ grep -r llvm-enable-assertions
utils/build-script: "--llvm-enable-assertions", str(args.llvm_assertions).lower(),
utils/build-script-impl: llvm-enable-assertions "1" "enable assertions in LLVM and Clang"
```

If your ``grep`` does not find that output, something is wrong. Are you sure that there are no other Swift directories that it's trying to build instead of the downloaded version?