Skip to content
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

Use the correct version of swiftc for BwB SwiftUI Previews #519

Conversation

brentleyjones
Copy link
Contributor

@brentleyjones brentleyjones commented Jun 8, 2022

This is the same logic that we use in the ld stub, for the same reason: the PATH and DEVELOPER_DIR isn't set correctly for us, so we have to infer what DEVELOPER_DIR is. We also force the use of the default toolchain, which means this currently doesn't work correctly with custom toolchains.

This is the same logic that we use in the ld stub, for the same reason: the `PATH` and `DEVELOPER_DIR` isn't set correctly for us, so we have to infer what `DEVELOPER_DIR` is. We also force the use of the default toolchain, which means this currently doesn't work correctly with custom toolchains.
@brentleyjones brentleyjones enabled auto-merge (squash) June 8, 2022 22:12
Copy link
Contributor

@BalestraPatrick BalestraPatrick left a comment

Choose a reason for hiding this comment

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

@brentleyjones What's exactly the reason why it's not set correctly in this mode?

@brentleyjones brentleyjones merged commit 1a07886 into main Jun 8, 2022
@brentleyjones brentleyjones deleted the bj/use-the-correct-version-of-swiftc-for-bwb-swiftui-previews branch June 8, 2022 22:17
@brentleyjones
Copy link
Contributor Author

brentleyjones commented Jun 8, 2022

When we don't set the stub, Xcode uses the absolute path to swiftc and ld. It doesn't use PATH to lookup the binary. The env for these tools is really constrained, having basically nothing. So when we call swiftc unqualified in our stub, we get the system level swiftc, which will be based on what xcode-select is set to. That won't be correct when you are in a different Xcode version, like Xcode 14.

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