Skip to content

Conversation

@stmontgomery
Copy link
Contributor

This merges the main branch into the release/6.2 branch.

Note: The Swift Testing project will be periodically performing "backwards" merges like this for a period which extends beyond the date when the 6.2 branches were cut, since nearly all contributions are intended to be included in the 6.2 release.

Once this PR has been merged, I will adjust the milestones on the PRs included in this merge to be 6.2 wherever appropriate.

Checklist:

  • Code and documentation should follow the style of the Style Guide.
  • If public symbols are renamed or modified, DocC references should be updated.

…ability when building w/legacy driver (swiftlang#1106)

This works around a Swift compiler bug which causes a failure validating
the generated .swiftinterface of the `Testing` module due to it having
macro declarations with `#if`-conditionalized `@available(...)`
attributes _before_ any other `@`-attributes.

The PR which recently landed to enable the Exit Tests feature (swiftlang#324)
revealed this compiler bug — specifically, that PR removed `@_spi`
attributes which until then _preceded_ `#if SWT_NO_EXIT_TESTS`. The
workaround is to move other attributes on the affected macro
declarations up before the `#if`.

The compiler bug is being fixed in
swiftlang/swift#81346. It only appears to happen
when building with the legacy driver, and Android uses that driver
still. An example CI failure log can be found here:

>
https://github.com/thebrowsercompany/swift-build/actions/runs/14823859186/job/41615678071#step:32:72

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
…possible (swiftlang#1102)

This adjusts usages of `withTaskGroup` and `withThrowingTaskGroup` to
take advantage of [SE-0442: Allow TaskGroup's ChildTaskResult Type To Be
Inferred](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0442-allow-taskgroup-childtaskresult-type-to-be-inferred.md)
by inferring the child task result type.

I successfully built this PR using a Swift 6.1 toolchain. A couple
usages I _did_ need to leave explicitly specified, but most I was able
to simplify.

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
…emberImportVisibility enabled (swiftlang#1108)

This fixes several instances of a build error when attempting to build
this package for iOS, or any non-macOS Apple platform. Here's one
example

```
error: instance method 'contains' is not available due to missing import of defining module 'Foundation'
Tests/TestingTests/SwiftPMTests.swift:370:5: note: in expansion of macro 'expect' here
    #expect(testIDs.allSatisfy { $0.contains(".swift:") })
```

This general kind of build error is being emitted because we adopted
[SE-0444: Member import
visibility](https://github.com/swiftlang/swift-evolution/blob/main/proposals/0444-member-import-visibility.md)
by enabling the `MemberImportVisibility` experimental feature in swiftlang#1020.

In that PR, I fixed several instances of missing imports, including some
for `Foundation` in test files. But these errors are from usages of
`String.contains()`, and it turns out there are multiple overloads of
that function, with an older one in `Foundation` and a newer one
directly in the stdlib `Swift` module. The latter has newer, iOS
13.0-aligned API availability, and when building our tests for macOS
this issue was not noticed previously because SwiftPM artificially
raises the deployment target of macOS test targets to match the testing
frameworks included in Xcode (when the testing libraries are being used
from the installed copy of Xcode).

### Checklist:

- [x] Code and documentation should follow the style of the [Style
Guide](https://github.com/apple/swift-testing/blob/main/Documentation/StyleGuide.md).
- [x] If public symbols are renamed or modified, DocC references should
be updated.
@stmontgomery stmontgomery added this to the Swift 6.2 milestone May 8, 2025
@stmontgomery stmontgomery self-assigned this May 8, 2025
@stmontgomery stmontgomery added the integration ⚙️ Integrating work to release branches label May 8, 2025
@stmontgomery
Copy link
Contributor Author

@swift-ci please test

@stmontgomery stmontgomery merged commit 3497bf2 into swiftlang:release/6.2 May 8, 2025
3 checks passed
@stmontgomery stmontgomery deleted the main-6.2-merge branch May 8, 2025 02:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration ⚙️ Integrating work to release branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants