Commit Graph

1328 Commits

Author SHA1 Message Date
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
Rintaro Ishizaki
a490db377a Bump host tools deployment version for Darwin OS (#61460)
* Bump host tools deployment version for Darwin OS

* Update availability_define.swift

* Fix the test to use @backDeployed from @_backDeploy

---------

Co-authored-by: Mishal Shah <shahmishal@users.noreply.github.com>
2023-02-05 22:11:32 -08:00
Arnold Schwaighofer
fdedaad022 Default to no default for swift-enable-runtime-function-counters 2023-02-02 14:08:13 -08:00
Arnold Schwaighofer
02ec4ff72b Add swift-enable-runtime-function-counters flag to build script 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
Adrian Prantl
0e96efc435 Use LLVM_LIT_ARGS for the pkg tests. 2023-01-26 09:48:26 -08:00
Adrian Prantl
6dcdb49558 build-script-impl: Have LLDB honor -llvm-lit-args 2023-01-26 09:48:26 -08:00
Kuba (Brecka) Mracek
e963e0cfdb build-script: Check the existence of Clang+Swift compilers when using a custom toolchain (#62975) 2023-01-14 11:07:55 -08:00
Saleem Abdulrasool
04f4d66b73 Merge pull request #62388 from compnerd/naming
build: rename `EXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR`
2022-12-18 08:50:40 -08:00
Mishal Shah
724d493e7e Reduce the timeout for LIT test from 20 to 10mins (#62496) 2022-12-11 16:52:18 -08:00
Doug Gregor
d024c1eacf Remove --copy-subdirs from recursive-lipo.
We want the `--copy-subdirs` behavior all the time, so remove it as an
option and use the new semantics everywhere.
2022-12-09 13:33:22 -08:00
Doug Gregor
da873419fe Remove the --explicit-src-files from recursive-lipo
This option has been subsumed by the improved semantics of
`--copy-subdirs`.
2022-12-09 13:33:22 -08:00
Max Desiatov
e80e7e3487 Merge pull request #62234 from apple/maxd/cmark-build-cleanup
build-script-impl: remove CMark cases as unused

CMark was converted from a `build-script-impl` product to `build-script` product in https://github.com/apple/swift/pull/37102. After that change, some of the remaining mentions of CMark in `build-script-impl` were unused and can be removed.
2022-12-07 10:19:21 +00:00
Anthony Latsis
4cb63c8a0f [NFC] Migrate remnant Jira issue references to GitHub issues 2022-12-04 08:20:34 +03:00
Saleem Abdulrasool
b58dbb2c0a build: rename EXPERIMENTAL_STRING_PROCESSING_SOURCE_DIR
Rename the variable to `SWIFT_PATH_TO_STRING_PROCESSING_SOURCE` to match
the variables used for libdispatch, swift-syntax.
2022-12-03 17:17:13 -08:00
Max Desiatov
aaffc5f828 build-script-impl: remove CMark cases as unused
CMark was converted from a `build-script-impl` product to `build-script` product in https://github.com/apple/swift/pull/37102. After that change remaining mentions of CMark in `build-script-impl` were unused and can be removed.
2022-11-29 11:15:32 +00:00
Max Desiatov
b73f2a8984 build-script-impl: remove get_stdlib_targets_for_host as unused (#62238)
This function is declared, but not used anywhere. There are no references to it anywhere else in the codebase or documentation.
2022-11-28 16:28:32 +00:00
Robert Widmann
2d07f382c5 Delete _InternalSwiftSyntaxParser And Its Build Infrastructure
This is the start of the removal of the C++ implementation of libSyntax
in favor of the new Swift Parser and Swift Syntax libraries. Now that
the Swift Parser has switched the SwiftSyntaxParser library over to
being a thin wrapper around the Swift Parser, there is no longer any
reason we need to retain any libSyntax infrastructure in the swift
compiler.

As a first step, delete the infrastructure that builds
lib_InternalSwiftSyntaxParser and convert any scripts that mention
it to instead mention the static mirror libraries. The --swiftsyntax
build-script flag has been retained and will now just execute the
SwiftSyntax and Swift Parser builds with the just-built tools.
2022-11-02 10:35:29 -07:00
Max Desiatov
4912c35835 build-script-impl: remove unused LIBXML2_SOURCE_DIR (#61522)
This variable is unused, since `libxml2` is currently build by CMake, not by `build-script-impl`.
2022-10-21 15:05:03 +01: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
e0def4e3f7 Unset LLVM_ENABLE_RUNTIMES in CMake caches (#61435)
This would be needed for two reasons:
* avoid that testing for PRs that use `LLVM_ENABLE_RUNTIMES` to build
  compiler-rt may cause errors in unrelated PRs;
* avoid any fallout in CI should the above PRs be merged and
  subsequently reverted for unforeseen regressions.

Addresses rdar://100762636
2022-10-05 07:52:59 -07:00
Doug Gregor
b626f46d72 [Build] Determine the early SwiftSyntax build directory in build-script-impl
Cross-compilation of the host depends on iteration over all of the host
architectures within build-script-impl itself, so the computation of
the build directory must occur in build-script-impl. Sink it down there
to fix builds for multiple host architectures.
2022-09-20 15:19:29 -07:00
Josh Soref
97649ee26b spelling: multi
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:37 -04:00
Josh Soref
f310b33ea8 spelling: describe
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:37 -04:00
Josh Soref
6af887f567 spelling: configuration
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2022-09-15 19:43:36 -04:00
Hamish Knight
cfda4b1764 [build-script] Allow specifying the number of lit workers
Allow tests to run with a different number of
workers than build jobs if desired.
2022-09-14 14:01:49 +01:00
Eric Miotto
ba2a88a33a Rely on macOS deployment target set by compiler-rt for sanitizers
Using newer targets can lead to build failures, see

41c52889b9
b87fc09dce

This has no effect currently, it is meant to support the switch
to `LLVM_ENABLE_RUNTIMES` to build compiler-rt -- #58465

Addresses rdar://99140817
2022-09-07 01:30:52 -07:00
Robert Widmann
f9cff13604 Move All the Gyb Support for Syntax out of Swift
Make libSyntax depend on swift-syntax: the new home for all
of this infrastructure. This greatly simplifies the addition and
amending of syntax nodes as only the swift-syntax paired with a
swift checkout will need to be changed. This is in contrast to
the existing build flow where a paired PR to both repos must be
made to change anything here.

Note that a paired PR may still be required if the legacy parser
needs to be adjusted in response to syntax nodes changing, but I
anticipate this to be a much more infrequent event now that
the C++ end of libSyntax is deprecated.
2022-08-31 13:10:24 -07:00
3405691582
3740a207bd Apply suggestions from code review
Co-authored-by: Saleem Abdulrasool <compnerd@compnerd.org>
2022-08-29 10:47:42 -04:00
3405691582
47ae4d9a53 Preliminary Linux-OpenBSD cross-compile support.
With a properly prepared sysroot and toolchain file, these changes permit
cross-compilation of Swift as well as LLVM, CMark, and Dispatch (picking,
as usual, apple/swift-corelibs-libdispatch#556) from a Linux host
generating OpenBSD binaries.

The toolchain file must be specified as an environment variable to
`build-script` and discussion on how to properly set up the sysroot and
toolchain file will be handled later.
2022-08-28 22:39:46 -04:00