Commit Graph

267 Commits

Author SHA1 Message Date
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
758284a00f cmake: Establish dependency on utils/availability-macros.def 2025-04-09 13:00:00 -04: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
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
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
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
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
Saleem Abdulrasool
817a34c1b9 Merge pull request #80235 from compnerd/quotes
Runtimes: quote the path for module map files
2025-03-24 11:37:29 -07:00
Guillaume Lessard
c21de062bb Merge pull request #78561 from glessard/rdar137710901-span-properties-prototype
[SE-0456] Span properties (part 1)
2025-03-24 08:47:47 -07:00
Saleem Abdulrasool
0c632bb17f Runtimes: quote the path for module map files
The install path may contain spaces which will be processed improperly
when wired through the dependency. Add quotes to handle such paths.
2025-03-23 20:11:14 -07:00
Saleem Abdulrasool
564191e07c Merge pull request #80205 from compnerd/location
Runtimes: adjust path for referencing SwiftCoreTargets.cmake
2025-03-23 15:10:15 -07:00
Saleem Abdulrasool
f0c4a5c986 Merge pull request #80206 from compnerd/defaults
Runtimes: adjust the default settings for Windows
2025-03-23 11:14:49 -07:00
Saleem Abdulrasool
bb2c93571e Runtimes: add an export for ConcurrencyInternalShims
This is required to use the SwiftCore package externally via
`find_package` when Concurrency is enabled. We are otherwise unable to
process the CMakeLists due to the missing dependency from the export
set.
2025-03-21 13:17:51 -07:00
Saleem Abdulrasool
d19fd71174 Runtimes: reorganise flags for swiftCore
This re-organises the file a small amount to put the source listing and
additions together. Subsequently, apply compile definitions, options,
and then link libraries and finally options
2025-03-21 12:15:19 -07:00
Saleem Abdulrasool
3106f15165 Runtimes: adjust the default settings for Windows
This adjusts the default settings for the Windows build of the Swift
runtime to include reflection and to re-order them to match the Darwin
configuration to make it easier to identify differences.
2025-03-21 12:11:41 -07:00
Saleem Abdulrasool
440a66a7f6 Runtimes: adjust path for referencing SwiftCoreTargets.cmake
This is loaded by the CMake package configuration so that you can add
cross-package dependencies. Adjust the path so that the lookup succeeds
on all targets.
2025-03-21 11:57:30 -07:00
Saleem Abdulrasool
bc45db16fd Runtimes: properly link in swiftrtT?.obj on Windows
`swiftrtT.obj` should be used for statically linking the standard
library (or within the standard library itself). For the other modules,
we need to differentiate between `swiftrt.obj` and `swiftrtT.obj`. This
fixes that oversight. This was not caught by the CI builds as we do not
currently build both the static and dynamic variants of the new
runtimes.
2025-03-20 11:07:46 -07:00
Alejandro Alonso
25b10ebf76 Merge pull request #78092 from Azoy/enumerated-collection
[stdlib] Conditionally conform EnumeratedSequence to Collection(s)
2025-03-18 09:24:08 -07:00
Alejandro Alonso
a55c9c792d Add EnumeratedSequence to new build system 2025-03-17 18:11:48 -07:00
Evan Wilde
d280b1438a Merge pull request #80023 from etcwilde/ewilde/new-runtime-build-sccache-module
[CMake] Add cache for enabling sccache builds
2025-03-14 17:55:05 -07:00
Evan Wilde
98cf8d2b64 [CMake] Add cache for enabling sccache builds
Add cmake cache for enabling sccache while building with the new runtime
build when sccache is available.

To build with sccache, pass the `sccache.cmake`

