Commit Graph

78 Commits

Author SHA1 Message Date
Eric Miotto
266c00d285 Skip build system tests when targeting remote executors
These will be still exercised when targeting macOS, Linux and Windows.

Addresses rdar://111854328
2023-07-06 09:50:02 -07:00
Eric Miotto
1aaaef91cc Relax FileCheck directives for skip_clean_llbuild.test (#66062)
This is needed short term to allow the test to pass when running on
Python 3.11 and later and avoid errors like

```
<stdin>:44:1: note: non-matching line after previous match is here
<string>:1: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
^
```

Long term we want to replace uses of the obsolete `pipes.quotes`
function with `shlex.quotes`.

Addresses rdar://109664710
2023-05-24 08:18:10 -07:00
Anthony Latsis
f94f401a06 build-script: Don't build LLVM testing tools when generating Xcode projects 2023-03-16 20:58:14 +03:00
Dario Rexin
2bac2a1cbf Update skip_build_xcode.test 2022-12-08 09:41:33 -08:00
Anthony Latsis
c50d2214cb build: Mirror LLVM+Xcode-specific build-script-impl logic in CMake build-script product
This fixes the behavior of `--xcode`, which was relying on this logic and was
compromised when LLVM became a build-script product.
2022-11-22 19:44:14 +03:00
Dario Rexin
3f80cb6712 [Build] Make LLVM a build-script product
rdar://80733826
2022-10-30 22:47:29 -07:00
Eric Miotto
f7a11c7543 Tests all cases of infer-cross-compile-hosts-on-darwin at once (#60824)
The current implementation currently requires to have physical machine
for each architecture supported by macOS, which is not desirable.

To allow all cases to be tested on a random Mac machine, allow
to inject an arbitratry current architecture into the inference
of the cross compile hosts by means of an environment variable.

Addresses rdar://99096874
2022-08-30 00:10:40 -07:00
Eric Miotto
c954130be0 Add a flag to infer appropriate cross compile hosts on Darwin
Addresses rdar://98787335, apple#60348
2022-08-22 09:37:52 -07:00
Alex Hoppen
55051a71b2 [test] Explicitly specify --cmake %cmake for build_lld.test
I believe this was causing CMake to get built for the test case and make the test case take ~5min on Linux instead of ~15sec.
2022-06-08 18:36:19 +02:00
Josh Soref
0f78f006bb Spelling validation test (#58561) 2022-05-27 22:07:10 -07:00
Alex Hoppen
e313df88ce [build-script] Add option to build lld as part of LLVM 2022-04-12 16:38:34 +02:00
Butta
a3ea28ff19 [android] Remove ICU build flags since that requirement was dropped in #40340 2021-12-20 12:06:13 +05:30
Erik Eckstein
6199876be7 cmake: remove support for non-libswift swift support in host libraries/executables.
This is not needed anymore because all swift code will be contained in libswift.
Also, remove the corresponding tests.
2021-12-05 19:06:00 +01:00
Michael Gottesman
7f273a1d48 Merge pull request #39129 from gottesmm/pr-ce6749f7a3c9f7189d38038a4f6210a168c2d0e0
[build-script] Add an option for cleaning the install destdir
2021-09-02 15:04:05 -07:00
Michael Gottesman
8794dd1003 [build-script] Add an option for cleaning the install destdir
Useful to make sure that one is not hitting weird behavior due to a stale just
built toolchain.
2021-09-02 12:25:40 -07:00
Michael Gottesman
8109819e21 [build-script-impl] Do not actually try to extract symbols when we perform a dry-run.
Otherwise, we can't successfully dry-run a toolchain on darwin.

I added an option enable-extract-symbol-dry-run-test that can be set to restore
the previous behavior and updating the BuildSystem unit tests that depend on
that behavior to pass that flag.
2021-08-31 16:57:13 -07:00
Michael Gottesman
1d86a22f5b [build-script] Add a SKIP_XCODE_VERSION_CHECK to all dry-run build-script tests.
It makes sense to just set this here since we aren't testing that functionality
and enables us to test this if we aren't using one of the specified Xcodes
(which can be useful).
2021-08-31 14:10:28 -07:00
Butta
cec3e11207 [build][test] Don't test '--skip-clean-xctest' on Darwin as the source may not be checked out 2021-08-31 21:06:10 +05:30
swift-ci
0c122a514f Merge pull request #38673 from buttaface/skip-clean 2021-08-30 16:27:14 -07:00
David Zarzycki
20f9be1f9a [testing] Add missing REQUIRES: standalone_build 2021-08-28 12:11:01 -04:00
Michael Gottesman
4f149d07ce [build-script] Split the build-script-impl pipeline into two pipelines so I can put a build-script product pipeline in between.
This is where I am going to put the stage 2 swift. The reason why I need to do
this is that I need libdispatch, foundation, etc on Linux to use the stage2
compiler.
2021-08-26 16:48:25 -07:00
Michael Gottesman
15aff43980 Revert "Revert "[build-script] Use a builder to setup pass pipelines that are then scheduled when using --infer""
This reverts commit 7348395a30.
2021-08-25 19:31:29 -07:00
Mishal Shah
7348395a30 Revert "[build-script] Use a builder to setup pass pipelines that are then scheduled when using --infer" 2021-08-18 08:34:18 -07:00
Michael Gottesman
6d50463656 [build-script] Use a builder to setup pass pipelines that are then scheduled when using --infer
The key thing here is that by using this builder, I am going to be able to split
the build-script-impl pipeline in two and put in a build-script pipeline in
between. This is needed so that on Linux, we can build the stage 2 compiler
before we build any of the build-script-impl libraries that depend on having a
swift compiler.

This should be an NFCI change. I am relying on our build system unit tests to
ensure that I am not changing any real behavior.
2021-08-17 19:54:03 -07:00
Butta
9d1736c123 [build] Add flags to allow skipping rebuilding the corelibs
Add three new flags, '--skip-clean-libdispatch', '--skip-clean-foundation', and
'--skip-clean-xctest', that leave the previous builds of those products in place.
2021-08-16 17:19:56 +05:30
Eric Miotto
2c6d762d19 Use existing CMake in some build-script tests (#38842)
This will prevent the tests to rebuild CMake (especially under Linux)
and cause transient issues.

This is similar to what was done for #37611
2021-08-12 07:12:47 -07:00
Mishal Shah
0ebceda18b Mark android_cross_compile.test unsupported for iOS, tvOS, and watchOS 2021-07-06 15:25:39 -07:00
Butta
de148ada38 [build] disable failing Android cross-compilation test on macOS 2021-07-01 03:17:05 +05:30
Varun Gandhi
a07b4761b3 Merge pull request #33724 from buttaface/core
[build] Add the flags to enable cross-compiling the corelibs
2021-06-30 09:31:51 -07:00
Michael Gottesman
d829de1e25 [build-script] Use a toolchain file and always cross compile cmark.
NOTE: We still build for the host platform always, but even in that case within
cmark itself, we are cross compiling it.
2021-06-28 19:26:10 -07:00
Butta
a4ff4db508 [build] Add the flags to enable cross-compiling the corelibs
Pass the Swift and CMake flags needed to cross-compile Foundation and so on, with
the first example of Android. Add a new flag, --cross-compile-deps-path, which is
used to search for cross-compiled libraries, like libcurl, that the corelibs
depend on. Also add a new flag, --common-swift-flags, to pass additional Swift
flags to the corelibs.
2021-06-29 06:41:41 +05:30
Michael Gottesman
acfe645755 [cmake] Disable libswift and cmake tests when building using the Xcode generator.
We should re-enable this once it is clear that there aren't issues with the
Xcode generator/host side swift cmake. The Ninja generator (the default) still
is enabled.
2021-06-20 13:30:29 -07:00
Michael Gottesman
98ab14d9ef [cmake] Rather than forcing parts of the build that don't depend on LLVM to define LLVM_COMMON_DEPENDS, just have add_swift_host_library respect the global if it is set. 2021-06-08 14:42:16 -07:00
Michael Gottesman
294f9b5ebe [cmake] Disable swift-cmake tests on non-Darwin platforms.
The reason why I am doing this is that we do not yet have on all of the
non-Darwin bots swift host toolchain files. So we can't test this code path on
those platforms and thus can not guarantee correctness. The result is that on
those other platforms if someone /does/ have a host toolchain with a swift
binary in it, failures may result breaking other people's builds.
2021-06-04 13:27:49 -07:00
Michael Gottesman
ef2b9d8631 [cmake] On Darwin, teach add_swift_host_tool how to find swift's SDK/compat libs, fix the rpath of tools, and add tests.
There are three things going on here (note all on Darwin):

1. If one compiles a swift static library and links the static library into a
   cxx executable, the cxx executable will need the -L flags to find the
   appropriate libraries in the SDK/toolchain.

2. I fixed an rpath issue where due to old code I didn't understand/propagated
   forward, we were setting the rpath to be the -L directory in the appropriate
   SDK. After reasoning about this a little bit I realized that this was code
   that was actually intended to be used for target libraries (for which the
   given rpath would be correct). On the host side though on Darwin, we want to
   use the rpath for the standard stabilized stdlib on the system.

3. I added Build System Unittests to ensure that this keeps on working. I also
   added test cases that I should have added before. I just had never thought
   about how to test this and I realized this method would work and would
   prevent regressions while I am waiting for a new swiftc with driver fixes to
   land.
2021-06-01 22:01:39 -07:00
Artem Chikin
71fb04aed6 Merge pull request #37349 from artemcm/InferEarlyDriver
[Build Script] Fix `--infer` with `earlyswiftdriver`.
2021-06-01 15:54:50 -07:00
Artem Chikin
3511d5f4f5 [Build Script] Fix --infer with earlyswiftdriver.
In the original implementation (https://github.com/apple/swift/pull/36377), using `--infer` accidentally disables the `earlyswiftdriver` product (`before_impl_product_classes` set to always empty). This change fixes that and makes sure early SwiftDriver is always built, regardless of whether or not `--infer` is used.

This change also ensures that `install_all` setting triggered by `--infer` does not affect products which specify `is_ignore_install_all_product` to return True. This is useful for products which should not be installed into the toolchain (corresponding build products that use the just-built toolchain are the products that get installed, e.g. `swiftdriver` to `earlyswiftdriver`).
2021-06-01 13:13:04 -07:00
Dario Rexin
da880d9c86 [Build] Pass '--reconfigure' to build-script-impl (#37677)
We recently started using the flag in build-script and forgot to pass it on the build-script-impl

rdar://78578996
2021-05-27 22:34:24 -07:00
Eric Miotto
06a2a71728 [test] Isolate build-script calls in skip-local-build.test-sh (#37611)
...and reenable `llvm-targets-options.test` (previously disabled in #37573).

This will align `skip-local-build.test-sh` with the behaviour of the
other BuildSystem tests, by

* ensuring we use the `cmake` exposed in `lit.cfg`, so that under Linux we
don't attempt to rebuild it
* using a separate build folder for `build-script` invocations, so that
side effects will not affect the main invocation and other lit tests.

I expect these changes to prevent `llvm-targets-options.test` to fail in Linux
presets with an error related to cmake, e.g.

```
build-script: error: argument --cmake: /home/buildnode/jenkins/workspace/
oss-swift-package-linux-ubuntu-18_04/build/cmake-linux-x86_64/bin/cmake is not an executable
```

Addresses rdar://78320684
2021-05-25 10:09:06 -07:00
Eric Miotto
d70b15d7fe Reenable llvm-targets-options.test
This was previously disabled in #37573.
2021-05-24 20:14:26 +00:00
Eric Miotto
7379f455bf [test] Isolate build-script calls in skip-local-build.test-sh
This will align skip-local-build.test-sh with the behaviour of the
other BuildSystem tests, by

* ensuring we use the cmake exposed in lit.cfg, so that under Linux we
don't attempt to rebuild it
* using a separate build folder for build-script invocations, so that
side effects will not affect the main invocation and other lit tests.

I expect these changes to prevent llvm-targets-options.test to fail in
Linux presets with an error related to cmake, e.g.

```
build-script: error: argument --cmake:
/home/buildnode/jenkins/workspace/
oss-swift-package-linux-ubuntu-18_04/build/cmake-linux-x86_64/bin/cmake
is not an executable
```

Addresses rdar://78320684
2021-05-24 20:13:22 +00:00
Dario Rexin
7cfabf51f1 Revert "Revert "[Build] Make cmark build a build-script product (#37102)""
This reverts commit 3150086b0f.
2021-05-24 07:03:12 -07:00
Ben Langmuir
3150086b0f Revert "[Build] Make cmark build a build-script product (#37102)"
This reverts commit 3c19cc432d.
2021-05-23 09:02:29 -07:00
Dario Rexin
3c19cc432d [Build] Make cmark build a build-script product (#37102) 2021-05-22 09:04:45 -07:00
Ben Langmuir
a2127a24d4 Disable validation-test/BuildSystem/llvm-targets-options.test on Linux
This has failed a couple of times in CI with an error about cmake not
being an executable. Disbale until we can fix it.

rdar://78320684
2021-05-21 11:50:37 -07:00
Eric Miotto
0675da8b41 [test] pass host-target to build-script... (#37488)
... in tests related to symbol generation.

This is to ensure that the dry run invocations of `build-script` use the
same value as `%target-cpu` and prevent failures when running validation
tests for an architecture different from the current one.

Addresses rdar://78141544
2021-05-19 07:06:02 -07:00
Eric Miotto
c3f8dacdf0 [Build] allow to generate symbols for a subset of binaries (#37120)
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

At the same time, introduce tests around the logic that handles symbols.

Addresses rdar://76865276
2021-05-13 07:32:41 -07:00
Eric Miotto
1e5f790d06 [Build] allow to generate symbols for a subset of binaries
This would be needed to reduce overall build times in scenarios when
generating symbols for all binaries is too expensive and/or not needed.

Addresses rdar://76865276
2021-05-12 10:02:41 -07:00
Eric Miotto
b903a6cc65 Put symbol generation logic under test
...before adding the logic to filter paths

In particular:
* print the list of files that `cpio` copies, so we can test explicitly
  which files end up in the symroot (and also see those when asking for
  a toolchain in PR testing)
* use `find` instead of `grep` to filter files we want symbols generated
  for -- this is to avoid the script failing when there are no symbol to
  process, especially in lit tests
* remove an unnecessary check for `swift-api-digester` -- this is now a
  symlink to `swift-frontend` and we only process regular files.

Supports rdar://76865276
2021-05-12 09:52:30 -07:00
Artem Chikin
ae2e856f9b Revert "Merge pull request #37114 from apple/revert-36377-NewDriverDefault"
This reverts commit 937e1a365c, reversing
changes made to a5440a8abd.
2021-04-28 15:11:36 -07:00