Commit Graph

184211 Commits

Author SHA1 Message Date
David Smith
155d7fbbcf [6.2] Make sure SwiftObject doesn't crash when compared to tagged pointers (#83271)
Cherry pick of https://github.com/swiftlang/swift/pull/83269
2025-07-25 01:11:46 -07:00
Shubham Sandeep Rastogi
1aab25d990 Merge pull request #83305 from rastogishubham/RevertCompDir6.2
[6.2] Revert "Set the Compilation directory when generating the Skeleton CU"
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-25-a
2025-07-24 19:35:40 -07:00
Alexis Laferrière
f649ac5642 Merge pull request #83313 from swiftlang/pick-af04c84
[6.2] Pick missing test cleanup, unbreak test on some CI
2025-07-24 17:06:48 -07:00
Konrad 'ktoso' Malawski
e44e54e60c [Distributed] Minor test cleanup 2025-07-25 09:00:52 +09:00
Shubham Sandeep Rastogi
87925d5c37 Revert "Set the Compilation directory when generating the Skeleton CU"
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)
2025-07-24 11:02:31 -07:00
Mike Ash
afde15c21a Merge pull request #83267 from mikeash/implicit-weak-capture-test-timing-fix-6.2
[6.2][Test] Make implicit_weak_capture.swift more robust.
2025-07-24 01:13:51 -04:00
Doug Gregor
2db51c9159 Merge pull request #82923 from DougGregor/sendable-prohibits-mainactor-by-default-6.2
[6.2] [SE-0466] Enable SendableProhibitsMainActorInference by default
2025-07-23 20:04:56 -07:00
Mike Ash
888f2ec894 [6.2][Test] Make implicit_weak_capture.swift more robust.
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)
2025-07-23 16:38:59 -04:00
Holly Borla
4518bc9dcf Merge pull request #83254 from hborla/6.2-local-decl-isolation-alt
[6.2][Concurrency] Only apply default main actor to local and nested decls that are in a main actor isolated context.
2025-07-23 11:12:34 -07:00
eeckstein
ef4a51e642 Merge pull request #83259 from swiftlang/pick-wip-missing-plugin-paths-da
[6.2]Test: add some missing plugin paths to distributed tests #83258
2025-07-23 17:21:13 +02:00
Charles Zablit
5954a7c07d Merge pull request #83202 from charles-zablit/charles-zablit/windows/fix-wrong-LLVM_HOST_TRIPLE-to-6.2
🍒 [windows][lldb] fix incorrect LLVM_HOST_TRIPLE when cross-compiling
2025-07-23 14:35:35 +01:00
Michael Ilseman
7983566de5 [6.2] Better docs for UTF8Span (#83184) (#83209)
Cherry pick of https://github.com/swiftlang/swift/pull/83184

<!--
If this pull request is targeting a release branch, please fill out the
following form:

https://github.com/swiftlang/.github/blob/main/PULL_REQUEST_TEMPLATE/release.md?plain=1

Otherwise, replace this comment with a description of your changes and
rationale. Provide links to external references/discussions if
appropriate.
If this pull request resolves any GitHub issues, link them like so:

  Resolves <link to issue>, resolves <link to another issue>.

For more information about linking a pull request to an issue, see:

https://docs.github.com/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
-->

<!--
Before merging this pull request, you must run the Swift continuous
integration tests.
For information about triggering CI builds via @swift-ci, see:

https://github.com/apple/swift/blob/main/docs/ContinuousIntegration.md#swift-ci

Thank you for your contribution to Swift!
-->

Co-authored-by: Alex Martini <amartini@apple.com>
2025-07-23 03:48:20 -07:00
Stephen Canon
59e64904dc [6.2] Use unsigned arithmetic for Span bounds checks (#83215)
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
2025-07-23 03:38:07 -07:00
Konrad 'ktoso' Malawski
b368cf4f1d Test: add some missing plugin paths to distributed tests 2025-07-23 19:24:10 +09:00
eeckstein
b30ad5cc79 Merge pull request #83227 from swiftlang/pick-wip-fix-macro-libs-path-for-startImmediately.swift
[6.2][test] startImmediately was missing explicit plugins path
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-23-a
2025-07-23 07:02:22 +02:00
Holly Borla
276e5de462 [Concurrency] Local storage is always default nonisolated.
(cherry picked from commit 7b0ba7b5ed)
2025-07-22 21:36:59 -07:00
Holly Borla
2697773f21 [Concurrency] Only apply default main actor to local and nested
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)
2025-07-22 21:15:26 -07:00
Yuta Saito
a1a8d73ea2 [6.2][wasm] Build and install XCTest for Wasm Swift SDK (#83200)
- **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
2025-07-22 23:06:50 +01:00
Yuta Saito
b7c3ceac0f [6.2][wasm] Rename wasm32-unknown-wasi to wasm32-unknown-wasip1 (#83199)
- **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
2025-07-22 11:23:07 -07:00
Dario Rexin
816701237b [Test] Fix IRGen/abi_v7k.swift
rdar://155863017

The way enum tag bits are represented in the compiler has changed, which also caused the emitted code to slightly change.
2025-07-22 09:06:05 -07:00
Gábor Horváth
7429124124 Merge pull request #83065 from Xazax-hun/guard-more-objc-on-6.2
[6.2][cxx-interop] Types exposed from ObjC modules should be behind a macro
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-22-a
2025-07-22 11:20:22 +01:00
Konrad 'ktoso' Malawski
835d55f45a [test] startImmediately was missing explicit plugins path 2025-07-22 17:52:02 +09:00
Dario Rexin
b7acd126ff Merge pull request #83074 from drexin/wip-155641749
[6.2][IRGen] Set generic context before getting call emission in visitFull…
2025-07-21 15:56:30 -07:00
Ben Barham
315de8dd74 Merge pull request #82516 from bnbarham/6.2-use-compiler-version
[6.2] Use SWIFT_COMPILER_VERSION before SWIFT_TOOLCHAIN_VERSION if it exists
2025-07-21 15:07:21 -07:00
Charles Zablit
56193998f5 [windows][lldb] fix incorrect LLVM_HOST_TRIPLE when cross-compiling 2025-07-21 13:00:13 +02:00
fredriss
b8da06d64a Merge pull request #83123 from augusto2112/virtual-read-remote-addr-6.2
[NFC][RemoteInspection] Make MemoryReader::readRemoteAddress virtual
swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-21-a
2025-07-18 15:12:35 -07:00
Pavel Yaskevich
61157cdd36 Merge pull request #83165 from xedin/nonisolated-nonseding-with-special-decls-6.2
[6.2][Concurrency] NonisolatedNonsendingByDefault: Infer `nonisolated(nonsending)` on declaration with special special semantics
2025-07-18 09:40:08 -07:00
Joe Groff
6516d94624 Merge pull request #83142 from jckarter/semantic-store-preconcurrency-6.2
[6.2] SILGen: Have emitSemanticStore cast off concurrency annotations.
2025-07-18 08:48:30 -07:00
finagolfin
d746436d94 Merge pull request #82986 from finagolfin/droid
[6.2][android] Small test and build tweaks
2025-07-18 15:22:47 +05:30
Gabor Horvath
f48da45438 [cxx-interop] Configure requires ObjC from frontend option
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.
2025-07-18 10:35:51 +01:00
Michael Gottesman
64a53b483e Merge pull request #83084 from gottesmm/release/6.2-rdar155905383
[6.2][concurrency] Make optimize hop to executor more conservative for 6.2 around caller isolation inheriting functions.
2025-07-17 22:04:17 -07:00
Holly Borla
f8ca0f006a Merge pull request #83138 from hborla/6.2-invalid-isolated-conformance-downgrade
[6.2][Concurrency] Downgrade isolated conformances to `SendableMetatype` protocols to a warning for implicitly `@preconcurrency` protocols.
2025-07-17 21:04:30 -07:00
Guillaume Lessard
a345e3a8b3 Merge pull request #83000 from glessard/rdar147780495-OutputSpan-updates-62
[SE-0485, 6.2] OutputSpan and OutputRawSpan
2025-07-17 19:12:58 -07:00
Pavel Yaskevich
fb0daaa78a [Concurrency] NonisolatedNonsendingByDefault: Extend nonisolated(nonsending) to _openExistential
`_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)
2025-07-17 18:08:30 -07:00
Pavel Yaskevich
18817b823f [Concurrency] NonisolatedNonsendingByDefault: Extend nonisolated(nonsending) to withoutActuallyEscaping
`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)
2025-07-17 18:08:30 -07:00
Max Desiatov
ba7944b743 6.2: Build and install Testing and Foundation for Wasm Swift SDK (#83059)
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>
2025-07-17 15:53:19 -07:00
Joe Groff
07a3dfb1d1 SILGen: Have emitSemanticStore cast off concurrency annotations.
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
2025-07-17 11:16:55 -07:00
Michael Gottesman
82b0ec3de0 [silgen] Make sure that thunks that convert to/from nonisolated(nonsending) handle hopping correctly.
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
2025-07-17 10:55:59 -07:00
Holly Borla
94df8da676 [Concurrency] Downgrade isolated conformances to SendableMetatype
protocols to a warning for implicitly `@preconcurrency` protocols.

(cherry picked from commit 4b50238ebf)
2025-07-17 10:28:27 -07:00
Artem Chikin
94f1efbd34 Merge pull request #83076 from artemcm/62_AddClangTargetWeakImportGlobalVarTest
[6.2 🍒][Test Only] Add a test for correctly querying Clang global variable linkage when using `-clang-target`
2025-07-17 09:19:28 -07:00
Anthony Latsis
ffa408d9b8 Merge pull request #83110 from swiftlang/jepa-release
[6.2] Sema: Make `@concurrent` not imply `async` on closures
2025-07-17 16:44:44 +01:00
Yuta Saito
0a5a694b46 Merge pull request #83120 from kateinoigakukun/yt/cherry-pick-6.2-gh83086
[6.2][Concurrency] Fix runtime isolated-conformance checks with static stdlib
2025-07-17 22:00:15 +09:00
Doug Gregor
5797130e90 Merge pull request #83119 from DougGregor/unsafe-covers-unsafe-6.2 swift-6.2-DEVELOPMENT-SNAPSHOT-2025-07-17-a 2025-07-17 02:02:18 -07:00
Konrad `ktoso` Malawski
8e4d9a3c8a [6.2][Concurrency] Remove symbols of startSynchronously, make it AEIC (#83089)
Co-authored-by: Pavel Yaskevich <pyaskevich@apple.com>
2025-07-17 00:44:36 -07:00
Michael Gottesman
7f9eb4ccb1 Merge pull request #83102 from gottesmm/release/6.2-revert
[6.2] Revert nonisolated(unsafe) closure inference
2025-07-16 22:03:39 -07:00
Augusto Noronha
2ec8f057ca [RemoteInspection] Make MemoryReader::readRemoteAddress virtual
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)
2025-07-16 21:35:07 -07:00
Augusto Noronha
ac62ffcbf8 [NFC][RemoteMirrors] Add "template" in front of calls to readRemoteAddress
(cherry picked from commit 16591e4d0e)
2025-07-16 21:35:01 -07:00
Yuta Saito
6b2ade5d99 [6.2] Skip a part of isolated_conformance.swift on WASI
Custom global executor is not landing in 6.2, so we skip the test
by just gating it behind the platform check.
2025-07-17 04:20:13 +00:00
Doug Gregor
c9205fe649 Merge pull request #83103 from swiftlang/revert-82791-cdecl-6.2
Revert "[6.2] Accept `@cdecl` global functions and enums, behind experimental feature flags"
2025-07-16 18:01:15 -07:00
Guillaume Lessard
2a88f0e764 [stdlib] add OutputSpan to backdeployment library 2025-07-16 17:19:42 -07:00