Commit Graph

253 Commits

Author SHA1 Message Date
Alastair Houghton
a1daea92ed [Build][Concurrency] Update new runtime build as well.
We need to update the new runtime build with the filename change also.

rdar://153531418
2025-06-23 18:31:05 +01:00
Evan Wilde
d34347876d SwiftCore: Cache computed platform info
Implements a similar caching mechanism to what CMake uses for detecting
the compiler. The file is created based on the computed values and
allows us to avoid calling the compiler if we aren't going to extract
out any platform info.
2025-06-09 18:01:56 -07:00
Evan Wilde
93603987dd Move availability args to response file
The availability flags keep increasing the number of characters on the
command line overflowing the maximum character length on Windows and
making the commands harder to read. This patch moves the generated
arguments into a separate response file so that they can continue to
grow without running into argument length limitations.
2025-06-06 16:58:12 -07:00
Alastair Houghton
726aaf710f Merge pull request #81940 from al45tair/eng/PR-152498657
Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
2025-06-04 17:27:49 +01:00
Alastair Houghton
42ca1b1cc8 Rename SwiftStdlibCurrentOS to StdlibDeploymentTarget.
`StdlibDeploymentTarget` seems to be a better name.

rdar://152498657
2025-06-04 10:40:19 +01:00
Saleem Abdulrasool
3d0d95bfe3 Merge pull request #81927 from compnerd/this-reflects-poorly
runtimes: enable reflection by default on ELFish targets
2025-06-03 13:31:47 -07:00
Alastair Houghton
d5ed335339 Merge pull request #81440 from al45tair/currentos-availability
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
2025-06-03 15:01:22 +01:00
Saleem Abdulrasool
447b50d573 runtimes: enable reflection by default on ELFish targets
We need reflection enabled as swift-collections uses this which is
required for Foundation. Adjust the defaults to allow building
Foundation for Android again.
2025-06-02 20:12:08 -07:00
Guillaume Lessard
db7881ef2c [cmake] InoutLifetimeDependence should be enabled
Addresses rdar://152467655
2025-06-02 18:55:13 -07:00
Alastair Houghton
467f401ef1 [Build] Fix availability platform macros.
These need to be defined always; we'll set them to "unknown" and "none"
respectively if they end up being something we don't understand.

rdar://150966361
2025-06-02 11:30:31 +01:00
Alastair Houghton
d110464649 [Build] Fix macos vs macosx issue.
The module triple bizarrely omits the "x" from "macosx".

Also disable some of this code on non-Apple platforms.

rdar://150944675
2025-05-29 18:18:44 +01:00
Alastair Houghton
7e318e2c91 [Build] Use FATAL_ERROR, not ERROR.
We should be using `FATAL_ERROR` for error messages from CMake, not
just `ERROR`.
2025-05-28 14:55:49 +01:00
Alastair Houghton
c749e64f93 [Build] Fix variable name in new build system.
It should have been `SwiftCore_MODULE_TRIPLE`, not
`SwiftCore_SWIFT_MODULE_TRIPLE`.
2025-05-28 14:49:42 +01:00
Konrad `ktoso` Malawski
31b6ae2fcf Merge pull request #80984 from ktoso/task-names-update
[Concurrency][SE-review update] Task names update
2025-05-28 06:23:49 +09:00
Stephen Canon
592d72bba9 Concrete SIMD.init(repeating:) and SIMD.init(lowHalf:highHalf:) optimizations (#81766)
WIP to add more overloads to optimize SIMD codegen on concrete types.
Here we do:

- init(repeating:)
- init(lowHalf:highHalf:)

These are always inlined, even in debug, since LLVM knows how to lower
them to one or two instructions on the targets that we care about.
2025-05-27 15:15:13 -04:00
Alastair Houghton
cd7701cd82 [Build] Add catalyst support to SwiftStdlibCurrentOS.
Add catalyst support for SwiftStdlibCurrentOS.

Also, set a minimum deployment target when building Concurrency;
this stops the build failing when we're trying to build on older
systems where Concurrency didn't really exist yet.

rdar://150966361
2025-05-23 10:31:56 +01:00
Saleem Abdulrasool
028624c30d Runtimes: mark CommandLineSupporta as an OBJECT library
This allows compaction into swiftCore when building mirroring the
beahviour of the old build system. This matters solely when building
with a static library distribution of swiftCore where you would
previously need to explicitly link against the swiftCommandLineSupport
library when building with the new build system.
2025-05-19 17:36:49 -07:00
Evan Wilde
9993d295fa Merge pull request #81491 from etcwilde/ewilde/enable-commandline-by-default
Runtimes: Enable CommandLine support wholesale
2025-05-14 12:02:18 -07:00
Saleem Abdulrasool
62c384e21d Merge pull request #81479 from compnerd/configuration
Runtimes: tweak default configuration for Windows
2025-05-14 09:45:45 -07:00
Saleem Abdulrasool
25bcfedd5c Merge pull request #81490 from compnerd/compaction
Runtimes: correct CommandLineSupport build on Windows
2025-05-14 09:44:56 -07:00
Saleem Abdulrasool
1b5cb78a51 Runtimes: tweak default configuration for Windows
Enable command line support, library evolution, vector types, file
system support, runtime function counters, and optimization remark
emission. This brings the windows runtime configuration and Darwin
to parity.
2025-05-13 20:01:18 -07:00
Evan Wilde
94e695037c Runtimes: Enable CommandLine support wholesale
CommandLine support builds on all platforms at this time. There is no
need to have a default disabling it anymore. Setting the default option
to enable it on all platforms without condition.
2025-05-13 15:58:20 -07:00
Saleem Abdulrasool
bbd26e823a Runtimes: correct CommandLineSupport build on Windows
We would fail to build the runtime with the new build with command line
support and a shared runtime. The reason for this was that
CommandLineSupport did not properly build against the headers and
attempted to import a locally defined symbol. Correct the build by
indicating that this library is compacted into the runtime.
2025-05-13 15:45:02 -07:00
Guillaume Lessard
bb67d1ef0a Merge pull request #81465 from glessard/rdar151179266-flag-in-swiftinterface
[cmake] LifetimeDependenceMutableAccessors should be enabled
2025-05-13 11:01:19 -07:00
Guillaume Lessard
23217262b2 [cmake] LifetimeDependenceMutableAccessors should be enabled 2025-05-12 18:41:50 -07:00
Saleem Abdulrasool
babfa098fc Runtimes: install the .swiftdoc interface as well
This is part of the development component for the module and is part of
the interface definition. This content is consumed by the user during
development.
2025-05-12 17:36:18 -07:00
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
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
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
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
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
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
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