Skip to content

Set a reasonable default for SWIFT_INSTALL_COMPONENTS #21886

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

Conversation

benlangmuir
Copy link
Contributor

@benlangmuir benlangmuir commented Jan 15, 2019

Previously, build-script-impl would set this to "" by default, resulting
in nothing being installed with --install-swift unless you explicitly
set --swift-install-components as well. Now we defer to cmake by
default.

On the cmake side, change the default value to exclude

  • dev - uses a lot of disk space and usually not something you want to
    install into a toolchain
  • clang-resource-dir-symlink & clang-builtin-headers-in-clang-resource-dir -
    these are mutually exclusive with clang-builtin-headers
  • sourcekit inproc/xpc - these are currently mutually exclusive, so pick
    the best one for the current platform.

@benlangmuir
Copy link
Contributor Author

CC @gottesmm

@benlangmuir
Copy link
Contributor Author

@swift-ci please smoke test

@benlangmuir
Copy link
Contributor Author

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - 921ffdb5ff0f778641f53ca7b90f9be4696516f8

Install command
tar zxf swift-PR-21886-128-ubuntu16.04.tar.gz
More info

@swift-ci
Copy link
Contributor

macOS Toolchain
Download Toolchain
Git Sha - 921ffdb5ff0f778641f53ca7b90f9be4696516f8

Install command
tar -zxf swift-PR-21886-167-osx.tar.gz --directory ~/

Copy link
Contributor

@gottesmm gottesmm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with small style nit.

@@ -2361,6 +2360,13 @@ for host in "${ALL_HOSTS[@]}"; do
)
fi

if [ "${SWIFT_INSTALL_COMPONENTS}" ] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think generally we have been using [[ and -n. Can you change to use that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree w.r.t. [[, but we aren't really using -n. I did a quick and dirty search of build-script-impl and I see:

  • [[ $x ]] x 66
  • [[ -n $x ]] x 4
  • [[ $x != ""] x 4

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to if [[ "${SWIFT_INSTALL_COMPONENTS}" ]] ; then.

@benlangmuir benlangmuir force-pushed the install-components-default branch from 921ffdb to e9c05a3 Compare January 16, 2019 17:45
@benlangmuir
Copy link
Contributor Author

@swift-ci please smoke test

@@ -2361,6 +2360,13 @@ for host in "${ALL_HOSTS[@]}"; do
)
fi

if [[ "${SWIFT_INSTALL_COMPONENTS}" ]] ; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. I am fine with this. I prefer the -z -n slightly since it makes things more explicit. But if this works... +1!

Everything else looks fine to me!

Previously, build-script-impl would set this to "" by default, resulting
in nothing being installed with --install-swift unless you explicitly
set --swift-install-components as well.  Now we defer to cmake by
default.

On the cmake side, change the default value to exclude
* dev - uses a lot of disk space and usually not something you want to
  install into a toolchain
* clang-resource-dir-symlink & clang-builtin-headers-in-clang-resource-dir -
  these are mutually exclusive with clang-builtin-headers
* sourcekit inproc/xpc - these are currently mutually exclusive, so pick
  the best one for the current platform.
@benlangmuir benlangmuir force-pushed the install-components-default branch from e9c05a3 to aac6046 Compare January 16, 2019 22:49
@benlangmuir
Copy link
Contributor Author

benlangmuir commented Jan 16, 2019

The test failures were because we didn't build the sourcekit XPC service correctly. It turns out installing the xpc and in-process variants is mutually exclusive. That's probably not what we want, but untangling that mess is not in scope for this PR, so just choose the best one for the current platform.

Edit: filed https://bugs.swift.org/browse/SR-9680 to figure out what to do with the tangled libraries.

@benlangmuir
Copy link
Contributor Author

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 921ffdb5ff0f778641f53ca7b90f9be4696516f8

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 921ffdb5ff0f778641f53ca7b90f9be4696516f8

@benlangmuir benlangmuir merged commit d685728 into swiftlang:master Jan 17, 2019
@benlangmuir benlangmuir deleted the install-components-default branch January 17, 2019 18:12
@gottesmm
Copy link
Contributor

@benlangmuir good job!

@jrose-apple
Copy link
Contributor

Something about this change broke CMake 3.12.2.1—

Assertion failed: (this->NamelinkMode == NamelinkModeNone), function GenerateScriptForConfig, file /[REDACTED]/Sources/CMake/CMake-3.12.2.1/Source/cmInstallTargetGenerator.cxx, line 214.

—so I'm afraid I'm going to revert this for now.

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.

4 participants