```
cmake \
  -B build \
  -S Runtime/Core \
  -C Runtimes/Core/cmake/cache/sccache.cmake
```
2025-03-14 10:38:39 -07:00
Michael Gottesman
04bb69f426 Merge pull request #79727 from gottesmm/pr-025c1133954b74e7b4eda77e1a6f3bcafd4eb6cf
[concurrency] Add initial support for SwiftSettings to control defaultIsolation at the file level.
2025-03-10 22:35:00 -07:00
Michael Gottesman
f64dd5a8d5 [concurrency] Add initial support for SwiftSettings to control defaultIsolation at the file level.
We introduce a new macro called #SwiftSettings that can be used in conjunction
with a new stdlib type called SwiftSetting to control the default isolation at
the file level. It overrides the current default isolation whether it is the
current nonisolated state or main actor (when -enable-experimental-feature
UnspecifiedMeansMainActorIsolated is set).
2025-03-10 17:33:45 -07:00
Guillaume Lessard
96e9945d10 [stdlib] only enable “AddressableTypes” for the core stdlib 2025-03-10 14:24:59 -07:00
Saleem Abdulrasool
c3604743de Runtimes: tweak incorrect case (NFC)
This adjusts the spelling for the architecture specifier for the Windows
compilers. Take the opportunity to further restrict the compiler check
to micro-optimize the CMake configure phase.
2025-03-08 08:22:15 -08:00
Konrad `ktoso` Malawski
fda7f539fb Reapply "Task names" (#79562) (#79600) 2025-03-08 10:58:49 +09:00
Saleem Abdulrasool
0d8e005185 Merge pull request #79754 from compnerd/cx16
build: only apply `-mcx16` on X86 CPUs
2025-03-04 09:18:14 -08:00
Saleem Abdulrasool
40bf17c00d build: only apply -mcx16 on X86 CPUs
This is required to support compilation for non-X86 architectures.
2025-03-03 15:51:43 -08:00
Evan Wilde
0c5455ebad Fix missing PROPERTIES keyword in Finddispatch
Was missing the `PROPERTIES` keyword on the `Finddispatch` cmake
module resulting in failures to load it correctly.
2025-03-03 10:45:23 -08:00
Evan Wilde
7679b6e08f CMake: Fix swiftrt.o install location on Linux
Flipped the conditional here. Was installing swiftrt.o to `swift_static`
when building dynamic libraries and `swift` when building static
archives.
2025-02-28 15:00:51 -08:00
Evan Wilde
f6edc3d7d0 CMake: Allow setting optimization remark type
Optimization remarks were always emitted on Darwin but not on the other
platforms and were forced to use the bitstream format. Adding a flag to
enable or disable them as desired and specify the desired output format.

Fixes: https://github.com/swiftlang/swift/issues/79279
2025-02-27 20:36:19 -08:00
Evan Wilde
25186b2182 Merge pull request #79677 from etcwilde/ewilde/vanilla-extract
Extract experimental feature flags
2025-02-27 20:29:19 -08:00
Evan Wilde
3102bc0334 Extract experimental feature flags
Extracting experimental feature flags into a separate file so that we
can add Allan as a code owner of just that file. He has to deal with
breakage when folks remove these flags improperly.
2025-02-27 14:16:44 -08:00
Saleem Abdulrasool
bab2e673d6 Runtime: correct install rules for runtime component
We missed a `$<` leader for the generator expression. Adjust the install
rules to account for that.
2025-02-27 11:13:31 -08:00
Konrad `ktoso` Malawski
f55964df26 [Concurrency] Initial steps for startSynchronously for Task (#79608)
* [Concurrency] Initial steps for startSynchronously for Task

* [Concurrency] Rename to _startSynchronously while in development

* [Concurrency] StartSynchronously special executor to avoid switching

* startSynchronously bring back more info output

* [Concurrency] startSynchronously with more custom executor tests

* add missing ABI additions to test for x86

* [Concurrency] gyb generate _startSynchronously

* [Concurrency] %import dispatch for Linux startSynchronously test

* [Concurrency] Add TaskGroup.startTaskSynchronously funcs

* [Concurrency] DispatchSerialQueue does not exist on linux still
2025-02-27 02:34:33 -08:00
Doug Gregor
3001177e2b Merge pull request #78372 from DougGregor/strict-safety-stdlib
[SE-0458] Adopt strict memory safety in the standard libraries
2025-02-26 23:30:32 -08:00
Evan Wilde
38069136d7 Merge pull request #79642 from etcwilde/ewilde/fix-linux-swiftrt-location
CMake: Fix swiftrt.o install location
2025-02-26 17:15:28 -08:00
Doug Gregor
50d3913086 [SE-0458] Enable strict memory safety in the Swift standard library 2025-02-26 14:27:55 -08:00
Evan Wilde
7011a4091d Writing a readme on using the new build
Adding a quick readme to get folks started with using the new build and
the different ways to configure it.
2025-02-26 11:25:02 -08:00