Skip to content

swiftenv-script: Fix some issues with swiftenvs. #8268

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

Merged
merged 1 commit into from
Mar 22, 2017

Conversation

erg
Copy link
Contributor

@erg erg commented Mar 22, 2017

clang from build-script to build-script-impl like all the other
commands. Pass more args to LLVM. Fix swiftenv creation.

@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor

I don't think you're supposed to drop flags from build-script; that'd be a breaking change.

(In particular, people need to customize the C++ compiler much more than they need to customize the other tools.)

@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

It still lets you customize the C compiler with --cmake-c-compiler and --cmake-cxx-compiler instead of --host-cc.

@jrose-apple
Copy link
Contributor

I don't understand your comment. You deleted those arguments from build-script.

@slavapestov
Copy link
Contributor

Please use "one line summary\n\ndescription" commit message format.

@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

@swift-ci Please smoke test

@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

@jrose-apple build-script-impl gets all arguments that are not handled by build-script. The cmake-c-compiler flag is handled in build-script-impl so everything works.

@jrose-apple
Copy link
Contributor

That's not true. build-script-impl gets all flags after the -- in the command-line, but I can't just pass arbitrary things to build-script and have them get there.

@jrose-apple
Copy link
Contributor

(Maybe it should. That would make migrating options in either direction much less breaking. But it doesn't today.)

@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

Not arbitrary flags, but flags that build-script-impl handles are ok to pass without mentioning them in build-script.

➜  swift git:(master) ✗ ./utils/build-script -R --lolol
error: unknown setting: lolol
usage: 
  build-script [-h | --help] [OPTION ...]
  build-script --preset=NAME [SUBSTITUTION ...]
diff --git a/utils/build-script-impl b/utils/build-script-impl
index dbba611765..4cc8b1b2b0 100755
--- a/utils/build-script-impl
+++ b/utils/build-script-impl
@@ -45,6 +45,7 @@ KNOWN_SETTINGS=(
     dry-run                     ""               "print the commands that would be executed, but do not execute them"
     build-args                  ""               "arguments to the build tool; defaults to -j8 when CMake generator is \"Unix Makefiles\""
     build-dir                   ""               "out-of-tree build directory; default is in-tree. **This argument is required**"
+    lol "" ""
     cmake-c-compiler            ""               "the path to CC, the 'clang' compiler for the host platform. **This argument is required**"
     cmake-cxx-compiler          ""               "the path to CXX, the 'clang++' compiler for the host platform. **This argument is required**"
     cmake-lipo                  ""               "the path to lipo for creating universal binaries on Darwin"

Note the --lol at the end of this command line.

➜  swift git:(master) ✗ ./utils/build-script -R --lol                     
+ mkdir -p /Users/erg/src/build/Ninja-ReleaseAssert
+ env HOST_VARIABLE_macosx_x86_64__SWIFT_BENCHMARK_TARGETS=swift-benchmark-macosx-x86_64 HOST_VARIABLE_macosx_x86_64__SWIFT_RUN_BENCHMARK_TARGETS=check-swift-benchmark-macosx-x86_64 'HOST_VARIABLE_macosx_x86_64__SWIFT_SDKS=IOS IOS_SIMULATOR OSX TVOS TVOS_SIMULATOR WATCHOS WATCHOS_SIMULATOR' HOST_VARIABLE_macosx_x86_64__SWIFT_STDLIB_TARGETS=swift-test-stdlib-macosx-x86_64 HOST_VARIABLE_macosx_x86_64__SWIFT_TEST_TARGETS= caffeinate /Users/erg/src/swift/utils/build-script-impl --workspace /Users/erg/src --build-dir /Users/erg/src/build/Ninja-ReleaseAssert --install-prefix /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr --host-target macosx-x86_64 --stdlib-deployment-targets 'macosx-x86_64 iphonesimulator-i386 iphonesimulator-x86_64 appletvsimulator-x86_64 watchsimulator-i386 iphoneos-armv7 iphoneos-armv7s iphoneos-arm64 appletvos-arm64 watchos-armv7k' --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 /Applications/Xcode.app/Contents/Developer/usr/local/bin/cmake --cmark-build-type Release --llvm-build-type Release --swift-build-type Release --swift-stdlib-build-type Release --lldb-build-type Release --foundation-build-type Release --libdispatch-build-type Release --libicu-build-type Release --xctest-build-type Release --swiftpm-build-type Release --swift-enable-assertions true --swift-stdlib-enable-assertions true --swift-analyze-code-coverage false --cmake-generator Ninja --build-jobs 8 '--common-cmake-options=-G Ninja -DCMAKE_MAKE_PROGRAM=/Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja' --build-args=-j8 --cmark-cmake-options= '--llvm-cmake-options=-DLLVM_ENABLE_ASSERTIONS=TRUE -DLLVM_TARGETS_TO_BUILD=X86;ARM;AArch64;PowerPC;SystemZ' '--swift-cmake-options=-DSWIFT_STDLIB_ENABLE_SIL_OWNERSHIP=FALSE -DCMAKE_EXPORT_COMPILE_COMMANDS=TRUE -DSWIFT_FORCE_OPTIMIZED_TYPECHECKER=FALSE' --build-stdlib-deployment-targets all --ninja-bin=/Applications/Xcode.app/Contents/Developer/usr/local/bin/ninja --skip-build-foundation --skip-build-xctest --skip-build-lldb --skip-build-llbuild --skip-build-libdispatch --skip-build-libicu --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-swift --skip-test-cmark --skip-test-lldb --skip-test-llbuild --skip-test-swiftpm --skip-test-xctest --skip-test-foundation --skip-test-libdispatch --skip-test-libicu --skip-test-playgroundlogger --skip-test-playgroundsupport --skip-test-linux --skip-test-freebsd --skip-test-cygwin --skip-test-osx --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 --toolchain-prefix /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain --lol --llvm-lit-args=-sv

@erg erg force-pushed the swiftenv-fixes branch from 34f1dab to f06abb2 Compare March 22, 2017 18:21
@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

@swift-ci Please smoke test

@jrose-apple
Copy link
Contributor

Oh, I didn't realize we did that! Okay, retracted. Sorry for wasting your time!

@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

Np, it's helpful to have reviews, and I had to research a bit to answer your question, so it's worth it.

@erg erg force-pushed the swiftenv-fixes branch from f06abb2 to 1143051 Compare March 22, 2017 18:51
@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

@swift-ci Please smoke test

@erg erg changed the title swiftenv-script: Fix the output files of swiftc. Change the lookup of swiftenv-script: Fix some issues with swiftenvs. Mar 22, 2017
Fix the mocked output files of swiftc. Change the lookup of
clang from build-script to build-script-impl like all the other
commands. Pass more args to LLVM. Fix swiftenv creation. Fix unit tests.

The reason this patch works is that build-script-impl gets
all the arguments that are not handled by build-script.
@erg erg force-pushed the swiftenv-fixes branch from 1143051 to 351a515 Compare March 22, 2017 19:47
@erg
Copy link
Contributor Author

erg commented Mar 22, 2017

@swift-ci Please smoke test

@erg erg merged commit 941a449 into swiftlang:master Mar 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants