Commit Graph

1257 Commits

Author SHA1 Message Date
Kuba Mracek
0c9c9918ae [build-script] Avoid stripping clang builtin .a libraries when extracting dSYMs on Darwin 2024-02-29 10:55:11 -08:00
Michael Buch
dd42476381 [build-script] Fix the LLDB redecl completion filter that we pass to llvm-lit
In the presence of multiple `--filter` options, `llvm-lit` will only
pick the last one. Which means we only ever ran the tests under
`commands/`.

This patch turns the multiple filters into a regex.
2024-02-23 13:41:23 +00:00
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
Michael Buch
03194eb4b1 Merge pull request #71724 from Michael137/lldb/type-completion-rework/swift-build-script/to-20230725
[build-script] Run LLDB tests with new redecl-completion setting
2024-02-22 19:09:13 +00:00
Michael Buch
8858585677 [build-script] Run LLDB tests with new redecl-completion setting 2024-02-20 13:41:08 +00: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
Adrian Prantl
acc9100798 Explicitly pass LLDB test config, so it can be picked up by the filter decorators 2024-02-12 08:50:28 -08:00
Alastair Houghton
e48b05f12c [SwiftCompilerSources] Enable use of the -min-runtime-version option.
Turn on the use of `-min-runtime-version` when building the compiler.

