Skip to content

Runtimes: add -nostdlibimport to the runtime build #79443

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
Feb 19, 2025

Conversation

compnerd
Copy link
Member

If the compiler being used to build the runtime is from a complete toolchain, we may inadvertently pick up runtime from the previous build rather than the just built Swift Core library. Pass -nostdlibimport to ensure that we do not search the default search paths when building and use the locally built swiftCore.

@compnerd
Copy link
Member Author

@swift-ci please smoke test

Copy link
Member

@etcwilde etcwilde left a comment

Choose a reason for hiding this comment

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

Technically everything under the SwiftCore project should be using the modules from within the package. Would it make sense to just stick this flag in the top-level add_compile_options and be done with it?

@compnerd
Copy link
Member Author

Yeah, that seems reasonable.

If the compiler being used to build the runtime is from a complete
toolchain, we may inadvertently pick up runtime from the previous build
rather than the just built Swift Core library. Pass `-nostdlibimport` to
ensure that we do not search the default search paths when building and
use the locally built swiftCore.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd
Copy link
Member Author

@swift-ci please test Windows platform

@compnerd compnerd merged commit 63b7f05 into swiftlang:main Feb 19, 2025
5 checks passed
@compnerd compnerd deleted the hermermetic branch February 19, 2025 04:12
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