Commit Graph

433 Commits

Author SHA1 Message Date
Allan Shortlidge
78cd1149bd stdlib: Adopt ExtensionImportVisibility experimental feature.
This didn't expose any missing imports in the sources of any of the standard
library modules, but that's not entirely surprising. Still, we should have the
feature enabled to test it and prevent regressions from creeping in before the
behavior becomes the default.

Exclude `ExtensionImportVisibility` from module interfaces.
2024-04-05 09:22:02 -07:00
Kavon Farvardin
30983530b6 NCGenerics: introduce SuppressedAssociatedTypes
The model for associated types hasn't been fully worked-out for
noncopyable generics, but there is some support already that is being
used by the stdlib for an internal-only (and rather cursed) protocol
`_Pointer` to support `UnsafePointer`, etc.

This patch gates the existing experimental support for associated types
behind a feature flag. This flag doesn't emit feature-guards in
interfaces, since support for it is tied closely to NoncopyableGenerics
and has been there from its early days.
2024-04-02 16:53:36 -07:00
Eric Miotto
93d64e973d Merge pull request #72590 from edymtt/edymtt/no-darwin-binary-swiftmodule-in-toolchain
Do not install binary swiftmodule for Darwin
2024-03-28 09:22:32 -07:00
Allan Shortlidge
2813fbe309 Frontend: Introduce an alias for the NoncopyableGenerics experimental feature.
The `.swiftinterface` of the standard library must remain compatible with some
older compilers. Unfortunately, some of those older compilers do not allow the
experimental feature `NoncopyableGenerics` to be enabled in production. To
allow the stdlib to build with non-copyable generics enabled and still have the
older compilers consume its interface, we have to use a new experimental
feature identifier that they do not know about.

Partially resolves rdar://125138945
2024-03-27 22:20:25 -07:00
Eric Miotto
0cac358fe5 Do not install binary swiftmodule for Darwin
This is needed to support Apple internal configurations that would fail
consuming such binary swiftmodule (but work as expected when rebuilding
from the swiftinterface).

Addresses rdar://124390643
2024-03-27 10:56:55 -07:00
Eric Miotto
649618dc36 Remove duplicate call to install() for stdlib modules
Also amend the installation code handling macCatalyst to match the one
for regular swiftmodules.
2024-03-26 09:48:36 -07:00
Doug Gregor
922e3daaea Remove build infrastructure for globally enabling noncopyable types
Now that the compilation model of noncopyable types is enabled everywhere,
and one can enable the feature for specific modules, we no longer need a
separate build-script/CMake option to enable it globally. Remove it all.
2024-03-19 13:35:31 -07:00
Kavon Farvardin
76c6510519 Merge pull request #72276 from kavon/ncgenerics-xfails-3 2024-03-16 04:18:35 -07:00
eeckstein
9504de5ed7 Merge pull request #71552 from finagolfin/cross-compile
[CMake] Add broader support for cross-compiling the portions of the compiler that are written in Swift to non-Darwin Unix
2024-03-15 16:28:38 +01:00
Kavon Farvardin
149c052ec5 use new noncopyable types infrastructure
The infrastructure underpinning the new feature NoncopyableGenerics is
mature enough to be used.
2024-03-14 23:10:44 -07:00
Arnold Schwaighofer
7196c9c9ea Merge pull request #72296 from aschwaighofer/build_config_fix_fragile_resilient
Don't set enable-library evolution under SWIFT_STDLIB_USE_FRAGILE_RESILIENT_PROTOCOL_WITNESS_TABLES
2024-03-13 15:28:06 -07:00
Arnold Schwaighofer
2bd3feeeee Don't set enable-library evolution under SWIFT_STDLIB_USE_FRAGILE_RESILIENT_PROTOCOL_WITNESS_TABLES
Rather, for the purpose of testing set this under an individual build
preset configuration.
2024-03-13 10:27:40 -07:00
Arnold Schwaighofer
315a763c28 Merge pull request #72218 from aschwaighofer/fragile_resilient_protocols
IRGen: Add code to support building fragile resilient protocol witnesses
2024-03-13 08:40:44 -07:00
Arnold Schwaighofer
9639e007d8 Teach TBD that in fragile resilient protocol mode the protocol table is visible 2024-03-11 09:49:38 -07:00
Arnold Schwaighofer
ea70aea43c IRGen: Add code to support building fragile resilient protocol witnesses
We don't currently support building resilient relative protocol witness tables.
One might want to build with relative witness tables but not need
resilient protocols. Allow for that scenario.

Add a test configuration to test library-evolution + fragile resilient
protocols + relative protocol witness tables.
2024-03-10 09:14:08 -07:00
Slava Pestov
123045f825 Merge pull request #71780 from slavapestov/remove-non-experimental-assoc-type-inference
Remove old associated type inference implementation
2024-03-07 22:14:06 -05:00
Slava Pestov
af8c8f1671 Sema: Remove non-experimental associated type inference 2024-03-07 17:30:17 -05:00
Meghana Gupta
f3a85b118f Add build-script option and lit config for nonescapable_types
With this build-script has a flag --enable-experimental-nonescpable-types=1
to enable this feature in stdlib.