rdar://121522431
2024-02-02 16:19:06 +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
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
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
Adrian Prantl
71bbe17dc2 Merge pull request #69679 from adrian-prantl/precise-compiler-invocation
Extend the LLDB test matrix to support precise compiler invocations.
2023-11-15 08:46:06 -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
Adrian Prantl
d3f6ca5683 Extend the LLDB test matrix to support precise compiler invocations. 2023-11-08 16:32:17 -08:00
Adrian Prantl
c6cceaf3c7 Only rerun the API tests in dwarfimporter-only mode.
This removes >70 tests from the list of tests that are being rerun.  The REPL
doesn't really benefit from DWARFImporter, since there is no deb ug info in the
victim process, so it makes no sense to test this configuration.
2023-11-08 09:27:25 -08: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
Kavon Farvardin
3da894d704 [NoncopyableGenerics] provide stdlib build option
This helps set the stage for getting the stdlib building
correctly with `NoncopyableGenerics` enabled. Disabled by
default for now so this is an NFC.
2023-10-25 09:27:36 -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 Langford
54fed44b80 [Test] See if removing -Xcc from DOTEST_EXTRA continues to work 2023-09-14 12:43:55 -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
Max Desiatov
e82060fbdb build: Add support for wasi-sysroot option in build-script
`wasi-sysroot` allows providing a path to a custom libc that supports this platform.
2023-07-22 13:44:05 +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
e197c00e3e Merge pull request #66883 from al45tair/eng/PR-111214571
[Freestanding] Remove uses of stat() and dlsym().
2023-06-23 22:05:45 +01: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
Michael Buch
511c344577 [Build] Introduce --lldb-configure-tests option
We recently changed the build-script to stop configuring LLDB
tests if `SKIP_TESTS_LLDB` is set  (see rdar://109774179 and
https://github.com/apple/swift/pull/66171).

A common use-case is to build lldb without `-t` (to avoid running the
tests) and then run the tests separately later. However, if we don't
specify the `-t` flag to the build-script, `SKIP_TESTS_LLDB` is implicitly set.
Meaning this multi-step way of running lldb tests regressed.

This patch addresses this by creating a new `--lldb-configure-tests`
option which when set makes sure we set the CMake variable
`LLDB_INCLUDE_TESTS` (which will be the default behaviour).

The preset for which we originally introduced the `SKIP_TESTS_LLDB` check
now sets this new option to `0` to avoid configuring LLDB tests. The
preset skips running the tests anyway, we're not losing test coverage.
2023-06-23 12:32:32 +01:00
Yuta Saito
5528b40acb Merge pull request #66534 from kateinoigakukun/pr-a7645923603fc716c8f3b55bfd113d3972dc3bb6
[wasm][build] Recognize wasi-wasm32 as valid host
2023-06-19 16:33:53 +09:00
Mike Ash
290970a8c4 [Build] Set swift-stdlib-tracing=0 for minimal stdlib builds. 2023-06-15 15:42:07 -04:00
Max Desiatov
c435405e1b build-script-impl: add support for freebsd-arm64
Lack of this line causes a build error: `Unknown host tools target: freebsd-arm64`.
2023-06-15 01:04:54 +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
Yuta Saito
e228cd8b5f [wasm][build] Recognize wasi-wasm32 as valid host
wasi-wasm32 support in build system was added in
b1236e92f9 but we forgot to add it to the
host for the case when we are building the standalone stdlib for the
target.
2023-06-10 10:12:39 +00:00
futurejones
ea330b269c add riscv64 as supported architecture on linux 2023-06-10 15:43:28 +09:00
Owen Voorhees
5a7ba23b84 Add flags to toolchain Info.plist to allow using macros from Apple's SDKs when building in Xcode 2023-06-06 17:27:48 -07:00
Michael Buch
2d41efe996 [Build] Don't configure LLDB with tests enabled if the tests will be skipped
Currently the `--skip-test-lldb` flag will only skip *running* the
tests. But we still pass `LLDB_INCLUDE_TESTS` to CMake when configuring
LLDB.

Since https://github.com/apple/swift/pull/66018 configuring LLDB tests will
now always require libcxx to be built. For some presets (e.g.,
`buildbot_osx_package`) we don't need to build libcxx and we explicitly
pass `--skip-test-lldb`; this means if we were to try configure LLDB
tests we would hard error.

The proposed solution is to check whether the user wants to skip LLDB
tests, and if so, set `LLDB_INCLUDE_TESTS=FALSE`.

rdar://109774179
2023-05-26 14:39:32 +01:00
Michael Buch
0c974e0bf0 [Build] Make sure lldb API tests run against newly built libcxx
Currently any buildbot that runs LLDB API tests does so
against the system SDK. However, we explicitly need users
to run the tests against a newly built libcxx. We recently
added a new `LLDB_TEST_LIBCXX_ROOT_DIR` CMake variable to
LLDB to allow standalone builds to point their tests to
a custom libcxx directory.

This patch makes sure the relevant LLDB presets build
libcxx and then sets above CMake variable.
2023-05-19 11:31:19 +01:00
Max Desiatov
0fc365960c Merge pull request #65795 from apple/maxd/fix-missing-cmake-value
CMake: fix missing `SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` value

`SWIFT_CONCURRENCY_GLOBAL_EXECUTOR` is defined in `stdlib/cmake/modules/StdlibOptions.cmake`, which is not included during the first pass of evaluation of the root `CMakeLists.txt`. It is available on subsequent evaluations after the value is stored in CMake cache. This led to subtle bugs, where `usr/lib/swift_static/linux/static-stdlib-args.lnk` didn't contain certain flags on clean toolchain builds, but did contain them in incremental builds.

Not having these autolinking flags in toolchain builds leads to errors when statically linking executables on Linux.

Additionally, since are trivial tests previously didn't link Dispatch statically, the didn't expose a bug where `%import-static-libdispatch` substitution had a missing value. To fix that I had to update `lit.cfg` and clean up some of the related path computations to infer a correct substitution value.

Resolves some of the errors reported in https://github.com/apple/swift/issues/65097.
2023-05-17 20:52:05 +01:00
fischman-bcny
bbbdbdf2e8 Call python3 to execute XCTest's build_script.py.
A workaround for the fact that fixing this in XCTest's repository
(https://github.com/apple/swift-corelibs-xctest/pull/441) is blocked on XCTest's
CI being broken for unrelated reasons (and ones which I cannot reproduce).
2023-05-16 16:04:52 -07:00
Max Desiatov
2db62cade8 Fix -DSWIFT_PATH_TO_LIBDISPATCH_STATIC_BUILD value 2023-05-10 14:05:25 +01:00
Kuba (Brecka) Mracek
77bd312a88 [build-script] In symbol extraction, also codesign executables after 'strip' and not just dylibs (#64574) 2023-03-31 20:18:05 -07: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
Butta
30a301c1b3 [build] Remove runpath from build host from shared ICU libraries on linux 2023-03-15 21:20:40 +05:30
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
Anthony Latsis
52f46be301 Merge pull request #63745 from AnthonyLatsis/build-script-impl-cleanup
build-script-impl: Remove dead code that expects an LLVM product
2023-03-02 07:44:15 +03:00
Anthony Latsis
920d05b656 build-script-impl: Remove dead code that expects an LLVM product 2023-03-01 22:40:28 +03:00
Mishal Shah
4d3eebe529 Unset the IFS after using it for aliases 2023-02-27 09:31:13 -08:00
Mishal Shah
4902aa8394 Add support to include multiple toolchain alias 2023-02-25 23:04:06 -08:00
Adrian Prantl
a280182db9 Improve the detection of ASAN in build-script
The lldb sanitizer preset doesn't enable ASAN using the --enable-asan flag, it
instead adds the option to LLDB_EXTRA_CMAKE_ARGS.
2023-02-22 08:48:35 -08:00
Adrian Prantl
084e4e17ce Merge pull request #63549 from adrian-prantl/limit-asan-main
Limit the amount of parallelism on asan LLDB bots to nphyscpus/2
2023-02-09 15:55:45 -08:00
Adrian Prantl
8a163fff1b Limit the amount of parallelism on asan LLDB bots to nphyscpus/2 2023-02-09 10:28:58 -08:00