Commit Graph

309 Commits

Author SHA1 Message Date
Saleem Abdulrasool
0f2ed0eb43 Runtimes: refactor swift interface installation
Extract the `install_swift_interface` function into a new file. This
is always invoked to perform the installation of the Swift interfaces as
well as the binary module. Additionally, it prepares for a future
refactoring which will also install the swift documentation interface.
2025-05-12 17:34:43 -07:00
Pavel Yaskevich
3854e61c49 Merge pull request #81428 from xedin/rename-some-task-apis
[stdlib] SE-0472: Rename `Task` and`*TaskGroup` APIs to match the pro…
2025-05-12 09:13:11 -07:00
Alastair Houghton
28f96e64ab [Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
If you use SwiftStdlibCurrentOS availability, you will be able to
use new types and functions from within the implementation. This
works by, when appropriate, building with the CurrentOS availability
set to the current deployment target.

rdar://150944675
2025-05-12 12:07:24 +01:00
Saleem Abdulrasool
9b6c04e3c7 Merge pull request #81404 from compnerd/disable
Runtimes: disable CMP0157 when building with the old driver
2025-05-10 11:29:07 -07:00
Pavel Yaskevich
001eab867d [stdlib] SE-0472: Rename Task and*TaskGroup APIs to match the proposal
`Task.startSynchronously` -> `Task.immediate`
`*TaskGroup.startTaskSynchronously{UnlessCancelled}` -> `*TaskGroup.addImmediateTask{UnlessCancelled}`
2025-05-09 23:59:30 -07:00
Saleem Abdulrasool
7992380a57 Merge pull request #81405 from compnerd/installation
Supplemental: add installation rules for StringProcessing
2025-05-09 16:54:33 -07:00
Saleem Abdulrasool
7e89e205bc Merge pull request #81406 from compnerd/reflection
Overlay: enable reflection on Windows
2025-05-09 16:24:42 -07:00
Saleem Abdulrasool
0fe855f860 Overlay: enable reflection on Windows
Enable this feature by default on Windows to keep parity with macOS.
2025-05-09 09:59:53 -07:00
Saleem Abdulrasool
7a7ac3c700 Supplemental: add installation rules for StringProcessing
Introduce install targets for the StringProcessing module. This is a
prerequisite for building a static variant of the standard library to
enable the statically linked early swift driver for Windows to
bootstrap.
2025-05-09 09:59:01 -07:00
Saleem Abdulrasool
fcb6d54b7a Runtimes: disable CMP0157 when building with the old driver
The C++ driver does not work properly with the split build (CMP0157).
Disable this to allow bootstrapping the static runtime on Windows.
2025-05-09 09:58:29 -07:00
Michael Gottesman
9d59dbed17 [swift-settings] Now that we aren't using it immediately, remove it from tree.
We can always get it back from the git history.

rdar://150695113
2025-05-05 13:39:03 -07:00
Evan Wilde
91a0692bd1 Merge pull request #81227 from etcwilde/ewilde/FreeBSDPlatformExecutor
Add platform executor module for FreeBSD
2025-05-04 13:07:32 -07:00
Evan Wilde
4a41e50730 Add platform executor module for FreeBSD
Effectively the same as Linux and OpenBSD. If Dispatch is disabled, this
will fail because the dispatch executor isn't defined.
2025-04-30 17:08:53 -07:00
Justice Adams
c8f1de2738 [Cmake] Add supplemental cmake modules (#81180)
Adds common CMAKE modules to be used by the supplemental libraries.
Namely:
* ResourceEmbedding
* PlatformInfo
* gyb
* EmitSwiftInterface
* CatalystSupport
2025-04-30 14:23:31 -07:00
Justice Adams
2eaa0e93ad [Runtimes][CMake] Supplemental super-build (#81179)
Continue with https://github.com/swiftlang/swift/pull/81006/

Will land the common Cmake modules next before implementing
Synchronization build
2025-04-30 14:23:04 -07:00
Evan Wilde
1bff8cda36 Merge pull request #80877 from 3405691582/platform_executor
Add a platform executor module for OpenBSD.
2025-04-27 17:44:10 -07:00
3405691582
db942def27 Add a platform executor module for OpenBSD.
This is basically the same as the one for Linux, but it would be
somewhat awkward to add the platform conditional on a file named for
Linux when OpenBSD is not Linux.

Important note: if Dispatch is disabled, then this will cause a
compilation error (probably not just for OpenBSD either), because
PlatformExecutorFactory is both defined in PlatformExecutorNone.swift
and PlatformExecutor<...>.swift in this case.

Because this only bites OpenBSD bootstrap builds, and since OpenBSD
support has been upstreamed to Dispatch, default to the Dispatch
implementation for now to get this in, and we'll refactor in a different
pr.
2025-04-25 14:05:58 -04:00
Saleem Abdulrasool
c82502c8f0 Merge pull request #81039 from compnerd/static-names-are-dynamic
Runtimes: manually adjust the library prefix for core,Concurrency
2025-04-24 14:48:53 -07:00
Saleem Abdulrasool
30f3f865bf Runtimes: manually adjust the library prefix for core,Concurrency
These libraries use C++ as the linker language which will prevent
`CMAKE_STATIC_LIBRARY_PREFIX_Swift` from impacting them. Wire this
property to the target manually so that it takes effect. This is
primarily meant to support Windows, where we use a non-standard library
prefix for static libraries mirroring the behaviour of the language
runtimes (i.e. ucrt, vcruntime, msvcrt).
2025-04-23 11:48:17 -07:00
Evan Wilde
6f39a52afc [SwiftCore]: Don't always clobber memory
The new build system set `SWIFT_RUNTIME_CLOBBER_FREED_OBJECTS` to 0.
Unfortunately, the check in the Swift runtime used `#ifdef`, so even
though it was turned off, it was actually enabled in some cases.

Fixing the issue in the build system as well as switching the check to
verify that value of `SWIFT_RUNTIME_CLOBBER_FREED_OBJECTS` is taken into
account in the sources. C/C++ implicitly defines macro values to 1 when
set without a value and 0 when it is not set.

Also making the hex a bit more recognizable and grep'able by including
it as a comment.

Fixes: rdar://149210738
2025-04-22 16:51:28 -07:00
Eric Miotto
1fa9c7ae37 [SwiftCore] emit correct names for symbols that can be backdeployed
This matches the flag that was added to the old build system in
b0627e28a2

Addresses rdar://149410833
2025-04-17 09:15:45 -07:00
Michael Ilseman
e6e4bd6056 UTF8Span (#78531)
Add support for UTF8Span

Also, refactor validation and grapheme breaking
2025-04-11 16:11:11 -06:00
Max Desiatov
cb0e1da0cb Revert "Revert "Concurrency: Move code between Executor{Bridge,Impl}.cpp"" (#80692)
* Revert "Revert "Concurrency: Move code between `Executor{Bridge,Impl}.cpp`""

* Update CMakeLists.txt
2025-04-10 05:35:28 -07:00
Slava Pestov
822083872b Merge pull request #80678 from slavapestov/visionos-stdlib
CompatibilitySpan: Fix stdlib build on visionOS
2025-04-10 07:55:49 -04:00
Slava Pestov
758284a00f cmake: Establish dependency on utils/availability-macros.def 2025-04-09 13:00:00 -04:00
Saleem Abdulrasool
4b376025ce Runtimes: add overlay for Android platform
This introduces the Android and Math modules for Android in the platform
specific overlay.
2025-04-07 16:03:58 -07:00
Doug Gregor
0100104ff7 [stdlib] Reinstate AllowUnsafeAttribute experimental feature on libraries
We need this so that older compilers can handle the .swiftinterface
files we generate. It's unnecessary for newer compilers and can be
removed later.

Fixes rdar://148529962.
2025-04-03 18:07:19 -07:00
Alastair Houghton
29da71761e [Concurrency] Fix new build script.
Looks like a new CMakelists.txt got added to the new build system while
I was working on this.
2025-03-31 17:10:24 +01:00
Guillaume Lessard
c9b1ab8c42 Merge pull request #79650 from glessard/rdar138440979-MutableSpan
[SE-0467] MutableSpan, with mutableSpan properties to Array, ArraySlice and ContiguousArray.
2025-03-28 17:59:47 -07:00
Evan Wilde
2a7dbd88a3 Merge pull request #80354 from etcwilde/ewilde/stdlib-enable-explicit-modules-builds
[SwiftCore] Enable explicit module builds
2025-03-28 17:35:33 -07:00
Saleem Abdulrasool
20ef4b09c5 Merge pull request #80340 from compnerd/clang
Runtimes: inject Windows SDK clang modules
2025-03-28 13:47:12 -07:00
Evan Wilde
4d892e0fe2 [CMake] Fix missing RegexParser dependency
RegexBuilder depends on RegexParser. Without the link dependency, we the
swift module isn't passed to the RegexBuilder build.
2025-03-27 20:55:16 -07:00
Guillaume Lessard
51db21acc4 [build] add files for the new build system 2025-03-27 16:55:06 -07:00
Evan Wilde
bfa5269dec [SwiftCore] Enable explicit module builds
Explicit module builds help prevent the dependency scanner from getting
lost and attempting to pull the SwiftShims module from the resource
directory, existing SDK, and the just-built standard library.
They aren't part of the library interface, but make it possible to build
the runtime libraries without seeing duplicate shims. Moving the flag to
a top-level compile command.
2025-03-27 15:20:09 -07:00
Saleem Abdulrasool
d51e1bcedf Runtimes: inject Windows SDK clang modules
When building the standard library, the SDK is not fully staged and so
the compiler would not be able to inject the VFS overlay for the
modularisation of the Windows SDK. Manually construct the mappings and
apply them.
2025-03-27 08:23:40 -07:00
Evan Wilde
bab0db68ad [CMake] Build _StringProcessing and RegexBuilder
First pass at getting the StringProcessing and RegexBuilder runtime
libraries built with pure CMake.
2025-03-26 17:37:11 -07:00
Evan Wilde
38a5fd6976 [CMake] Fix generated config install location
The expected install locations for the SwiftCoreConfig.cmake and
SwiftCoreTargets.cmake file was inconsistent between the build directory
and the install location. Making everything consistent across install
locations. In both cases, the files are installed under
`./cmake/SwiftCore`. This is one of the formats that `find_package` uses
to automatically search for package config files so that we can avoid
passing `SwiftCore_DIR` to all sub-projects.
2025-03-26 17:16:11 -07:00
Evan Wilde
d7db651b92 [CMake] Get _RegexParser building
This is a first pass at getting the _RegexParser library building.
2025-03-26 16:51:38 -07:00
Evan Wilde
aa6b5c2d37 [CMake] Copy StringProcessing files into stdlib
We want to move StringProcessing sources out of the experimental string
processing repository. Use the Resync script to copy the files from the
experimental repository into position in the StringProcessing library.
2025-03-26 16:45:23 -07:00
Saleem Abdulrasool
78ed9ad478 Runtimes: allow building the Overlay against SwiftCore
Wire up the SwiftCore project to the Overlay project. This allows us to
build against the just built SwiftCore.
2025-03-25 22:37:04 -07:00
Saleem Abdulrasool
a17cf9b785 Merge pull request #80250 from compnerd/dependencies
Runtimes: establish dependency on the registrar
2025-03-25 18:59:25 -07:00
Saleem Abdulrasool
3bb8cfb475 Merge pull request #80251 from compnerd/workaround
Runtimes: add additional interface flags
2025-03-25 13:09:50 -07:00
Saleem Abdulrasool
c2c991cc12 Merge pull request #80249 from compnerd/positional
Runtimes: always build the runtime as PIC
2025-03-25 13:09:31 -07:00
Saleem Abdulrasool
c1dbc12587 Runtimes: establish dependency on the registrar
This removes the workaround for the exporting of the registrar and
enables proper dependency tracking across projects (primarily geared
towards the Overlay).
2025-03-25 10:12:31 -07:00
Evan Wilde
457ec9e4f6 Merge pull request #80139 from etcwilde/ewilde/use-clangxx-linker
[CMake] Use CXX linker for Core and Concurrency
2025-03-25 09:15:16 -07:00
Saleem Abdulrasool
e46da509d0 Merge pull request #80207 from compnerd/_Builtin_float
Runtimes: add `_Builtin_float` to the overlay
2025-03-24 14:46:37 -07:00
Evan Wilde
1dc97c2c43 [CMake] Use CXX linker for Core and Concurrency
swiftCore and swift_Concurrency libraries use C++ and Swift. The C++
does not use the Swift C++ interop. Swift driver only uses clang++ to
link when building in C++ interop mode and there currently isn't a flag
to change that. Since we're explicitly linking the runtime registration
when necessary and do not need compatibility libraries, it is safe to
use clang++ as the linker directly, instead of going through swiftc.

In versions of CMake older than 3.29, Swift is always used as a linker
and has no compile stage. By using clang++ as the linker, we require the
split build model (CMP0157), so we cannot allow versions of CMake older
than 3.29.
2025-03-24 14:20:07 -07:00
Saleem Abdulrasool
db51658e3f Runtimes: add additional interface flags
Explicitly add the path to the Swift module to the interface include
directories. It is unclear why this is not propagating implicitly from
the module definition. For now, this ensures that the client is able to
load the standard library.
2025-03-24 13:10:35 -07:00
Saleem Abdulrasool
7a15ea09ad Runttimes: always build the runtime as PIC
When building the runtime, we do not know how it will be loaded even if
it is static. Default to building in PIC mode for non-Windows targets
(Windows is always implicit PIC).
2025-03-24 13:08:20 -07:00
Saleem Abdulrasool
f0b27bcd58 Merge pull request #80208 from compnerd/reorganise
Runtimes: reorganise flags for swiftCore
2025-03-24 13:07:48 -07:00