Commit Graph

840 Commits

Author SHA1 Message Date
Ian Anderson
5acd961347 Merge pull request #71474 from ian-twilightcoder/builtin-float-overlay
[overlay] Make an overlay for the clang _Builtin_float module
2024-02-22 12:25:54 -08:00
Kuba Mracek
8e357df938 [embedded] Fix Python lint issues in llvm.py 2024-02-20 15:20:56 -08:00
Kuba Mracek
38bcffa6ff [embedded] When copying clang builtins from host toolchain, include macho_embedded libraries 2024-02-19 14:36:19 -08:00
Ian Anderson
1ce3935eb7 [overlay] Make an overlay for the clang _Builtin_float module
Clang's builtin float.h is no longer included in OS/SDK modules, and so it needs its own overlay.

rdar://122351557
2024-02-16 12:31:47 -08:00
Yuta Saito
8e0a79dc9e test: Skip some exhaustive tests for now due to WasmKit performance
Those tests check so many input variations and take too long (hours) to
run. We can re-enable them once WasmKit is well optimized.
2024-02-07 07:32:50 +00:00
Yuta Saito
581ee4ebcc build: Run executable tests with WasmKit when available
This patch allows running executable tests with WasmKit. If WasmKit is
not built, fall back to running only non-executable tests. Also add
stdlib and Concurrency executable tests to run.
2024-02-07 07:32:50 +00:00
Yuta Saito
2b1160475f build: Add WasmKit (a Wasm runtime) product
This patch adds a new product, WasmKit, which is a Wasm runtime that is
going to be used to run executable tests targeting Wasm. Note that the
product is not shipped as a part of the toolchain, but is used only for
testing purposes.
2024-02-07 07:32:45 +00:00
Mike Ash
4bc7726d43 Merge pull request #70900 from mikeash/swift-generic-metadata-builder-out-of-process
[Tools] Add a library to build specialized generic metadata out of process.
2024-01-26 10:50:34 -05:00
Rintaro Ishizaki
810a94cd0f [CMake] Add option to perform SwiftParser validation by default
Disabled by default. We'll enable it for some build presets.

rdar://121545713
2024-01-25 22:32:22 -08:00
Mike Ash
4341102c92 [Tools] Add a library to build specialized generic metadata out of process.
This library uses GenericMetadataBuilder with a ReaderWriter that can read data and resolve pointers from MachO files, and emit a JSON representation of a dylib containing the built metadata.

We use LLVM's binary file readers to parse the MachO files and resolve fixups so we can follow pointers. This code is somewhat MachO specific, but could be generalized to other formats that LLVM supports.

rdar://116592577
2024-01-24 20:45:50 -05: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
Alex Hoppen
376e21617c Merge pull request #71042 from ahoppen/ahoppen/cross-compile-swiftformat
[build] Support cross-compilation of swift-format
2024-01-22 19:27:44 -08:00
Alex Hoppen
acad2bf251 [build] Support cross-compilation of swift-format
This should build swift-format as a fat binary containing both an x86_64 and an arm64 slice in the open source toolchains.

