Commit Graph

272 Commits

Author SHA1 Message Date
Max Desiatov
f4937efcbe [NFC] fix option description typo in StdlibOptions.cmake
`Concurrency require libdispatch` -> `Concurrency requires libdispatch`
2023-05-31 15:22:23 +01:00
Dario Rexin
e18d71c2ad [Build] Only require libdispatch source on non-Darwin (#66081) 2023-05-23 13:17:14 -07:00
Max Desiatov
5275255d58 Move SWIFT_CONCURRENCY_USES_DISPATCH to StdlibOptions.cmake
It is only used in the stdlib build, so really has no business being set in the root `CMakeLists.txt`.
2023-05-10 19:36:27 +01:00
Egor Zhdan
14f32312bf [cxx-interop] Do not add a dependency on clang to CxxStdlib
Cxx & CxxStdlib modules are Swift-only, they do not require invoking clang directly.

When building with `SWIFT_INCLUDE_TOOLS=NO`, Clang is not available as a CMake target (see `swift_common_standalone_build_config`).

rdar://107780733
2023-04-11 16:45:39 +01:00
Evan Wilde
e5bbffc38b Handle catalyst interface swap
Need to swap out the private interface for catalyst builds.
2023-04-03 15:48:44 -07:00
Alastair Houghton
316dfaffa1 Merge pull request #64714 from al45tair/eng/PR-107360391
[Backtracing] Support specifying a hard-coded path for swift-backtrace.
2023-03-30 18:28:48 +01:00
Alastair Houghton
0261a29fee [Backtracing] Support specifying a hard-coded path for swift-backtrace.
Add a way to disable dynamic lookup of the backtracer path, for situations
where a hard-coded path makes more sense.

rdar://107360391
2023-03-29 15:08:48 +01:00
Evan Wilde
14956ef82b Build private swift interface files from stdlib
We have various pieces of SPI that are getting used in tests that are
failing occasionally. The swiftmodule file has the SPI, so if the
compiler loads from the swiftmodule file, everything works fine. If the
compiler loads the interface from the swiftinterface file, it fails to
find the `startOnMainActor` declaration.
2023-03-23 10:45:04 -07:00
Alejandro Alonso
09b1476ddf Stop building Reflection 2023-03-14 11:49:38 -07:00
Arnold Schwaighofer
49332f8b81 Fix the minimal/lto configuration
We need to disable opaque pointers when we compiler the runtime the
linker complains:

```
  ld: Opaque pointers are only supported in -opaque-pointers mode
```

Alternatively, we could pass the opaque-pointers flag to the linker but
then it would complain about the swiftc generated files which still use
typed pointers.
Until swiftc is fixed, disable opaque pointers for .cpp runtime files.

rdar://106515243
2023-03-09 13:27:34 -08:00
Egor Zhdan
947eefbdda Merge pull request #64187 from Azoy/no-more-sp
[CMake] Always disable string processing import
2023-03-08 09:37:43 +00:00
Alejandro Alonso
8417886b0a Always disable string processing import 2023-03-07 15:00:28 -08:00
Kuba (Brecka) Mracek
8d7c11536c Avoid using separate '-D' + '...' flags in CFLAGS in CMake (#63706) 2023-03-07 14:33:15 -08:00
Alastair Houghton
b9800fda43 Merge pull request #64102 from al45tair/backtracing/full-extra-shims
[Backtracing] Build work.
2023-03-06 20:54:27 +00:00
Evan Wilde
2785d18061 Enable swift color diagnostics in stdlib
I want pretty colors. I will have my pretty colors. :)
2023-03-04 23:40:13 -08:00
Alastair Houghton
1258d45152 [Backtracing] Build work.
Additional shimming required for some builds, as well as a few other build
related tweaks.

rdar://106234311
2023-03-04 15:46:30 +00:00
Alastair Houghton
9c3ea84acf [Backtracing] Disable implicit imports for executable builds.
Implicit imports were off for library builds already, but we need them off
for executable builds too, otherwise we have problems with _StringProcessing.
2023-03-04 08:00:09 +00:00
Alastair Houghton
3ec2e6723d [Backtracing] Really only build for OS X.
Added some extra code to AddSwiftStdlib.cmake so executable targets can
specify target SDKs the same way libraries currently can.

Updated the Backtracing targets to specify just OS X for now.
2023-03-04 08:00:09 +00:00
Alastair Houghton
eb38d80655 [Backtracing] Fix Windows build.
While I was doing this, it turns out Saleem was fixing things to avoid
having to patch the Windows include directories, which is awesome but
necessitates an extra change to the backtracing stuff to make the build
not fail on Windows.

rdar://105409147
2023-03-04 08:00:09 +00:00
Alastair Houghton
44783e72c6 [Frontend] Add support for implicit import of _Backtracing
Once the API has gone through Swift Evolution, we will want to implicitly
import the _Backtracing module.  Add code to do that, but set it to off
by default for now.

rdar://105394140
2023-03-04 08:00:06 +00:00
swift-ci
8dac45ed0d Merge pull request #63725 from phausler/pr/observation
Observation and associated macros
2023-03-02 18:02:14 -08:00
Alastair Houghton
aaa9d6c84d Fix accidental duplication of library names.
In AddSwiftStdlib.cmake, we're adding library names twice for target
executables, once with the path and once without.  This appears to break
things on Windows when building the SDKs.

rdar://106104132
2023-03-01 21:42:21 +00:00
Saleem Abdulrasool
2626f23bf5 Merge pull request #63880 from compnerd/development-vfs
stdlib: remove VS injection for Swift development
2023-03-01 09:09:55 -08:00
Alastair Houghton
60ededb0bf [Backtracing] Accumulate lipo inputs per-sdk.
`THIN_INPUT_TARGETS` needed to be reset per-sdk, not just once.

rdar://105390807
2023-03-01 07:49:56 +00:00
Alastair Houghton
2015c8a91e [Backtracing] Fix a bug in the CMake script that resulted in clashing targets.
I missed off an `${sdk}` in the target name for the lipo'd output :-(

rdar://105390807
2023-02-28 22:18:14 +00:00
Alastair Houghton
69ef2e7be1 [Backtracing] Add support for building target executables into libexec.
We're going to add a program, `swift-backtrace`, that gets built alongside the
stdlib and the runtime, and that needs to be installed in libexec/swift
alongside the libraries in lib/swift.

It wants to be built with the stdlib/runtime because there's an internal
interface between `swift-backtrace` and the runtime, so the program needs to
stay in lock-step with the runtime library.

rdar://105390807

(This reverts commit f042ca043680972e33c856bd69f6ecbcdd91f47a.)
2023-02-28 22:16:21 +00:00
Arnold Schwaighofer
f042ca0436 Revert "[Backtracing] Add support for building target executables into libexec." 2023-02-28 10:02:30 -08:00
Saleem Abdulrasool
4075d706a2 stdlib: remove the dependency on the injected modules
Inject the necessary module maps and apinotes via the VFS.  This cleans
up the developer build in preparation for a secondary change to remove
this need for deployed scenarios as well.  Injecting the content via the
VFS will enable us restore the ability to work with a pristine
installation of Visual Studio, dropping the custom action for the Swift
installer, and open the pathway to per-user installation of Swift.

Thanks to @bnbarham for the help and discussion in resolving the test
issues.
2023-02-28 09:40:51 -08:00
Philippe Hausler
8a7f6009b9 Initial draft of observation 2023-02-27 17:09:00 -08:00
Alastair Houghton
f68c4b40f3 Add support for building target executables into libexec.
We're going to add a program, `swift-backtrace`, that gets built alongside
the stdlib and the runtime, and that needs to be installed in libexec/swift
alongside the libraries in lib/swift.

It wants to be built with the stdlib/runtime because there's an internal
interface between `swift-backtrace` and the runtime, so the program needs
to stay in lock-step with the runtime library.

rdar://105390807
2023-02-13 20:04:37 +00:00
Arnold Schwaighofer
e12130c19c Add swift-async-frame-pointer=never when relative protocol witness tables is on
Building a static library in debug does not work when using
swift-async-frame-pointer.
2023-02-01 07:12:49 -08:00
Arnold Schwaighofer
770648f161 Initial runtime changes to support relative protocol witness tables 2023-01-31 10:59:37 -08:00
Alejandro Alonso
c7a9360806 [Reflection] Build the _Runtime and Reflection modules (#62973)
* Move Runtime into _Runtime

Fix more _Runtime names

* Add availability to all API

* Build _Runtime and Reflection modules

* Use threading's mutex for all platforms

add stdlib include
2023-01-17 09:30:16 -08:00
Evan Wilde
e88e947272 Merge pull request #62712 from etcwilde/ewilde/zipping-zippers-zip
Add zippering support
2023-01-03 21:45:33 -08:00
Kuba (Brecka) Mracek
e9d1d3096a Stop using SWIFT_STDLIB_SINGLE_THREADED_CONCURRENCY under SWIFT_STDLIB_TASK_TO_THREAD_MODEL_CONCURRENCY (#62735)
Using single-threaded concurrency was a temporary solution, now that the task-to-thread model actually supports multiple threads, let's switch off of it. Instead, let's introduce a "global executor none" option (implicitly set under the task-to-thread model) to denote that the concurrency model is not using a global executor.

rdar://99448771
2023-01-03 15:24:57 -08:00
Evan Wilde
6ab641e95d Add zippering support
Upstream build system zippering support.

Setting the `SWIFT_ENABLE_MACCATALYST` flag will build the compatibility
libraries with zippering enabled.

Note that AppleClang and LLVM Clang use different flags to write
zippered files. The Swift stdlib build doesn't know what clang we're
using, so we can't ask it for the compiler ID to determine which whether
we're using AppleClang or LLVM clang, hence the nasty `execute_process`
trick to figure out whether the compiler that's actually compiling the
stdlib knows about the flag or not.
2022-12-20 11:05:26 -08:00
Egor Zhdan
42c7ce1a34 [cxx-interop] NFC: Remove unused CMake build logic 2022-12-08 11:22:34 +00:00
Egor Zhdan
c2c3ea7e07 [cxx-interop] Make Cxx Swift library static
Instead of a dynamic `swiftCxx.dylib` library, let's build a static library to simplify backdeployment and reduce potential compatibility difficulties in the future.

This also adds `NO_LINK_NAME` option to `add_swift_target_library` to prevent the CMake scripts from passing `-module-link-name` to swiftc when building a given module. This fixes linker errors, which would otherwise occur due to the force-load symbol name (`_swift_FORCE_LOAD_$xyz`) being emitted for the libraries that are now static (`swiftCxx`, `swiftstd`).
2022-12-07 12:37:25 +00:00
eeckstein
cd47e7ff98 Merge pull request #61921 from mhjacobson/freebsd-fix-bootstrapped-build
build: support bootstrapped build on FreeBSD
2022-11-10 15:45:07 +01:00
Matt Jacobson
61cf0970a1 build: support bootstrapped build on FreeBSD
Fixes failures to link and run the bootstrapping1 compiler.
2022-11-03 17:34:26 -04:00
Stephen Canon
33d178cf60 Merge pull request #59623 from rxwei/cherry-42611 (#61793)
* Merge pull request #59623 from rxwei/cherry-42611

* Fixup switch.swift test from bad merge.

Co-authored-by: Richard Wei <rxrwei@gmail.com>
2022-11-02 14:02:16 -04:00
Kuba (Brecka) Mracek
6f77e8bb70 Split out SWIFT_ENABLE_REFLECTION into a separate SWIFT_STDLIB_REFLECTION_METADATA CMake flag to control whether stdlib is built with reflection metadata or not (#61496) 2022-10-13 17:26:25 -07:00
Eric Miotto
2d3cb3c5e1 Sign executables for target Apple platforms with a post build event (#61458)
...instead of using ad hoc targets.

This way executables are already signed before running tests, and this
will happen even if users want to test manually with `lit.py`.

Addresses rdar://66654434
2022-10-06 12:25:32 -07:00
Alexis Laferrière
6d5e01ef35 Merge pull request #61184 from xymus/default-require-explicit-avail-reland
[Sema] Require explicit availability on public modules (Landing again after we held it back)
2022-10-03 17:14:52 -07:00
Anthony Latsis
448c41185d Merge pull request #61289 from AnthonyLatsis/migrate-stdlib-to-gh-issues
Gardening: Migrate stdlib sources to GH issues
2022-09-28 05:12:28 +03:00
Eric Miotto
fc2d621f6f Merge pull request #60995 from edymtt/remove-redundant-arch-argument-in-darwin
Don't add `-arch` explictly to stdlib compile flags on Darwin
2022-09-27 07:35:42 -07:00
Anthony Latsis
c731089068 Gardening: Migrate stdlib sources to GH issues 2022-09-26 06:30:49 +03:00
buttaface
c4c48c0e84 [android] Update to LTS NDK 25b (#60938)
Also, remove `SWIFT_ANDROID_NDK_CLANG_VERSION` and just extract the
resource directory from the NDK using `file(GLOB)`.
2022-09-21 10:46:29 -07:00
Alexis Laferrière
875c0a0d41 [cmake] Ignore required explicit availability in Swift stdlib 2022-09-19 09:06:37 -07:00
Alexis Laferrière
20fb48167f Revert "[cmake] Ignore required explicit availability in Swift stdlib"
This reverts commit 4bec9d54e7.
2022-09-16 09:49:59 -07:00