Commit Graph

864 Commits

Author SHA1 Message Date
Rintaro Ishizaki
89e9622402 [build-script] Always clean 'SwiftTesting' and 'SwiftTestingMacros'
These products are built with CMake. In incremental build environments,
these products don't detect compiler changes, so the artifacts aren't
rebuilt unless the source code of these projects are changed.
To workaround that, always clean them in build-script to ensure they are
rebuilt.

rdar://135021207
2024-08-30 11:30:47 -07:00
Ben Langmuir
ad82d86041 Bump the deployment target for the compiler to macOS 13.0
Bump the deployment target from macOS 10.13-aligned versions to macOS
13.0-aligned versions. This allows us to stop linking CoreFoundation
in the swift runtime, which was previously required for availability
checking. It also lets us align the deployment target on x86_64 with
arm64, which was 11.0. Finally, it is a prerequisite to being able to
build swift using the macOS 15 beta SDKs.
2024-08-29 14:30:09 -07:00
Yuta Saito
32bfb7e603 Include swift-testing in the Wasm Swift SDK
This change adds build support for swift-testing in the Wasm Swift SDK.
Unfortunately, we can't use the regular SwiftTesting build-script product
because Wasm build cannot use build-script's cross-compilation infrastructure
for now. So we build swift-testing in WasmSwiftSDK product and install it
to the SDK package.
2024-08-29 14:02:38 +00:00
Rintaro Ishizaki
20f201d3ec [build-script] Fix product dependencies
SwiftPM now depends on `SwiftTesting`, `SwiftTesting` depends on
`SwiftTestingMacros`

rdar://133946466
2024-08-19 10:09:40 -07:00
Rintaro Ishizaki
eca7779d00 Revert "[build-script] Fix product dependencies" 2024-08-17 06:23:43 -07:00
Rintaro Ishizaki
852aa7798f [build-script] Fix product dependencies
SwiftPM now depends on `SwiftTesting`, `SwiftTesting` depends on
`SwiftTestingMacros`

rdar://133946466
2024-08-15 11:26:45 -07:00
Saleem Abdulrasool
482b004a69 Merge pull request #75717 from compnerd/curl 2024-08-13 07:32:26 -07:00
Rintaro Ishizaki
e98c5eab61 [build-script] Separate SwiftTestinMacros from SwiftTesting product
Also, build them for all hosts including cross compiling host.
2024-08-09 14:43:20 -07:00
Rintaro Ishizaki
e06d38b3ac [swift-testing] Build tweak
* Remove SwiftSyntax product dependency
* Correct CMAKE_BUILD_TYPE
2024-08-08 13:13:45 -07:00
Stuart Montgomery
155e4c857b Fix header comment 2024-08-08 13:13:44 -07:00
Stuart Montgomery
97e85a6bf2 Build script changes to begin building and installing swift-testing into toolchains (on Darwin, so far) 2024-08-08 13:13:44 -07:00
Saleem Abdulrasool
78c957edc6 utils: update curl to 8.9.1 from 8.5.0
Update the embedded curl version for Windows. Adjust the flags
accordingly.
2024-08-06 11:08:08 -07:00
Jeremy Schonfeld
f89db53698 Ensure Foundation tests don't run when passing --skip-foundation-tests (#75573) 2024-07-31 12:54:48 -07:00
Kuba Mracek
69964f9f22 [embedded] Don't build embedded stdlibs in 'standalone' builds 2024-07-30 10:42:55 -07:00
Jeremy Schonfeld
443c29d3a0 Invoke foundation tests via SwiftPM (#74594)
* Invoke foundation tests via SwiftPM

* Remove CTEST_OUTPUT_ON_FAILURE from Foundation build
2024-07-29 16:38:06 -07:00
Kuba (Brecka) Mracek
6c0fe7c624 Merge pull request #75375 from kubamracek/embedded-macho-builtins2
[embedded] Ask LLVM to build armv6 armv6m armv7 armv7m armv7em Mach-O builtins
2024-07-23 16:47:54 -07:00
Kuba Mracek
4f0d2e9f88 [embedded] Adhere to Python lint rules in llvm.py 2024-07-22 18:53:32 -07:00
Kuba Mracek
bd0c903dd5 [embedded] Ask LLVM to build armv6 armv6m armv7 armv7m armv7em Mach-O builtins 2024-07-19 13:28:21 -07:00
Finagolfin
65de39674d [build] Disable cleaning sourcekit-lsp by default, rather than having the flag do nothing
Rather than make this change, swiftlang/sourcekit-lsp@37d003eb7 had the
`--no-clean` flag do nothing, which means the flag can't be used at all.
Instead, switch the flag to `--clean` in swiftlang/sourcekit-lsp#1558 and don't
invoke it by default.
2024-07-19 21:44:09 +05:30
Jeremy Schonfeld
f3acbb079f Remove ICU from the toolchain (#75262)
* Remove ICU from the toolchain

* Remove icu comment from GettingStarted.md
2024-07-17 18:19:16 -07:00
Alexander Cyon
4a2942bb4e Fix typos in: cmake, tools, utils, unittests, validation-test
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2024-07-12 02:34:00 +03:00
Max Desiatov
eef85a7be2 Improve logging in swift_build_support/shell.py (#74592)
Currently, when a command fails with this message 

```
ERROR: command terminated with a non-zero exit status 1, aborting
```

it's unclear at all which exact command terminated, which makes it very hard to debug issues in the build script.
2024-06-26 22:56:59 +01:00
Yuta Saito
1f6a0e8363 [wasm] Disable building embedded stdlib when cross-compiling for wasm
The stdlib build configuration for wasm is incompatible with the
embedded targets (e.g. `SWIFT_STDLIB_COMPACT_ABSOLUTE_FUNCTION_POINTER=TRUE`),
so we need to disable building the embedded stdlib
2024-06-26 10:42:07 +00:00
Kuba (Brecka) Mracek
9e7501601c Merge pull request #74489 from kubamracek/embedded-less-stdlibs
[embedded] Don't build *all* the embedded stdlibs by default
2024-06-18 13:50:25 -07:00
Kuba Mracek
37ed08dc7b Add a build-script + CMake flag to enable/disable building the _Volatile module 2024-06-17 13:18:55 -07:00
Kuba Mracek
dc2edb6e9b [embedded] Don't build *all* the embedded stdlibs by default 2024-06-17 10:32:56 -07:00
Jeremy Schonfeld
1407980f66 Don't pass foundation build path to swift-driver/swift-package-manager (#74217) 2024-06-10 15:33:11 -07:00
Yuta Saito
6f375245fd Merge pull request #73964 from kateinoigakukun/katei/enable-observation-wasm
[wasm] Enable Observation module build for Wasm target
2024-05-29 17:27:03 +09:00
Yuta Saito
721f3756b8 [wasm] Enable Observation module build for Wasm target 2024-05-29 01:28:45 +00:00
Mishal Shah
da59253bba Merge pull request #73318 from bc-lee/feature/python-replace-deprecated-function-usage
[python] Replace deprecated assertEquals with assertEqual in build graph test
2024-05-27 23:53:45 -07:00
Alastair Houghton
2056b26258 [Build] Move the .cfg file generation to a new product.
We need to move the `.cfg` file generation to a new product so that we can
land it in the default toolchain for Xcode.

rdar://128612098
2024-05-24 08:27:17 +01:00
Yuta Saito
1148e26ae4 build: Build Swift SDK earlier than SwiftPM to allow SwiftPM to use it
Just built Swift SDK would be useful for SwiftPM to perform integration
tests. All of those products do not depend on just built SwiftPM
(WasmKit is built using host tools), so it is safe to build them earlier.
2024-05-22 14:14:12 +00:00
Yuta Saito
f9a14b8f10 build: Build Swift SDK for WebAssembly
This change adds a new product, WasmSwiftSDK, to build the Swift SDK for
WebAssembly. The product is built using the swift-sdk-generator package
and takes just built WebAssembly stdlib, clang runtime libraries,
and wasi-sysroot as input, and produces a Swift SDK artifactbundle under
swift-sdk-generator/Bundles.
2024-05-22 14:14:12 +00:00
Yuta Saito
c7dfc48dd7 [wasm] Enable Distributed module build for Wasm target 2024-05-22 08:51:41 +00:00
Yuta Saito
0f50aca4e9 [test] Move embedded wasm tests to a separate directory
The `classes-wasm.swift` test was the only executable test for
WebAssembly that requires wasm runtime at test-time. Other tests
in the `embedded` directory run only on the macOS / Linux host toolchain
builds and some of them are incompatible with SWIFT_SHOULD_BUILD_EMBEDDED_STDLIB=OFF.
Given that the `classes-wasm.swift` test is the only test we want to run
during WasmStdlib build, move it to a separate directory `embedded/wasm`.
2024-05-20 11:55:10 +00:00
Yuta Saito
a06dc0e12e [wasm] Repair build for recent SwiftDriver linkage changes
- Before f34d388bf2, the EarlySwiftDriver used Dispatch/Foundation from
old host toolchain at the initial "build" step, and then re-linked the just
built Dispatch/Foundation at "install" step.
- WasmStdlib product incorrectly set `BOOTSTRAPPING_MODE` to `HOSTTOOLS`
and it makes `SwiftSource.cmake` set `LD_LIBRARY_PATH` to load the
Dispatch/Foundation from the just built toolchain (SWIFT_NATIVE_SWIFT_TOOLS_PATH).

After f34d388bf2, the EarlySwiftDriver always uses the corelibs of
the old host toolchain, so setting `LD_LIBRARY_PATH` leads to loading
incompatible corelibs of the old host toolchain, and the build fails.

This change tells the CMake build system to use CROSSCOMPILE mode.
We already built the toolchain for the current host from the revision
being built for the target, so we don't need to inject the lib library
of the old host toolchain.
2024-05-20 06:29:45 +00:00
Eric Miotto
ce0e620d1a [CMake] allow custom options when building the compiler with debug info
Currently those are hardcoded to `-g`, but in some Apple internal
configurations we would like to change them.

There are other part of the build system that hardcode `-g`
(e.g. in `SwiftCompilerSources` and `AddSwiftStdlib.cmake`),
but we are not interested in those at the moment -- we will address those
in the future if need be.

Supports rdar://127503136
2024-05-14 08:42:35 -07:00
Kuba Mracek
921c0e530e Simplify lld selection logic in build_script_invocation.py 2024-05-09 09:40:33 -07:00
Kuba Mracek
30a5986a21 [lld] Allow opt-out from building lld via --skip-build-lld 2024-05-09 09:18:51 -07:00
Alastair Houghton
9e2c13bd10 Merge pull request #71839 from al45tair/eng/PR-123503470
[Build] Add the new fully-static Linux SDK.
2024-05-06 17:34:22 +01:00
Alastair Houghton
62c80a1073 [Build] A couple more Python fixes.
Remove unused import of `importlib.resources`.

Set `test_linux_static` to `False` if tests are disabled.

rdar://123503470
2024-05-03 10:46:22 +01:00
Alastair Houghton
3627507eb1 [Build] Further static Linux SDK support changes.
Fix some indentation issues.

Change `build-script-impl` to make `build-linux-static` a positive argument.

Fix documentation for `--linux-archs` and `--linux-static-archs` (the options
are comma separated for `build-script`, but semicolon separated for
`build-script-impl`).

Set the default for `linux-static-archs` to `x86_64, aarch64` so that we
install the expected content in the toolchain.

Add missing default for `test_linux_static`.

Make sure to pass down `--skip-build-linux` and `--build-linux-static`.

Factor out config file generation and call it from the install step in `llvm.py`
as well as from the build step.

rdar://123503470
2024-05-03 09:12:49 +01:00
Evan Wilde
f34d388bf2 Build: EarlySwiftDriver: Use consistent Foundation/Dispatch
The early swift driver build would switch the Dispatch and Foundation
build used while building between an initial clean build and an
incremental rebuild. The early swift driver should consistently use the
same Foundation and Dispatch for each build.

This change tells the early swift driver stops build-script from telling
the early driver build to use the Foundation and Dispatch that it built.
2024-05-02 13:56:49 -07:00
Alastair Houghton
68598514c2 [Build] Fix Python linting issues.
The Python linter was complaining about import orders.

rdar://123503470
2024-05-02 14:56:18 +01:00
Alastair Houghton
29e38af1fe [Build] Fix a conflict resolution mistake.
Apparently I accidentally removed a `]` while resolving a conflict in
`build_script_invocation.py.`

rdar://123503470
2024-05-02 14:56:18 +01:00
Alastair Houghton
fdc8ffd36f [Build] Updated following initial comments from Eric.
Change the `--linux[-static]-arch` option to `--linux[-static]-archs`, on the
basis that it supports multiple values.

Other tidying.

rdar://123503470
2024-05-02 14:56:18 +01:00
Alastair Houghton
ae1c0455f3 [Build] Add the new fully-static Linux SDK.
Declare a new `LINUX_STATIC` SDK and configure it.

Add options to set the build architectures for the `LINUX` and
`LINUX_STATIC` SDKs, similar to what we have for Darwin, because
we'll be cross-compiling.

Also add an option to point the build system at the sources for
the musl C library, which we're using for `LINUX_STATIC`.

rdar://123503470
2024-05-02 14:56:18 +01:00
Byoungchan Lee
c31f1f5245 [python] Replace deprecated assertEquals with assertEqual in build graph test
`unitest.assertEquals` is deprecated in Python 3.2 and finally removed in
Python 3.12 [1]. Due to this, this test files in recent Linux distros,
like Ubuntu 24.04 or Fedora 38+. This patch replaces the deprecated
function with `assertEqual`.

[1] https://docs.python.org/3/whatsnew/3.12.html
2024-04-29 08:17:15 +09:00
Yuta Saito
e20e1c6be9 Merge pull request #73077 from kateinoigakukun/yt/split-wasi-sysroot-for-targets
[wasm] Split wasi-sysroot for wasi and wasip1-threads
2024-04-18 06:21:15 +09:00
Yuta Saito
1136d50969 [wasm] Split wasi-sysroot for wasi and wasip1-threads
libclang_rt.builtins library is placed in the clang resource directory
per OS and architecture, so "environment" field is not used to find the
library (except for android). wasi and wasip1-threads require different
target features, so we need to split wasi-sysroot for them.

Before
```
wasi-sysroot
├── include
├── lib
│   ├── wasi
│   │   └── libclang_rt.builtins-wasm32.a
│   ├── wasm32-wasi
│   │   ├── ...
│   │   └── libc.a
│   ├── wasip1
│   │   └── libclang_rt.builtins-wasm32.a
│   └── wasm32-wasip1-threads
│       ├── ...
│       └── libc.a
└── share
```

After
```
wasi-sysroot
├── wasm32-wasi
│   ├── include
│   ├── lib
│   │   ├── wasi ---------- (will be renamed to wasip1)
│   │   │   └── libclang_rt.builtins-wasm32.a
│   │   └── wasm32-wasi --- (will be renamed to wasm32-wasip1)
│   │       ├── ...
│   │       └── libc.a
│   └── share
└── wasm32-wasip1-threads
    ├── include
    ├── lib
    │   ├── wasip1
    │   │   └── libclang_rt.builtins-wasm32.a
    │   └── wasm32-wasip1-threads
    │       ├── ...
    │       └── libc.a
    └── share
```
2024-04-17 17:45:37 +00:00