Commit Graph

864 Commits

Author SHA1 Message Date
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
Ben Barham
8fbdae12fc [Build] Skip early-* on non-darwin hosts
These builds do not work outside of darwin currently. Rather than adding
the skip to all the necessary build presets, just disable in the product
instead.
2023-08-23 11:43:35 -07:00
Evan Wilde
e54b18370d Delete backdeploy concurrency library
This library served its purpose and has overstayed its welcome.
The library shipped in Xcode can't change again from the state it was
in, so changes to the sources here will not affect that library, which
is confusing. The library does not currently build due to changes in the
runtime headers, so it does not give meaningful signal to anything
anymore. If you need to test things in a backdeploy concurrency
environment, use the copy from the toolchain in Xcode as that will give
you a far clearer picture of what the code will actually be running with
than the state of the sources here did.
2023-08-20 11:01:23 -07:00
Kim de Vos
e9b316eea0 Migrate swift-syntax build script to Swift 2023-08-04 22:14:25 +02:00
swift-ci
8c05d55556 Merge pull request #67496 from kavon/no-more-pipes
No more `pipes`
2023-07-25 18:48:03 -07:00
Kavon Farvardin
b5e0f95a18 eliminate pipes in favor of shlex
This solves deprecation warnings in build-script:

```
DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
```

This change assumes that the minimum version
of Python3 is 3.3, which has `shlex.quote`.

Since our build bots currently use 3.6 as their
Python version, we can't yet use `shlex.join`
to further simplify some of the code using
quote.
2023-07-25 15:24:54 -07:00
Alastair Houghton
ca9cac4f5b Merge pull request #67386 from finagolfin/spm-revert
Revert "Revert "build: bootstrap SwiftPM with forked and not host clang""
2023-07-25 16:19:33 +01:00
Max Desiatov
bfa726017a build: handle WASI in host_specific_configuration.py 2023-07-22 13:49:10 +01:00
Butta
ae6ff02d1b Revert "Revert "build: bootstrap SwiftPM with forked and not host clang""
This reverts a3dd8d677, which should be fixed by apple/swift-package-manager#6721.
2023-07-19 07:59:53 +05:30
Max Desiatov
0a1ae45ea6 Merge pull request #61376 from apple/maxd/build-alpine-product
Currently, when building LLVM/clang on Alpine Linux, CMake toolchain file specifies incorrect `<cpu_arch>-unknown-linux-musl` target, which makes the build immediately fail. Correct target that allows building on Alpine should be specified as `<cpu_arch>-alpine-linux-musl`, with `<cpu_arch>` replaced with respective CPU platform, e.g. `aarch64`.
2023-07-18 14:05:37 +02:00
Alastair Houghton
a3dd8d6777 Revert "build: bootstrap SwiftPM with forked and not host clang" 2023-07-17 20:01:06 +01:00
Kuba Mracek
08fee9d5e6 Add arm64_32 as a valid freestanding arch 2023-07-13 09:07:18 -07:00
Max Desiatov
c1d2d8580c Use clang -print-target-triple instead of clang --version 2023-07-13 15:19:42 +01:00
Alastair Houghton
4d4b1fc151 Merge pull request #64629 from finagolfin/spm-cc
build: bootstrap SwiftPM with forked and not host clang
2023-07-12 08:59:30 +01:00
Max Desiatov
501a5daab0 build: enable handling of alpine-linux-musl triple
Currently, when building LLVM/clang on Alpine Linux, CMake toolchain file specifies incorrect `<cpu_arch>-unknown-linux-musl` target, which makes the build immediately fail. Correct target that allows building on Alpine should be specified as `<cpu_arch>-alpine-linux-musl`, with `<cpu_arch>` replaced with respective CPU platform, e.g. `aarch64`.
2023-07-05 22:13:51 +01:00
Mishal Shah
80e4e0465c Merge pull request #66530 from swift-riscv/add-riscv64-as-supported-architecture
Add riscv64 as supported architecture on linux
2023-07-03 12:19:32 -05:00
Alastair Houghton
e5ece81cc9 [Freestanding] Remove uses of stat() and dlsym().
We shouldn't be using stat() or dlsym() in the freestanding
runtime.

rdar://111214571
rdar://106555012
2023-06-23 17:05:59 +01:00
swift-ci
dc0a3c9143 Merge pull request #66652 from apple/maxd/bootstrap-bsd-cmake
swift_build_support cmake.py: allow bootstrapping CMake on FreeBSD
2023-06-14 20:30:30 -07:00
Ben Barham
e0c9aa1398 Merge pull request #66440 from bnbarham/sprinkle-utf8
[Build] Read all shell output as UTF-8
2023-06-14 17:35:11 -07:00
swift-ci
38050cde87 Merge pull request #66641 from apple/maxd/bsd-arm64
swift_build_support: support FreeBSD on arm64 in `targets.py`
2023-06-14 16:20:15 -07:00
Max Desiatov
c5d6e3ca05 swift_build_support cmake.py: allow bootstrapping CMake on FreeBSD
A given FreeBSD version may not always have latest CMake installed if any at all. Let's bootstrap it the same way we do it on Linux.
2023-06-15 00:04:39 +01:00
Max Desiatov
2dc5da0366 swift_build_support: support FreeBSD on arm64 in targets.py 2023-06-14 20:47:52 +01:00
Mike Ash
110f428780 [Runtime] Add tracing for section scans.
Section scans (for metadata, protocols, etc.) can be costly. This change adds tracing calls to those scans so we can more easily see how much time is spent in these scans and where they're initiated.

This adds an os_signpost implementation controlled by SWIFT_STDLIB_TRACING, and a default empty implementation for when that's disabled.

rdar://110266743
2023-06-14 12:07:44 -04:00
futurejones
ea330b269c add riscv64 as supported architecture on linux 2023-06-10 15:43:28 +09:00
Ben Barham
02603e37ac [Build] Read all shell output as UTF-8
Encodes the output back into ASCII as there's been issues with printing
UTF-8 in the past.

Resolves rdar://110412212.
2023-06-07 15:35:55 -07:00
Max Desiatov
bbfd410e7b swift_build_support/cmake.py: parallelize default CMake build (#66212)
CMake's bootstrapping script can't infer a number of parallel build jobs from the number of CPU cores on its own, which means that it's not parallelized by default. Let's get the value of CPU cores when `build_jobs` argument is not explicitly set.

`make -j` only has an effect on CMake's post-bootstrap build jobs, while a substantial amount of time was spent building code sequentially in CMake's bootstrap script without that `--parallelize` option, which is called on a line preceding the `make -j` invocation.
2023-05-30 22:29:15 +01:00
Alex Lorenz
5f7f5daa52 [cxx-interop] add a build setting to control whether the <swift/bridging> header is shipped with compiler
rdar://109050483
2023-05-08 15:59:38 -07:00