rdar://121326143
2024-01-21 13:45:53 -08:00
Allan Shortlidge
07a67437be Merge pull request #64656 from artemcm/LegacyDeathBed
Deprecate Legacy driver by removing incremental builds and adding warnings
2024-01-18 08:55:59 -08:00
Yuta Saito
a2256436cf Merge pull request #70511 from kateinoigakukun/katei/fix-global-executor-selection-wasm
build: Explicitly set `SWIFT_ENABLE_DISPATCH` to build Wasm stdlib
2024-01-18 14:20:23 +09:00
Artem Chikin
73b01dccfc Remove incremental builds from the Legacy driver
The C++-based driver is deprecated and this will help reduce the code surface that requires maintenance as the legacy driver is fully sunset.
2024-01-16 16:34:51 -08:00
Alejandro Alonso
e37ecac163 Merge pull request #68857 from Azoy/atomics
[stdlib] Atomics
2024-01-10 12:03:08 -08:00
Alex Hoppen
48d2797387 [swift-syntax] Verify that swift-syntax documentation builds without warnings
Companion to https://github.com/apple/swift-syntax/pull/2096
2024-01-08 16:56:11 -08:00
Alejandro Alonso
b68e864b5f Try to appease CI
more test fixes
2024-01-03 13:01:24 -05: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
Yuta Saito
7a804188e1 build: Explicitly set SWIFT_ENABLE_DISPATCH to build Wasm stdlib
Stdlib build depends on `SWIFT_ENABLE_DISPATCH` to select concurrency
global executor implementation since ed8ed32dba
2023-12-16 14:49:39 +00:00
Alex Hoppen
5b98af866f [swift-syntax] Run swift run with --vv
This should help us figure out what’s going wrong in rdar://118460218.
2023-11-15 11:07:22 -08:00
Ben Barham
9ea3146904 Merge pull request #69564 from finagolfin/early-driver
[Build] Enable building the early Swift Driver on linux with the prebuilt host toolchain
2023-11-09 14:36:27 -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
Finagolfin
a03f6e5b3a [Build] Enable building and CI testing the early Swift Driver on linux with the prebuilt host toolchain 2023-11-08 20:09:59 +05:30
Anthony Latsis
da6dff3ef5 Merge pull request #68713 from AnthonyLatsis/test-generate-xcode 2023-11-03 23:57:20 +03:00
Alex Hoppen
dc689ab07e [build] Adjustment to reflect that we re-wrote swift-syntax/format.py in Swift 2023-10-31 21:50:42 -07:00
Alex Hoppen
04f950c084 [build] Verify that SourceKit-LSP is correctly formatted
In sourcekit-lsp and swift-format, run swift-format on the sourcekit-lsp sources to make sure it’s correctly formatted.
2023-10-31 17:10:51 -07: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
Alex Hoppen
12b500878c Merge pull request #69388 from ahoppen/ahoppen/remove-swiftevolve
[build] Remove swiftevolve
2023-10-25 12:43:14 -07:00
Alex Hoppen
6a8ad4b91e [build] Remove swiftevolve
swift-evolve hasn’t been used in the recent past. @beccadax and I agreed that it doesn’t provide any value anymore to keep swift-evolve around. In Becca’s words:

> The resilience implementation is pretty stable at this point, and it never seems to have had many of the bugs that swift-evolve would have been able to shake out.
2023-10-24 18:36:59 -07:00
Yuta Saito
37d11c91e5 [wasm][build] Skip wasi-libc symbol check step to support LLVM 17 2023-10-24 00:07:28 +00:00
Yuta Saito
e1c4eceea3 [wasm][build] Build and test stdlib for WebAssembly
This patch adds a new build products to build and test the Swift stdlib
for WebAssembly.
This adds WebAssembly specific stdlib product instead of adding the new
target in `stdlib-deployment-targets` because unlike darwin platforms
Wasm target has quite different stdlib configuration from host target
and there is no way to specify different stdlib configuration for each
target in `stdlib-deployment-targets` for now.

This patch adds 1 new dependency `wasi-libc` and 3 new build products:
1. `WASILibc` - wasi-libc is a libc implementation for WebAssembly
   System Interface (WASI). This product is required to build the
   compiler runtimes and Swift stdlib.
2. `WasmLLVMRuntimeLibs` - This product builds `./runtimes` directory
   in llvm-project, which contains compiler-rt, libcxx and libcxxabi.
   This product is required to build Swift stdlib.
3. `WasmStdlib` - This product builds standalone Swift stdlib for
   WebAssembly. (Similar to `MinimalStdlib` product, but configured for
   WebAssembly target)
2023-10-23 17:34:20 +00:00
Rintaro Ishizaki
8dbde04c61 Merge pull request #68408 from rintaro/fetch-content
[CMake] Replace early swift-syntax with FetchContent
2023-09-28 11:22:10 -07:00
Anthony Latsis
17fc2d200e build-script: Don't emit build commands for LLVM when --build-llvm set to false 2023-09-23 14:10:05 +03:00
Michael Gottesman
053c276590 Merge pull request #68565 from finagolfin/dispatch
[build] Add back intermediate pipeline so that the corelibs are not built before the compiler tests are run
2023-09-19 14:59:06 -05:00
Max Desiatov
c9e633cc5a swift_build_support: fix shell.run bytes printing (#68373)
* swift_build_support: fix `shell.run` bytes printing

`output.splitlines()` returns a value of `bytes` type, not `str`, which leads to `b` prefixed to it when printing.

This led to broken output when running `update-checkout`. Before:

```
[swiftpm]                               b"Already on 'main'"
```

After:

```
[swiftpm]                               Already on 'main'
```

* swift_build_support/shell.py: use `errors='replace'` in `decode`
2023-09-19 09:25:59 +01:00
Rintaro Ishizaki
1dfc10e69a [build-script] Add back --install-swiftsyntax
'--install-swift-syntax' is now a sugar of '--install-swift
--swift-install-component=swift-syntax-lib'
2023-09-18 16:28:24 -07:00
Ben Barham
041691184c [CMake] Replace early swift-syntax with FetchContent
Use FetchContent to include swift-syntax directly in swift. This can be
thought of as an `add_subdirectory` for a directory outside the root.

The default build directory will be `_deps/swiftsyntax-subbuild/`, though
the modules and shared libraries will be built in `lib/swift/host` by
passing down `SWIFT_HOST_LIBRARIES_DEST_DIR` to avoid copying them as we
were doing previously.
2023-09-18 14:44:10 -07:00
Alex Hoppen
ce2635ba79 Merge pull request #68562 from ahoppen/ahoppen/stress-tester-and-swift-evolve
[build] Build the SourceKit stress tester and SwiftEvolve next to each other
2023-09-16 07:35:47 -07:00
Finagolfin
c4ada3326b [build] Add back intermediate pipeline so that the corelibs are not built before the compiler tests are run
This reverts 01328417e but moves libdispatch into the earlier pipeline, so that
it alone is built before the compiler validation suite is run.
2023-09-16 10:08:50 +05:30
Michael Gottesman
f13efab4f3 Merge pull request #65829 from gottesmm/rdar89046735
[build] Remove intermediate pipeline so that we can guarantee that we  always have a fresh swift-dispatch when running swift tests.
2023-09-15 22:12:57 -05:00
Alex Hoppen
68c431e54d [build] Build the SourceKit stress tester and SwiftEvolve next to each other
It doesn’t really matter but the SourceKit stress tester and SwiftEvolve share the same repo and have a very similar build architecture and they should be build next to each other by build-script.
2023-09-15 14:53:01 -07:00
Rintaro Ishizaki
466eb9a69a [build-script] Install 'earlyswiftsyntax' if 'install-swift' is off
Some build scenario (e.g. lldb) want swift-syntax libraries installed
but don't want to install "swift" compiler products.

Install 'earlyswiftsyntax' products independently when
'--install-swiftsyntax' is specified but '--install-swift' is NOT
specified.
2023-09-12 11:53:03 -07:00
Alex Hoppen
3780ccc357 [swift-syntax] Don’t pass --filecheck-exec to swift-syntax’s build script
swift-syntax no longer has lit tests, so the `--filecheck-exec` parameter isn’t needed anymore.
2023-09-06 16:43:34 -07:00
Michael Gottesman
01328417e8 [build] Remove intermediate pipeline so that we can guarantee that we always have a fresh swift-dispatch when running swift tests.
In the fullness of time, we want to split the full build-script-impl pipeline so
that we can begin moving library like products (libdispatch, foundation) from
build-script-impl into build-script. We are not there yet since some of swift's
concurrency tests have a dependency on swift dispatch being built. This breaks
the build and we need to extract those tests into a separate product. But for
now, this makes sense to repair the build.

rdar://89046735
2023-09-05 11:40:09 -07:00
Rintaro Ishizaki
9017ef51ce [CMake] Update for review comments 2023-08-25 21:58:38 +00:00
Rintaro Ishizaki
9c9010e5b7 [CMake] Support Macros in Linux
For compiling codes required for macro support, we now need swiftc
compiler in the build machine.

Unlike Darwin OSes, where swiftCore runtime is guaranteed to be present
in /usr/lib, Linux doesn't have ABI stability and the stdlib of the
build machine is not at the specific location. So the built compiler
cannot relies on the shared object in the toolchain.
2023-08-24 17:04:15 +00:00