Also we can now add // REQUIRES: nonescapable_types to tests which run only when
the compiler is built with this feature turned on.
2024-03-06 21:57:03 -08:00
Xi Ge
834ade5f99 cmake: avoiding generating ABI baseline files when building stdlib
We have a regression test checked in the compiler repository to detect ABI breakges as the
stdlib evolves, therefore we don't need to generate these side car files for ABI checking
purposes that could be potentially done externally.

Related to: rdar://118465899
2024-02-29 11:36:57 -08:00
Saleem Abdulrasool
4b1deb09be Merge pull request #69908 from finagolfin/droid
[android] Update to LTS NDK 26c
2024-02-28 14:24:01 -08:00
Finagolfin
09ef130457 [android] Update to LTS NDK 26c
NDK 26 renamed the directory in which it places the Android compiler-rt from
`lib64/`, and added a bunch of nullability annotations to the Bionic libc.
2024-02-28 22:11:38 +05:30
Saleem Abdulrasool
c355611801 Android: always build libraries as PIC
This adjusts the stdlib bits to be built as position independent. As we
build a single instance of the code and then create static and dynamic
runtimes, simply pay a penalty when performing static linking of the
runtime to make the dynamic case work properly. This repairs part of the
runtime build on Android where we would previously see when building
SwiftRemoteMirror:

```
ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'construction vtable for std::__ndk1::basic_istream<char, std::__ndk1::char_traits<char>>-in-std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'construction vtable for std::__ndk1::basic_istream<char, std::__ndk1::char_traits<char>>-in-std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'VTT for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'VTT for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(swift::reflection::TypeRefBuilder::ReflectionTypeDescriptorFinder::collectFieldTypes(std::__ndk1::optional<std::__ndk1::basic_string<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>>)) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::basic_stringbuf<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'VTT for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'VTT for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(non-virtual thunk to std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: relocation R_AARCH64_ADD_ABS_LO12_NC cannot be used against symbol 'vtable for std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>'; recompile with -fPIC
>>> defined in lib/swift/android/aarch64/libswiftRemoteInspection.a(TypeRefBuilder.cpp.o)
>>> referenced by TypeRefBuilder.cpp
>>>               TypeRefBuilder.cpp.o:(non-virtual thunk to std::__ndk1::basic_stringstream<char, std::__ndk1::char_traits<char>, std::__ndk1::allocator<char>>::~basic_stringstream()) in archive lib/swift/android/aarch64/libswiftRemoteInspection.a

ld.lld: error: too many errors emitted, stopping now (use --error-limit=0 to see all errors)
```
2024-02-27 14:47:16 -08:00
Finagolfin
fcf7614638 [CMake] Add broader support for cross-compiling the portions of the compiler that are written in Swift to non-Darwin Unix
Add cross-compilation flags for the newly added Swift source in `lib/ASTGen/`,
similar to how `SwiftCompilerSources/` is already cross-compiled for other
platforms. Make sure the Swift source in the compiler builds and links against
`SWIFTLIB_DIR` in this cross-compilation build directory, not the one that comes
with the native host compiler.

This requires changing the dependency chain in `CROSSCOMPILE` mode, as normally
the Swift compiler is built first when building natively for the host, then it's
used to build the stdlib. However, when cross-compiling the toolchain, the stdlib
must be cross-compiled first by the host compiler, then the portions of the
Swift compiler written in Swift must be cross-compiled with that new stdlib. All
these dependency changes simply change that compilation order when cross-compiling,
including removing the dependency that the Swift compiler is built before the
stdlib when cross-compiling the Swift compiler.

All changes in this pull are gated on the `CROSSCOMPILE` mode, so they will
not affect any of the existing CI or build presets.
2024-02-13 12:24:24 +05:30
Kavon Farvardin
ee12fd6655 NCGenerics: reenable round-trip for mangling 2024-02-06 08:15:26 -08:00
Evan Wilde
5f8da9e977 Merge pull request #71348 from etcwilde/ewilde/protect-the-dependents
Protect the `add_dependencies` calls against non-existent targets
2024-02-02 16:11:33 -08:00
Evan Wilde
5cb3285c92 Protect the dependent
The install target is sometimes the `None` target, which doesn't
actually exist. This should perhaps be spelled `never_install` instead,
but given that these are random names, we should protect the
`add_dependencies` calls to only accept install components that actually
exist.
2024-02-02 10:50:14 -08:00
Michael Gottesman
42a4d2d0cd Merge pull request #71236 from gottesmm/pr-213cb762cfa24a27de8dc40f5c2929451d1825cb
[stdlib] Add an option SWIFT_STDLIB_ENABLE_STRICT_CONCURRENCY_COMPLETE to enable building the stdlib with strict-concurrency=complete.
2024-01-31 11:20:32 -08:00
Michael Gottesman
2db4b5ca52 [stdlib] Add an option SWIFT_STDLIB_ENABLE_STRICT_CONCURRENCY_COMPLETE to enable building the stdlib with strict-concurrency=complete.
It is currently by default off.
2024-01-29 21:21:05 -08:00
Saleem Abdulrasool
1864caad5e build: migrate to CMake based build of swift-format
This allows us to build swift-format with dynamic linking against the
toolchain build of the swift-syntax and swift-argument-parser packages.
Wire up the swift-markdown build and hoist the swift-format build prior
to sourcekit-lsp. This sets us up for supporting swift-format based
formatting in the LSP.
2024-01-26 15:51:29 -08:00
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