Skip to content

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Jul 24, 2025

Cherry-pick of #83128, #82399, and #82878, merged as ea6ca2b, 0c4e561, and e34eb33 respectively.

Explanation: Currently test/CMakeLists.txt can only set SWIFT_LIT_ARGS for all tests uniformly. This means that we can't have tests for Embedded Swift with a different set of lit.py arguments.

Also, create new check-swift-embedded-wasi target from test/CMakeLists.txt, tweak lit.cfg to support WASI Clang resource dir, exclude unsupported tests based on CPU=wasm32 instead of OS=wasi.

Scope: Limited to Embedded Swift test suite.
Risk: Low, due to limited scope.
Testing: #82878 was incubated on main for 2 weeks, #82399 for 3 weeks with no disruption, #83128 merged this week, but enables all these tests on CI, which are consistently passing.
Issue: rdar://156585717
Reviewer: @bnbarham

@MaxDesiatov MaxDesiatov changed the title test/CMakeLists.txt: run Embedded Swift for Wasm tests [6.2] test/CMakeLists.txt: run Embedded Swift for Wasm tests Jul 24, 2025
@MaxDesiatov MaxDesiatov marked this pull request as ready for review July 24, 2025 08:52
@MaxDesiatov MaxDesiatov requested a review from a team as a code owner July 24, 2025 08:52
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci build toolchain

@MaxDesiatov MaxDesiatov added cmake embedded Embedded Swift WebAssembly Platform: WebAssembly WASI WebAssembly System Interface support swift 6.2 test suite Area: test suite python Flag: Python source code build-script Area → utils: The build script labels Jul 24, 2025
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov MaxDesiatov force-pushed the maxd/setup-lit-args-6.2 branch from e094a35 to 1f8c9bb Compare July 24, 2025 13:20
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

1 similar comment
@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

Currently `test/CMakeLists.txt` can only set `SWIFT_LIT_ARGS` for all tests uniformly. This means that we can't have tests for Embedded Swift with a different set of params.

Let's refactor computation of `lit.py` options and arguments into a separate function, which means these params can set separately for different tests.

In this change we're only using it once, but in the future we anticipate another use of `setup_lit_args` specifically for Embedded Swift testing.
# Conflicts:
#	test/CMakeLists.txt
…wiftlang#82953)

After swiftlang#82878 `SWIFT_LIT_ARGS` wasn't merged into correct returned variable in `setup_lit_args`, let's fix that to make sure that options like `-v --debug` are passed correctly from CLI `build-script` invocations or from presets that have these options predefined.
Run new `check-swift-embedded-wasi` target from `test/CMakeLists.txt`, tweak `lit.cfg` to support both `-wasi` and `-wasip1` triples, exclude unsupported tests based on `CPU=wasm32` instead of `OS=wasi`.

# Conflicts:
#	test/embedded/builtin-float.swift
#	test/embedded/dependencies-random.swift
#	test/embedded/float-abi-hard.swift
#	test/embedded/fragile-reference.swift
#	test/embedded/no-allocations-print.swift
#	test/embedded/optionset2.swift
#	test/embedded/ouroboros-bug.swift
#	test/embedded/static-object-non-darwin.swift
#	test/embedded/stdlib-array.swift
#	test/embedded/stdlib-basic.swift
#	test/embedded/stdlib-dictionary.swift
#	test/embedded/stdlib-random.swift
#	test/embedded/stdlib-set.swift
#	test/embedded/stdlib-strings-interpolation3.swift
#	test/embedded/stdlib-types.swift
#	test/embedded/traps-fatalerror-ir.swift
Fixes a regression introduced with swiftlang#83167

# Conflicts:
#	test/embedded/classes-generic-no-stdlib.swift
#	test/lit.cfg
#	test/stdlib/POSIX.swift
#	test/stdlib/simd_diagnostics.swift
# Conflicts:
#	test/stdlib/simd_diagnostics.swift
There's a predefined list of supported platforms that WASI should be added now that it has an official Embedded Swift SDK.
# Conflicts:
#	test/embedded/classes-generic-no-stdlib.swift
This fixes default `LLVM_LIT_ARGS` having values inconsistent with rest of the test targets configured by CMake.
# Conflicts:
#	test/embedded/builtin-float.swift
#	test/embedded/concurrency-simple.swift
#	test/embedded/dependencies-random.swift
#	test/embedded/float-abi-hard.swift
#	test/embedded/fragile-reference.swift
#	test/embedded/traps-fatalerror-ir.swift
#	test/lit.cfg
@MaxDesiatov MaxDesiatov force-pushed the maxd/setup-lit-args-6.2 branch from 1c0f109 to e00f8d2 Compare July 24, 2025 16:47
@MaxDesiatov MaxDesiatov marked this pull request as draft July 24, 2025 16:52
@MaxDesiatov
Copy link
Contributor Author

@swift-ci smoke test linux

@MaxDesiatov
Copy link
Contributor Author

@swift-ci test

@MaxDesiatov
Copy link
Contributor Author

@swift-ci build toolchain

@MaxDesiatov MaxDesiatov marked this pull request as ready for review July 25, 2025 07:23
@MaxDesiatov
Copy link
Contributor Author

@swift-ci build toolchain windows

@MaxDesiatov MaxDesiatov moved this to Done in Swift for Wasm Jul 25, 2025
@MaxDesiatov MaxDesiatov moved this from Done to In Progress in Swift for Wasm Jul 25, 2025
@MaxDesiatov MaxDesiatov merged commit ab7cd23 into swiftlang:release/6.2 Jul 26, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Swift for Wasm Jul 26, 2025
@MaxDesiatov MaxDesiatov deleted the maxd/setup-lit-args-6.2 branch July 26, 2025 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-script Area → utils: The build script cmake embedded Embedded Swift python Flag: Python source code swift 6.2 test suite Area: test suite WASI WebAssembly System Interface support WebAssembly Platform: WebAssembly
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants