Commit Graph

443 Commits

Author SHA1 Message Date
Rokhini Prabhu
ed8ed32dba Clean up Concurrency build system so that all the logic around choice of
which executor for which type of setting, is consolidated and we have a
single knob we use to determine when to use dispatch as our global
executor.

Radar-Id: rdar://problem/119416196
2023-12-13 16:09:51 -08:00
Ian Anderson
35eb5cb7f4 Merge pull request #69707 from ian-twilightcoder/builtin-flag
[ClangImporter] Swift needs to pass `-Xclang -fbuiltin-headers-in-system-modules` for its module maps that group cstd headers
2023-12-12 11:35:17 -08:00
Slava Pestov
4bf0cc2490 Always build the stdlib with -enable-experimental-associated-type-inference 2023-12-10 11:21:35 -05:00
Ian Anderson
94e860e795 [ClangImporter] Swift needs to pass -Xclang -fbuiltin-headers-in-system-modules for its module maps that group cstd headers
Swift has some module maps it overlays on Linux and Windows that groups all of the C standard library headers into a single module. This doesn’t allow clang and C++ headers to layer properly with the OS/SDK modules. clang will set -fbuiltin-headers-in-system-modules as necessary for Apple SDKs, but Swift will need to pass that flag itself when required by its module maps.
2023-12-08 22:33:12 -08:00
Rintaro Ishizaki
f327bf7616 [CMake] Correct dependencies
HeaderDependencies.cpp and the stdlib filelist didn't have dependencies.
That causes issues when the content is changed.
2023-11-16 13:54:14 -08:00
Eric Miotto
3d71dbb04b CMake: allow to only build Core and Onone when building the stdlib (#69747)
This is needed for some Apple internal configurations that needs to build the
standard library in pieces to construct an SDK.
Given the limited audience, only introduce this flag in CMake.

Addresses rdar://118178539
2023-11-09 14:06:42 -08:00
Mike Ash
967c5c6a75 Merge pull request #69542 from mikeash/retain-release-override-optional
[Runtime] Add option to remove override point for retain/release.
2023-11-08 19:51:29 -05:00
Egor Zhdan
f8b5143573 [build] Respect DEPLOYMENT_VERSION_{IOS|TVOS|WATCHOS} for Swift sources
See https://github.com/apple/swift/pull/69512

rdar://117699474
2023-11-06 16:20:24 +00:00
Mike Ash
6606850232 [Runtime] Add option to remove override point for retain/release.
Add a `SWIFT_STDLIB_OVERRIDABLE_RETAIN_RELEASE` CMake option. When set to true, swift_retain/release and the other functions in InstrumentsSupport.h can be overridden by setting the appropriate global function pointer, as is already the case. When set to false, those function pointers are removed and the functions always go into the default implementation.

Set `SWIFT_STDLIB_OVERRIDABLE_RETAIN_RELEASE` to false when building the minimal stdlib, and set it to true otherwise by default.

rdar://115987924
2023-10-31 15:26:01 -04:00
Egor Zhdan
e192ee24d1 [build] Respect DEPLOYMENT_VERSION_OSX for Swift-only targets
The CMake flag `DEPLOYMENT_VERSION_OSX` is currently only passed to the C compiler. This change makes sure it is also passed to the Swift compiler, e.g. when building Swift-only targets like Cxx or CxxStdlib.

rdar://117699474
2023-10-30 19:22:02 +00:00
Kavon Farvardin
3da894d704 [NoncopyableGenerics] provide stdlib build option
This helps set the stage for getting the stdlib building
correctly with `NoncopyableGenerics` enabled. Disabled by
default for now so this is an NFC.
2023-10-25 09:27:36 -07:00
Ben Barham
360c5d8465 Merge remote-tracking branch 'origin/main' into 20231019-merge-main
Conflicts:
  - `lib/AST/TypeCheckRequests.cpp` renamed `isMoveOnly` which requires
    a static_cast on rebranch because `Optional` is now a `std::optional`.
2023-10-19 16:16:23 -07:00
Eric Miotto
03c490cc11 [CMake] add option to generate API descriptors for the standard library (#69228)
This would be needed to stop using `swift-api-extract` in some
internal configurations.

Given the limited scope, only add this as a CMake flag.

Addresses rdar://117019309
2023-10-18 07:23:27 -07:00
swift-ci
36242019b3 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-12 03:55:00 -07:00
Alastair Houghton
801b970012 [Build] Fix dependency problems when bootstrapping.
If we're bootstrapping *and* skip-early-swiftsyntax is enabled, the
build can fail while trying to build target executables because we
haven't built a copy of libswiftCore yet but *the compiler* refers
to it.

This is "fixed" in other places by setting LD_LIBRARY_PATH, but we
don't want or need to do that here; we just want to delay building
these executables until after libswiftCore is available.

rdar://116485713
2023-10-10 11:22:21 +01:00
swift-ci
e6eb30a186 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-06 00:41:18 -07:00
Alastair Houghton
7b7f77eeaa [Linux] Enable frame pointers when building Swift libraries.
Turn on frame pointers for the Swift runtime libraries.  This makes
backtraces that go through the runtimes more reliable without having
to parse DWARF data.

rdar://116112040
2023-10-05 16:11:20 +01:00
swift-ci
75ce2f5734 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-03 07:13:54 -07:00
Kuba (Brecka) Mracek
75838507d8 Merge pull request #68929 from kubamracek/embedded-sdk3
[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 3
2023-10-03 07:02:19 -07:00
swift-ci
47af09c487 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 19:34:47 -07:00
Kuba (Brecka) Mracek
61be59948f Merge pull request #68786 from kubamracek/embedded-no-swiftinterface
[embedded] Do not emit .swiftinterface files for fragile modules (embedded stdlib, Cxx.swiftmodule)
2023-10-02 19:34:16 -07:00
Kuba Mracek
d579c62fee [embedded] Resolve empty -sdk path warning in embedded stdlib build, take 3 2023-10-02 17:55:02 -07:00
swift-ci
a230c675b6 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 13:55:10 -07:00
Kuba Mracek
268a1e3556 Revert "[embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2"
This reverts commit a1a48b5c83.
2023-10-02 09:35:21 -07:00
swift-ci
bc6aa1f8d5 Merge remote-tracking branch 'origin/main' into rebranch 2023-10-02 09:14:11 -07:00
Alastair Houghton
8ca43141c7 Merge pull request #68826 from al45tair/eng/PR-115278959
[Linux] Provide a statically linked swift-backtrace binary.
2023-10-02 16:57:19 +01:00
swift-ci
e565849dd4 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-29 12:58:02 -07:00
Alastair Houghton
9d5ce542bc [Linux] Make sure we link with swiftrt on ELF/COFF platforms.
This was causing `swift-backtrace` to crash when linked with the static
version of the runtime, because the runtime then couldn't locate any of
the necessary metadata.

rdar://115278959
2023-09-29 16:18:53 +01:00
Alastair Houghton
2efd1beabe [Linux] Provide a statically linked swift-backtrace binary.
This adds a new binary, `swift-backtrace-static`, to the build.  The runtime
will not by default use this binary as the backtracer, but if you want to
statically link your own binaries against the standard library you can copy
`swift-backtrace-static` rather than `swift-backtrace` alongside your binary,
naming it `swift-backtrace`, and the runtime should find and use it, which
will mean you don't need to have `libswiftCore.so` et al installed.

rdar://115278959
2023-09-28 18:18:39 +01:00
Kuba Mracek
a1a48b5c83 [embedded] Resolve empty -sdk path warning in embedded stdlib build, take 2 2023-09-28 09:17:32 -07:00
swift-ci
81e60b06da Merge remote-tracking branch 'origin/main' into rebranch 2023-09-28 04:14:09 -07:00
Kuba Mracek
0962d826b3 Revert "[embedded] Resolve empty -sdk path warning in embedded stdlib build"
This reverts commit 1b1db053d5.
2023-09-27 23:10:31 -07:00
swift-ci
584efa63bb Merge remote-tracking branch 'origin/main' into rebranch 2023-09-27 21:15:09 -07:00
Kuba Mracek
1b1db053d5 [embedded] Resolve empty -sdk path warning in embedded stdlib build 2023-09-27 14:50:25 -07:00
Kuba Mracek
3cacb3659d [embedded] Do not emit .swiftinterface files for fragile modules (embedded stdlib, Cxx.swiftmodule) 2023-09-26 17:59:19 -07:00
swift-ci
5a9893a62a Merge remote-tracking branch 'origin/main' into rebranch 2023-09-20 14:34:28 -07:00
Rintaro Ishizaki
b5f44debfc Merge pull request #68646 from rintaro/cmakestdlib-filelist 2023-09-20 05:48:14 -07:00
swift-ci
555c15594b Merge remote-tracking branch 'origin/main' into rebranch 2023-09-20 00:55:11 -07:00
Matt Jacobson
fc7d590a15 build: on FreeBSD, set the rpath of built stdlib dylibs to $ORIGIN (#62334) 2023-09-20 08:41:25 +01:00
Rintaro Ishizaki
18d791ccfd [CMake] Avoid add_custom_command output being used from multiple target
without a target. Because Xcode generator  doesn't like it.
Use add_custom_command_target instead.
2023-09-19 16:58:12 -07:00
swift-ci
7d8091fe2e Merge remote-tracking branch 'origin/main' into rebranch 2023-09-18 12:14:41 -07:00
Kuba Mracek
ae2e903574 [embedded] Build an initial embedded Swift standard library
This isn't a "complete" port of the standard library for embedded Swift, but
something that should serve as a starting point for further iterations on the
stdlib.

- General CMake logic for building a library as ".swiftmodule only" (ONLY_SWIFTMODULE).
- CMake logic in stdlib/public/core/CMakeLists.txt to start building the embedded stdlib for a handful of hardcoded target triples.
- Lots of annotations throughout the standard library to make types, functions, protocols unavailable in embedded Swift (@_unavailableInEmbedded).
- Mainly this is about stdlib functionality that relies on existentials, type erasure, metatypes, reflection, string interpolations.
- We rely on function body removal of unavailable functions to eliminate the actual problematic SIL code (existentials).
- Many .swift files are not included in the compilation of embedded stdlib at all, to simplify the scope of the annotations.
- EmbeddedStubs.swift is used to stub out (as unavailable and fatalError'd) the missing functionality.
2023-09-16 12:38:46 -07:00
swift-ci
37368c2b49 Merge remote-tracking branch 'origin/main' into rebranch 2023-09-15 16:58:37 -07:00
Rintaro Ishizaki
a182bdf584 [CMake] Update source file list only if different
Use 'copy_if_different' instead of 'file(GENERATE'. Somehow
'file(GENERATE' failed with

  CMake Error: Files to be generated by multiple different commands:
2023-09-15 13:46:49 -07:00
Rintaro Ishizaki
b888abfd38 [CMake] Update source file list only if different
Write source file list using 'file(GENERATE' so that they are updated
only if thier content is changed. Otherwise stdlib modules are rebuild
everytime cmake configuration happens.
2023-09-15 10:37:40 -07:00
Rintaro Ishizaki
ca41171be5 [CMake] Copy '.private.swiftinteface' to swift_static.
'.private.swiftinterface' should be a part of the module. And it's
declared as `OUTPUT` file list, but they were never created. Because of
that the target was always rebuilt.
2023-09-15 10:35:16 -07:00
Sophia Poirier
86d368f364 Merge remote-tracking branch 'upstream/main' into fix-rebranch-automerger 2023-08-31 14:10:52 -07:00
Ben Barham
afd3f172cb [stdlib] Set PYTHONIOENCODING when building the stdlib
Ubuntu 18.04 seems to be defaulting to 'ascii', causing an error when
using line-directive combined with the utf-8 diagnostic output used when
early swift syntax is enabled.
2023-08-30 11:41:11 -07:00
swift-ci
484684f0dd Merge remote-tracking branch 'origin/main' into rebranch 2023-08-29 17:55:14 -07:00
Rintaro Ishizaki
0aa0aac72e [CMake] Always use builder's runtime for building Swift code in Linux
Some non-stdlib thing e.g. swift-backtrace still might be built before
the runtime is built. For building Swift code in Linux "hosttools",
always set 'LD_LIBRARY_PATH' to the runtime in the builder.
2023-08-29 16:36:24 +00:00