Skip to content

test: enable WebAssembly/WASI in lit.cfg #31695

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
May 21, 2020

Conversation

MaxDesiatov
Copy link
Contributor

Enable WASI environment and wasm32 architecture in lit.cfg. It uses wasmer as the test runner, which can be easily installed on macOS with brew install wasmer. After a quick comparison, wasmer is the fastest one, we previously tried wasmtime before replacing it with wasmer in swiftwasm#451, which made CI run faster in our fork PRs.

As there's no official support for the WebAssembly target and no Jenkins nodes set up, this will serve for local testing, but I would hope that we could have a Jenkins node set up at some point.

Related to SR-9307.

(cc @DougGregor @compnerd @kateinoigakukun)

@MaxDesiatov MaxDesiatov force-pushed the maxd/lit-wasi branch 2 times, most recently from cb75976 to 1c7e107 Compare May 11, 2020 11:01
@MaxDesiatov MaxDesiatov requested a review from compnerd May 11, 2020 11:04
Copy link
Member

@compnerd compnerd left a comment

Choose a reason for hiding this comment

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

This seems pretty fragile currently, and definitely will break on some hosts.

test/lit.cfg Outdated
(config.swiftc, config.variant_triple))
config.target_clang = (
"%s -target %s %s -fobjc-runtime=ios-5.0" %
(config.clangxx, config.variant_triple, clang_mcp_opt))
Copy link
Member

Choose a reason for hiding this comment

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

Why clang++ here rather than clang?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was copied from the Android code above, where they use clang++. Would you like me to clean that up?

Copy link
Member

Choose a reason for hiding this comment

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

Yes please; this would force linking against a C++ runtime, which can go wrong if not done with care, especially with ongoing work to support C++ interop.

Copy link
Contributor Author

@MaxDesiatov MaxDesiatov May 20, 2020

Choose a reason for hiding this comment

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

Thanks for pointing that out, I've updated the PR to use clang instead of clang++. Would you mind triggering another CI run?

@compnerd
Copy link
Member

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4ecd01b4d10d6cfe9726cf9664d4ef5e09206921

@MaxDesiatov
Copy link
Contributor Author

I don't think that the macOS failure is related to this PR in any way:

02:14:17 In file included from /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/swift/stdlib/toolchain/Compatibility50/ProtocolConformance.cpp:20:
02:14:17 In file included from /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/swift/stdlib/toolchain/Compatibility50/Overrides.h:17:
02:14:17 In file included from /Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/swift/include/swift/Runtime/Metadata.h:20:
02:14:17 
/Users/buildnode/jenkins/workspace/swift-PR-osx/branch-master/swift/include/swift/ABI/Metadata.h:44:10: fatal error: cannot open file '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/include/objc/runtime.h': Operation not permitted
02:14:17 #include <objc/runtime.h>
02:14:17          ^
02:14:17 1 error generated.

@MaxDesiatov
Copy link
Contributor Author

I've removed the now-unused change in lit.site.cfg.in from the PR.

@ddunbar
Copy link
Contributor

ddunbar commented May 21, 2020

@swift-ci please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4ecd01b4d10d6cfe9726cf9664d4ef5e09206921

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4ecd01b4d10d6cfe9726cf9664d4ef5e09206921

@compnerd
Copy link
Member

@swift-ci please test Windows platform

@compnerd compnerd merged commit 245bcc4 into swiftlang:master May 21, 2020
@MaxDesiatov MaxDesiatov deleted the maxd/lit-wasi branch May 21, 2020 17: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.

4 participants