This reverts commit b286b1c3a5.
Reverted because fix for rdar://131726681 broke rdar://154247270
Reverting and will try to fix properly later.
We will not land this in 6.2
(cherry picked from commit 5b4fdd6e62)
This test creates an object then checks a weak reference to that object on a background thread. It was doing this check after 10ms, and any small hiccup could potentially delay the object's destruction enough to spuriously fail.
Rearrange the test to check the weak reference in a loop for several seconds before giving up. This makes it very fast on success (it's done the moment it sees nil) while being robust against up to several seconds of delay in destroying the object if that happens.
rdar://149868181
(cherry picked from commit d0248afd14)
This allows us to eliminate a comparison;
https://github.com/swiftlang/swift/pull/83172 will allow the compiler to
do it for us instead in the future.
**Explanation:** Changes the implementation of Span's subscript bounds
checks to use a single unsigned comparison instead of two signed
compares.
**Scope:** Narrow. Does not apply to any other API.
**Issues:** rdar://156068535
**Original PRs:** https://github.com/swiftlang/swift/pull/83150
**Risk:** Low. Minor implementation tweaks to API that is not widely
adopted.
**Testing:** CI
**Reviewers:** @glessard @meg-gupta
decls that are in a main actor isolated context.
This prevents `@MainActor` from being inferred in a context where
it cannot be used, while still allowing main actor code to be used
in local contexts that are also main actor isolated.
(cherry picked from commit 858e145069)
- **Explanation**: Install static XCTest library and its Swift module files into Swift SDK for Wasm
- **Scope**: Narrow, only affects Wasm Swift SDK.
- **Original PRs**: https://github.com/swiftlang/swift/pull/83191
- **Risk**: Low, just a change to Wasm Swift SDK
- **Testing**: CI
- **Reviewers**: @MaxDesiatov
- **Explanation**: Renames the WebAssembly target triple from `wasm32-unknown-wasi` to `wasm32-unknown-wasip1` to align with the broader WebAssembly ecosystem's naming conventions. It's important to include this in 6.2, which is going to be the first stable release of Swift SDK for Wasm, so that we won't introduce a breaking triple change in the stable version series later.
The WebAssembly ecosystem has been migrating from the generic wasi target name to more explicit version-specific names like `wasip1` and `wasip2`. This change has been adopted across multiple toolchains and language ecosystems:
- Rust: Renamed `wasm32-wasi` to `wasm32-wasip1` (https://github.com/rust-lang/compiler-team/issues/607)
- wasi-sdk: Renamed `wasm32-wasi` to `wasm32-wasip1` (https://github.com/WebAssembly/wasi-sdk/pull/386)
- Go: Already uses `wasip1` naming convention (https://github.com/golang/go/issues/58141)
The "p1" suffix explicitly indicates WASI Preview 1, which helps distinguish it from the newer WASI Preview 2 (wasip2) and provides clarity about which version of the WASI specification is being targeted.
Also we already use `wasm32-unknown-wasip1` for Embedded WASI target, and having different names for Embedded and non-Embedded is confusing users.
- **Scope**: Narrow, only affects Wasm Swift SDK.
- **Original PRs**: https://github.com/swiftlang/swift/pull/83167
- **Risk**: Low, just a change to Wasm Swift SDK
- **Testing**: CI.
- **Reviewers**: @MaxDesiatov
We sometimes don't have the information in the modulemaps whether a
module requires ObjC or not. This info is useful for reverse interop.
This PR introduces a frontend flag to have a comma separated list of
modules that we should import as if they had "requires ObjC" in their
modulemaps.
`_openExistential` is type-checked in a special way which
means that we need to explicitly inject `nonisolated(nonsending)`
isolation when forming a reference to this builtin.
(cherry picked from commit 358869ff54)
`withoutActuallyEscaping` is type-checked in a special way which
means that we need to explicitly inject `nonisolated(nonsending)`
isolation when forming a reference to this builtin.
(cherry picked from commit 48f4d7b688)
Cherry-pick of #82285, merged as 05204bdf63
**Explanation**: Include Swift Testing Foundation and libxml2 into the Swift SDK for WebAssembly
**Scope**: Limited to Swift SDK for Wasm
**Risk**: Low, due to limited scope. Changes were incubated on `main` for 2 weeks with no known issues. Swift Testing changes were incubated for more than a month.
**Testing**: Manual testing with Swift SDKs produced off `main`.
**Issue**: rdar://155865189
**Reviewer**: @MaxDesiatov
---------
Co-authored-by: Yuta Saito <kateinoigakukun@gmail.com>
If a function is being semantically treated as having different concurrency
annotations because of a `@preconcurrency` import or language mode setting,
then SILGen may try to store an argument or result for a call using a value
that differs only in concurrency annotations, which can be safely bitcast
away.
Fixes rdar://154520999
Specifically:
1. When we convert a function to nonisolated(nonsending), we need to
make sure that in the thunk we hop upon return since nonisolated(nonsending)
functions are assumed to preserve the caller's isolation.
2. When we convert a function from nonisolated(nonsending), we need to
make sure that in the thunk we hop onto the actor that we are passing in as the
isolated parameter of the nonisolated(nonsending) function. This ensures that
the nonisolated(nonsending) function can assume that it is already on its
isolated parameter's actor at function entry.
rdar://155905383
Allow subclasses to override the behavior of readRemoteAddress. LLDB in
particular needs this to correctly set the address space of the result
remote address.
rdar://148361743
(cherry picked from commit 45d6d45623)