Skip to content

Conversation

DougGregor
Copy link
Member

@DougGregor DougGregor commented Nov 30, 2022

Rework the build and installation of all swift-syntax modules in a few ways:

  • Unify the build of all of the libraries via add_swift_host_library to eliminate a lot of copy-and-paste.
  • Respect BUILD_SHARED_LIBS rather than forcing static builds; the compiler will start building these as dynamic libraries
  • Trick CMake into building proper .swiftmodule directories
  • Build and install the modules into lib/swift/host in the toolchain, so other clients can use them

There was a lot of CMake code repeated across the various libraries.
Consolidate that into a new `add_swift_host_library` and use it
throughout.
Host content for Swift will go into this directory, to be installed later.
@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test

@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test

1 similar comment
@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test

@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test Linux

@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please clean test macOS

@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test

@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test

@DougGregor
Copy link
Member Author

I'm turning off building with library evolution for the moment, because it's triggering some surprising failures in parsing

@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test

set(module_dir ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
set(module_base "${module_dir}/${name}.swiftmodule")
set(module_file "${module_base}/${SWIFT_MODULE_TRIPLE}.swiftmodule")
set(module_interface_file "${module_base}/${SWIFT_MODULE_TRIPLE}.swiftinterface")
Copy link
Member

Choose a reason for hiding this comment

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

I think we don’t use module_interface_file anywhere. Is that intentional?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's a vestige of the failed attempt to enable library evolution. There's a potential miscompile in the very old Swift on CI.

@DougGregor
Copy link
Member Author

swiftlang/swift#62326

@swift-ci please test

@DougGregor DougGregor merged commit 6dabd36 into swiftlang:main Dec 2, 2022
@DougGregor DougGregor deleted the swift-host-libs branch December 2, 2022 03:55
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