Skip to content

[Build System: CMake] Install the apinotes in the 'compiler' install component. #24419

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
May 3, 2019

Conversation

Rostepher
Copy link
Contributor

@Rostepher Rostepher commented May 2, 2019

We should always install the remaining apinotes when building and installing the compiler component. That way they'll always end up in the toolchain, even if you aren't building the standard library.

rdar://50390238

@Rostepher
Copy link
Contributor Author

@swift-ci please smoke test


# This is overly conservative, but we have so few API notes files that
# haven't migrated to the Swift repo that it's probably fine in practice.
DEPENDS copy_apinotes)
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 this is still relevant; this is about the build you're in the process of doing rather than the install.

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've updated this to keep the dependency when building the standard library with the compiler, but also allow building standalone without the dependency.

swift_install_in_component(DIRECTORY "${output_dir}"
DESTINATION "lib/swift/"
COMPONENT sdk-overlay
OPTIONAL)
COMPONENT compiler)
Copy link
Contributor

Choose a reason for hiding this comment

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

As long as they don't get installed on Linux…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should only make this target if building for an Apple platform.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's tricky because of cross-compilers, but that might be a case we can afford to ignore for now.

@Rostepher Rostepher force-pushed the toolchain-apinotes branch 2 times, most recently from 759d5c5 to 9666860 Compare May 3, 2019 01:34
@Rostepher Rostepher requested a review from compnerd May 3, 2019 01:34
@Rostepher
Copy link
Contributor Author

@swift-ci please clean test

@swift-ci
Copy link
Contributor

swift-ci commented May 3, 2019

Build failed
Swift Test OS X Platform
Git Sha - 991730e7ba0ebdf7114a2dc7ce296a9a2206d35c

@swift-ci
Copy link
Contributor

swift-ci commented May 3, 2019

Build failed
Swift Test Linux Platform
Git Sha - 991730e7ba0ebdf7114a2dc7ce296a9a2206d35c

CMakeLists.txt Outdated
set(_swift_install_apinotes_default TRUE)
endif()

option(SWIFT_INSTALL_APINOTES
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe this should be called SWIFT_INCLUDE_APINOTES? It would be more in-line with other options like it. This does control if the targets are created, but not if they're actually installed. You still need to be installing the compiler component for them to be actually installed.

…component when compiling for Darwin platforms.

Setting the CMake cache variable SWIFT_INCLUDE_APINOTES to true will override the default behavior and unconditionally create the install targets.
@Rostepher Rostepher force-pushed the toolchain-apinotes branch from 9666860 to c10b815 Compare May 3, 2019 01:43
@Rostepher
Copy link
Contributor Author

@swift-ci please clean test

@swift-ci
Copy link
Contributor

swift-ci commented May 3, 2019

Build failed
Swift Test OS X Platform
Git Sha - 96668605bb72d581b88b776eaadd55d7d1221652

@swift-ci
Copy link
Contributor

swift-ci commented May 3, 2019

Build failed
Swift Test Linux Platform
Git Sha - 96668605bb72d581b88b776eaadd55d7d1221652

@Rostepher
Copy link
Contributor Author

I've updated my PR to now include a new CMake cache option SWIFT_INCLUDE_APINOTES which controls if the install targets are created. This variable will default to TRUE when CMAKE_SYSTEM_NAME is Darwin. Overriding this will always ensure you install the apinotes if you're also installing the compiler itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants