Skip to content

Restore the bootstrap script changes to install the SwiftPM-built PackageDescription and PackagePlugin libraries #3545

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

Conversation

abertelrud
Copy link
Contributor

@abertelrud abertelrud commented Jun 11, 2021

Restores the bootstrap script changes that were partially reverted in #3540, and updates the bootstrap script to filter out the .swiftmodule files on Darwin, leaving just .swiftinterface.

Motivation:

In order to build universal toolchains, the bootstrap script was changed to install the PackageDescription and PackagePlugin libraries built by SwiftPM rather than those built by CMake. When building for more than one architecture, SwiftPM uses XCBuild, but apparently only Xcode versions such as those used on the bot don't properly support the build setting to emit Swift module interface files.

Modifications:

Revert the changes to copy the installed PackageDescription and PackagePlugin from the CMake-built ones, so that they again come from the SwiftPM-built ones. Add filtering-out of .swiftmodule files on Darwin, leaving just .swiftinterface.

Result:

PackageDescription and PackagePlugin will be built universal and will work on Apple Silicon.

@abertelrud abertelrud self-assigned this Jun 11, 2021
@abertelrud
Copy link
Contributor Author

This needs to wait until @shahmishal gives the go-ahead that the macOS CI bots have been upgraded to something newer than Xcode 12.4.

@abertelrud
Copy link
Contributor Author

@shahmishal Has this update been completed, e.g. do the builders have Xcode 12.5 or later?

@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud
Copy link
Contributor Author

@shahmishal Has this update been completed, e.g. do the builders have Xcode 12.5 or later?

Actually, I think I got this wrong: they just need 12.4 or later. Previously they had 12.3, which seems to be lacking a necessary bugfix in 12.4. From the logs (based on version numbers of the compiler) it appears that they are using 12.4 now even though ci.swift.org says 12.3. @shahmishal is that correct?

@abertelrud
Copy link
Contributor Author

I've done some more testing with Xcode 12.3 as well as Xcode 12.4, and I cannot reproduce the original issue of not producing .swiftinterface files with either version. I think one thing that might have contributed to the original confusion is a difference between single-architecture and multi-architecture Swift modules:

  • single-architecture Swift modules are built as flat .swiftinterface files
  • multi-architecture Swift modules are built as .swiftmodule directories containing .swiftinterface files (along with .swiftmodule and other files

We need to get this merged in order to have universal SwiftPM dylibs in the toolchain. Last time I tried a cross-repository test toolchain build it failed for what seemed to be completely unrelated reasons, but I'll give that another try.

…kageDescription and PackagePlugin libraries"

This reverts commit 9a52971.
…ries, since these should not be part of the installed toolchain.
@abertelrud abertelrud force-pushed the eng/restore-bootstrap-change-to-install-universal-packagedescription-and-packageplugin branch from 3de0d18 to 3741792 Compare June 30, 2021 01:47
@abertelrud
Copy link
Contributor Author

The last remaining difference was that the new code to install the library and module didn't filter out the .swiftmodule that was alongside the .swiftinterface. I have updated the PR to do that, so that we are back to exactly what the installed Swift modules from CMake produced. With that, we should be independent of the Xcode version involved, and this can be merged at any time.

@abertelrud
Copy link
Contributor Author

@swift-ci please smoke test

@abertelrud
Copy link
Contributor Author

The toolchain test seems to have successfully built SwiftPM, though it failed at a later stage for unrelated reasons. I think this is ready to merge but have also pinged @shahmishal to see whether any other testing is needed. To me this is ready to merge.

@abertelrud abertelrud merged commit 426e296 into swiftlang:main Jul 1, 2021
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