Skip to content

SwiftDriver: always pass -sysroot flag if specified#2120

Merged
compnerd merged 1 commit into
swiftlang:mainfrom
compnerd:sysroot
May 1, 2026
Merged

SwiftDriver: always pass -sysroot flag if specified#2120
compnerd merged 1 commit into
swiftlang:mainfrom
compnerd:sysroot

Conversation

@compnerd

Copy link
Copy Markdown
Member

This allows passing the flag on all targets. This is primarily to ensure that the flag is properly handled on foreign targets (i.e. Windows) when cross-compiling.

  • Explanation: Process -sysroot on non-Unix toolchain drivers
  • Scope: This allows the Windows toolchain to forward -sysroot flags as well
  • Issues:
  • Original PRs:
  • Risk: Low risk, the flag handling is just being hoisted to the common shared path
  • Testing: Built the WASI SDK on Windows
  • Reviewers: @artemcm

@compnerd
compnerd requested a review from a team as a code owner April 14, 2026 20:13
@compnerd
compnerd requested a review from artemcm April 14, 2026 20:13

@artemcm artemcm left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Would be nice to have a small test for forwarding this flag to a swift-frontend invocation. I don't see any at all in our test suite.

This allows passing the flag on all targets. This is primarily to ensure
that the flag is properly handled on foreign targets (i.e. Windows) when
cross-compiling.
@compnerd

Copy link
Copy Markdown
Member Author

Would be nice to have a small test for forwarding this flag to a swift-frontend invocation. I don't see any at all in our test suite.

Seems reasonable, added.

@compnerd

Copy link
Copy Markdown
Member Author

@swift-ci please test

@compnerd

Copy link
Copy Markdown
Member Author

@swift-ci please test Windows platform

@compnerd
compnerd requested a review from artemcm April 17, 2026 17:20
@compnerd
compnerd enabled auto-merge (rebase) April 27, 2026 15:39
@compnerd
compnerd merged commit 302fc81 into swiftlang:main May 1, 2026
25 checks passed
@compnerd
compnerd deleted the sysroot branch May 2, 2026 21:16
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