Skip to content

Wasm/WASI: propagate PATH to UserToolchain to fix sysroot search #2936

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 4 commits into from
Sep 28, 2020

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Sep 18, 2020

Currently, when building for WASI, our users need to provide a destination.json file that contains a WASI sysroot path. It would be great if the sysroot path could be inferred automatically from PATH, when the appropriate WASI triple is requested as the destination platform. With this PR it's enough to pass --triple wasm32-unknown-wasi to swift build to build for WASI.

Unused private processEnvironment property of UserToolchain is removed.

(cc @kateinoigakukun)

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov MaxDesiatov marked this pull request as ready for review September 18, 2020 22:39
@@ -264,23 +270,22 @@ public final class UserToolchain: Toolchain {
+ destination.extraSwiftCFlags
}

public init(destination: Destination, environment: [String: String] = ProcessEnv.vars) throws {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should retain the possibility to pass in a custom environment here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing it out, I've reverted that part of the change.

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov

This comment has been minimized.

@MaxDesiatov MaxDesiatov changed the base branch from master to main September 23, 2020 18:27
@MaxDesiatov
Copy link
Contributor Author

@swift-ci please smoke test

@MaxDesiatov MaxDesiatov merged commit b736a28 into swiftlang:main Sep 28, 2020
@MaxDesiatov MaxDesiatov deleted the wasi-toolchain-path branch September 28, 2020 15:51
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants