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

Fix test runner build on WASI #7341

Merged
merged 1 commit into from
Feb 16, 2024

Conversation

kateinoigakukun
Copy link
Member

@kateinoigakukun kateinoigakukun commented Feb 14, 2024

Motivation:

The test runner build was failing on WASI after the introduction of the experimental summary output.

Modifications:

This PR fixes several minor issues to pass --build-tests build on WASI:

  • Missing WASILibc import
  • The use of flock which is not available on WASI.
  • Signature incompatibility of XCTMain on WASI.

Result:

swift build --build-tests --triple wasm32-unknown-wasi will pass when compiler supports the target

The test runner build was failing on WASI due to:
* Missing `WASILibc` import
* The use of `flock` and `open` which are not available on WASI.
* Signature incompatibility of `XCTMain` on WASI.
@kateinoigakukun
Copy link
Member Author

@swift-ci Please smoke test

@MaxDesiatov
Copy link
Contributor

MaxDesiatov commented Feb 14, 2024

@bnbarham actually there are more tests here I forgot about, but surfaced in this PR.
@kateinoigakukun are these tests built only on SwiftWasm CI currently?

@kateinoigakukun
Copy link
Member Author

@MaxDesiatov What do you mean "tests" here? The test runner can be built on any developer's machine not limited to our CI

@MaxDesiatov MaxDesiatov added the swift test Changes impacting `swift test` tool label Feb 14, 2024
@MaxDesiatov
Copy link
Contributor

Ah, ok, sorry about the confusion. This is about swift test invocations, right? What do we need to do to make sure this doesn't regress in the future?

@MaxDesiatov MaxDesiatov added bug needs tests This change needs test coverage labels Feb 14, 2024
@kateinoigakukun
Copy link
Member Author

kateinoigakukun commented Feb 14, 2024

Ensuring that the runner can be built for WASI requires actual Swift SDK, so i think we don't have good way to have a regression test in this repository unfortunately 😢 But we can have a validation test on our SwiftWasm build pipeline just in case.

@kateinoigakukun
Copy link
Member Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

1 similar comment
@MaxDesiatov
Copy link
Contributor

@swift-ci test windows

@MaxDesiatov MaxDesiatov enabled auto-merge (squash) February 15, 2024 16:41
@kateinoigakukun
Copy link
Member Author

@swift-ci test windows

@MaxDesiatov MaxDesiatov merged commit 414fed6 into swiftlang:main Feb 16, 2024
5 checks passed
@kateinoigakukun kateinoigakukun deleted the yt/fix-build-tests branch February 16, 2024 13:48
kateinoigakukun added a commit to kateinoigakukun/swift-package-manager that referenced this pull request Feb 20, 2024
The test runner build was failing on WASI after the introduction of the
experimental summary output.

This PR fixes several minor issues to pass `--build-tests` build on
WASI:

* Missing `WASILibc` import
* The use of `flock` which is not available on WASI.
* Signature incompatibility of `XCTMain` on WASI.

`swift build --build-tests --triple wasm32-unknown-wasi` will pass when
compiler supports the target.
MaxDesiatov pushed a commit that referenced this pull request Apr 3, 2024
🍒 #7341

* **Explanation**: `swift build --build-tests` fails on WASI after the
experimental summary output, which is introduced in 5.10. This affects
not only experimental-summary mode but also the default output mode.
* **Scope**: Test build targeting WebAssembly
* **Risk**: Low, only affects to WebAssembly targets
* **Testing**: Integration test with WebAssembly Swift SDK on CI is
infeasible, so I manually tested. We can ensure there is no breakage on
other platforms on CI.
* **Reviewer**: @MaxDesiatov 
* **Main branch PR**:
#7341
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
### Motivation:

The test runner build was failing on WASI after the introduction of the
experimental summary output.

### Modifications:

This PR fixes several minor issues to pass `--build-tests` build on
WASI:

* Missing `WASILibc` import
* The use of `flock` which is not available on WASI.
* Signature incompatibility of `XCTMain` on WASI.


### Result:

`swift build --build-tests --triple wasm32-unknown-wasi` will pass when
compiler supports the target.
furby-tm pushed a commit to wabiverse/swift-package-manager that referenced this pull request May 15, 2024
### Motivation:

The test runner build was failing on WASI after the introduction of the
experimental summary output.

### Modifications:

This PR fixes several minor issues to pass `--build-tests` build on
WASI:

* Missing `WASILibc` import
* The use of `flock` which is not available on WASI.
* Signature incompatibility of `XCTMain` on WASI.


### Result:

`swift build --build-tests --triple wasm32-unknown-wasi` will pass when
compiler supports the target.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs tests This change needs test coverage swift test Changes impacting `swift test` tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants