Skip to content

Disable CompatibilitySpans outside of stdlib build #80282

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

Steelskin
Copy link
Contributor

@Steelskin Steelskin commented Mar 25, 2025

In some cases, like when building the Swift toolchain build tools, SWIFT_STDLIB_LIBRARY_BUILD_TYPES is not defined. This causes a configuration failure when the CompatibilitySpan library is being added.

This commit disables the CompatibilitySpan target when SWIFT_STDLIB_LIBRARY_BUILD_TYPES is not set.

@Steelskin Steelskin requested a review from a team as a code owner March 25, 2025 18:51
@Steelskin
Copy link
Contributor Author

@slavapestov PTAL, I believe #79703 introduced the problem. We hit this issue when building early build tools.

In some cases, like when building the Swift toolchain build tools,
`SWIFT_STDLIB_LIBRARY_BUILD_TYPES` is not defined. This causes a
configuration failure when the `CompatibilitySpan` library is being
added.

This commit sets a default value of `STATIC` to work around this
problem.
@Steelskin Steelskin force-pushed the fabrice/define-swift-stdlib-build-types-missing branch from 0c93ff1 to 9505d55 Compare March 25, 2025 19:06
@slavapestov
Copy link
Contributor

You can change it to not build the library at all in this case. It’s only needed for dynamic linking on Apple platforms.

@Steelskin Steelskin changed the title Build CompatibilitySpan as STATIC for build tools Disable CompatibilitySpans outside of stdlib build Mar 25, 2025
@Steelskin
Copy link
Contributor Author

You can change it to not build the library at all in this case. It’s only needed for dynamic linking on Apple platforms.

Thank you. Is this what you had in mind?

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test

@slavapestov slavapestov enabled auto-merge March 25, 2025 23:02
@Steelskin
Copy link
Contributor Author

Could you re-run it please? It looks like the build hit a compiler crash.

@slavapestov
Copy link
Contributor

@swift-ci Please smoke test macOS

@slavapestov slavapestov merged commit 51face1 into swiftlang:main Mar 27, 2025
3 checks passed
@Steelskin Steelskin deleted the fabrice/define-swift-stdlib-build-types-missing branch May 29, 2025 01:09
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.

2 participants