Skip to content

[CMake] Begin moving Standard Library options in a separate file #40610

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
Dec 20, 2021

Conversation

edymtt
Copy link
Contributor

@edymtt edymtt commented Dec 17, 2021

This allows the file to be easily included where needed (e.g.
StandaloneOverlay.cmake) and reduce the likelihood of miscompilation
due to missing sensible defaults.

As a start, focus on a handful of parameters that got added/modified in
recent PRs.

Addresses rdar://85978195

This allows the file to be easily included where needed (e.g.
`StandaloneOverlay.cmake`) and reduce the likelihood of miscompilation
due to missing sensible defaults.

As a start, focus on a handful of parameters that got added/modified in
recent PRs.

Addresses rdar://85978195
@edymtt
Copy link
Contributor Author

edymtt commented Dec 17, 2021

@swift-ci please smoke test

@edymtt
Copy link
Contributor Author

edymtt commented Dec 17, 2021

preset=stdlib_S_standalone_minimal_macho_x86_64,build,test
@swift-ci please test with toolchain and preset

@edymtt
Copy link
Contributor Author

edymtt commented Dec 17, 2021

@swift-ci please build toolchain

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - aa32198

@kubamracek
Copy link
Contributor

Very cool! Why not move all the options from stdlib/CMakeLists.txt, though?

@swift-ci
Copy link
Contributor

Linux Toolchain (Ubuntu 16.04)
Download Toolchain
Git Sha - aa32198

Install command
tar zxf swift-PR-40610-756-ubuntu16.04.tar.gz
More info

@edymtt
Copy link
Contributor Author

edymtt commented Dec 17, 2021

I wanted to start small to reduce the likelihood of unanticipated fallout when validating this approach (especially for the options that are in both stdlib/CMakeLists.txt and StandaloneOverlay.cmake) and to land this affordance early so that new options are added to the new file while I work toward migrating all of them.

@edymtt
Copy link
Contributor Author

edymtt commented Dec 17, 2021

The failure for stdlib_S_standalone_minimal_macho_x86_64,build,test is expected

https://ci.swift.org/job/swift-PR-stdlib-with-toolchain-osx-preset/89/

@edymtt
Copy link
Contributor Author

edymtt commented Dec 17, 2021

preset=stdlib_S_standalone_darwin_x86_64,build
@swift-ci please test with toolchain and preset

Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

I think that this is fine for now. I think that longer term, it would be more interesting to bring the standalone overlay builds as a normal build of just the standard library portions of the tree.

@swift-ci
Copy link
Contributor

macOS Toolchain
Download Toolchain
Git Sha - aa32198

Install command
tar -zxf swift-PR-40610-1251-osx.tar.gz --directory ~/

@edymtt
Copy link
Contributor Author

edymtt commented Dec 20, 2021

@compnerd agreed -- the intention is for this to be a short/medium term solution while we work on migrating some internal configurations that still rely on StandaloneOverlay.cmake.

@edymtt
Copy link
Contributor Author

edymtt commented Dec 20, 2021

Verified that

@edymtt edymtt merged commit 871c6b9 into swiftlang:main Dec 20, 2021
@compnerd
Copy link
Member

@compnerd agreed -- the intention is for this to be a short/medium term solution while we work on migrating some internal configurations that still rely on StandaloneOverlay.cmake.

That sounds amazing! Sorry, I didn't have that context.

edymtt added a commit that referenced this pull request Dec 20, 2021
edymtt added a commit to edymtt/swift that referenced this pull request Dec 21, 2021
This allows the file to be easily included where needed (e.g.
`StandaloneOverlay.cmake`) and reduce the likelihood of miscompilation
due to missing sensible defaults.

Focus on parameters only in stdlib/CMakeLists.txt whose defaults are not
computed.

This matches swiftlang#40610 + swiftlang#40640

Addresses rdar://86740965
edymtt added a commit that referenced this pull request Jan 4, 2022
…0669)

This allows the file to be easily included where needed (e.g.
`StandaloneOverlay.cmake`) and reduce the likelihood of miscompilation
due to missing sensible defaults.

Focus on parameters only in stdlib/CMakeLists.txt whose defaults are not
computed.

This matches #40610 + #40640

Addresses rdar://86740965
drodriguez added a commit that referenced this pull request Mar 23, 2022
…41942)

In #40610 some options were moved into `StdlibOptions.cmake`, but that
file is only included from `stdlib/CMakeLists.txt` and
`cmake/modules/StandaloneOverlay.cmake`. However, if one does not build
neither the dynamic nor the static standard library, but enables
building the "toolchain extras" with
`SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT` `stdlib/CMakeLists.txt`
will not be included, but `stdlib/toolchain/CMakeLists.txt` will, which
uses a value from `StandardOverlay.cmake` that will not be provided the
correct default value and will skip building most of what
`SWIFT_BUILD_STDLIB_EXTRA_TOOLCHAIN_CONTENT` used to do.
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