Commit Graph

454 Commits

Author SHA1 Message Date
Kavon Farvardin
fc9575cda9 [NCGenerics] enable new associated type inference
The experimental-associated-type-inference flag is needed to correctly
build programs when NoncopyableGenerics is enabled.
2024-01-23 22:41:59 -08:00
Kavon Farvardin
b92fe5f2e9 [build-script] fix NoncopyableGenerics option
This patch introduces `--enable-experimental-noncopyable-generics` for
the build script. It replaces
`--swift-stdlib-experimental-noncopyable-generics`

The old build option only enables the feature when building the
stdlib, but if we've built the stdlib with NoncopyableGenerics, the
compiler should be hardwired to have that feature enabled, too.

This patch also introduces the `noncopyable_generics` lit parameter, so
that tests assuming the system was built with the feature can live
in-tree and be tested, if they specify `REQUIRES: noncopyable_generics`.
2024-01-23 22:41:59 -08:00
Allan Shortlidge
e5c6bb649c Remove support for Swift 3 @objc inference.
Obsolete the `-enable-swift3-objc-inference` option and related options by
removing support for inferring `@objc` attributes using Swift 3 rules.
Automated migration from Swift 3 has not been supported by the compiler for
many years.
2024-01-11 15:40:04 -08:00
Kavon Farvardin
29d6d6aaf0 [NCGenerics] disable mangling roundtrip checking
This is a temporary measure until I get a chance to fix the symbol
mangling. This round-tripper is exactly flagging the current
known issue in that all of the symbols get extra `Copyable` and
`Escapable` requirements mangled into them, and thus reconsituting the
type from the mangled name doesn't give you the same type back.
2024-01-10 19:37:21 -08:00
Alejandro Alonso
e37ecac163 Merge pull request #68857 from Azoy/atomics
[stdlib] Atomics
2024-01-10 12:03:08 -08:00
Slava Pestov
ab28449be7 stdlib: Don't build with -enable-experimental-associated-type-inference for now
Some CI jobs use an older toolchain, which chokes when building the stdlib
with this flag.

Fixes rdar://119895175.
2024-01-03 16:28:22 -05:00
Rokhini Prabhu
6dbf4d2e20 Add support for task-to-thread model to be specified on as part of build presets 2023-12-21 16:00:25 -08:00
Alejandro Alonso
2c0b473b8d Add Synchronization module 2023-12-18 14:01:16 -05:00
Alejandro Alonso
6d6e55a931 Apply feedback from pitch 2023-12-18 14:01:15 -05:00
Alejandro Alonso
ae983d8f84 Add Synchronization module 2023-12-18 14:01:14 -05:00
Daniel Rodríguez Troitiño
a7a8ba1108 [CMake] Add dep in add_swift_target_library_single from install component (#70490)
While `add_swift_target_library` has code to add a dependency from the
install component to the target, similar code was missing from
`add_swift_target_library_single`, probably because
`add_swift_target_library` calls `add_swift_target_library_single`, so
the extra dependency is not necessary.

However, there's usages of `add_swift_target_library_single` outside
`add_swift_target_library` which were creating targets that were not
dependencies of their install components. Some of  those cases are the
embedded stdlib targets, which are installed as part of the `stdlib`
component.

It normally does not matter when using `build-script`, because those
targets are build as part of `all`, but it does matter if one is using
CMake/Ninja directly or in cases where `build-script` is not used.
Trying to use targets like `install-stdlib` will had missed building the
embedded stdlib, and failed the installation.
2023-12-16 01:00:56 -08:00
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