Commit Graph

8542 Commits

Author SHA1 Message Date
Jeff
dd6f1c29b3 Fix missing param. 2025-03-21 10:18:44 -07:00
Mishal Shah
deb1d9696d Merge pull request #80199 from etcwilde/ewilde/remove-ninja-host
[build-script] Remove ninja host
2025-03-21 09:43:50 -07:00
Evan Wilde
bafbfa2d46 [build-script] Remove ninja host
The ninja builder took a host argument that was unused by the function.
The ninja build failed to pass this argument, resulting in
an execution failure. Removing the argument.
2025-03-21 08:55:19 -07:00
Jeff
b150d4c94e PR Feedback 2. 2025-03-20 21:57:27 -07:00
Jeff
3daeb9c7b9 PR Feedback. 2025-03-20 17:08:41 -07:00
Jeff
643f904353 utils: Handle additional args to Invoke-BuildStep in build.ps1. 2025-03-20 15:17:27 -07:00
Jeff
ad744421fd utils: Convert build.ps1 to use Platform definitions. 2025-03-20 15:17:25 -07:00
Saleem Abdulrasool
1289c9614e Merge pull request #80092 from compnerd/versioning
utils: version testing frameworks
2025-03-20 10:20:40 -07:00
Saleem Abdulrasool
1e74bdffa0 Merge branch 'main' into timing 2025-03-19 22:28:46 -07:00
Saleem Abdulrasool
8e10b00984 Merge pull request #80148 from weliveindetail/windrd-unblock-nightly
utils: temporarily ignore test failure for Android runtimes
2025-03-19 21:42:57 -07:00
Saleem Abdulrasool
1b1274f7c1 Merge pull request #80125 from hjyamauchi/foundationmacros
Fix FoundationMacro build failure in ARM64 cross-build
2025-03-19 20:13:36 -07:00
Saleem Abdulrasool
440ebee0bb utils: collect more build times
Add time collection for the test execution. This will allow us to
immediately see in the summary the time expenditure.
2025-03-19 16:54:43 -07:00
Saleem Abdulrasool
89e9681592 utils: remove extra timing data collection
The timing data collection is now homed under `Invoke-BuildStep`.
`Build-SPMProject` is an implementation detail of the build step and is
timed at a higher level.
2025-03-19 16:53:35 -07:00
Saleem Abdulrasool
befc15e6df Merge pull request #80082 from compnerd/isolated
utils: split `Build-*` into `Build-` and `Test-`
2025-03-19 16:31:04 -07:00
Stefan Gränitz
123b25d20a utils: temporarily ignore test failure for Android runtimes 2025-03-20 00:16:56 +01:00
Evan Wilde
f5f79f056f Merge pull request #80102 from etcwilde/ewilde/choose-built-ninja
[build-script]: Automatically choose a built ninja
2025-03-19 15:28:15 -07:00
Saleem Abdulrasool
f20ff950ec utils: split Build-Dispatch into Build- and Test- function
Split up the test routines from the build routines. This is motivated by
the desire to simplify (remove logic flow) and to help get more accurate
timing data.
2025-03-19 11:13:43 -07:00
Saleem Abdulrasool
ae1f4cae7b utils: split Build-Foundation into Build- and Test- function
Split up the test routines from the build routines. This is motivated by
the desire to simplify (remove logic flow) and to help get more accurate
timing data.
2025-03-19 11:13:42 -07:00
Saleem Abdulrasool
789bd1fc0d utils: split Build-Testing into Build- and Test- function
Split up the test routines from the build routines. This is motivated by
the desire to simplify (remove logic flow) and to help get more accurate
timing data.
2025-03-19 11:12:03 -07:00
Saleem Abdulrasool
2c02471271 utils: split Build-LLBuild into Build- and Test- function
Split up the test routines from the build routines. This is motivated by
the desire to simplify (remove logic flow) and to help get more accurate
timing data.
2025-03-19 11:12:03 -07:00
Saleem Abdulrasool
e7c8dc66ad utils: remove extraneous parameter (NFC)
The callee does not take any parameters, remove the extra leftover
parameter.
2025-03-19 11:12:03 -07:00
Hiroshi Yamauchi
2ff8806fa8 Fix FoundationMacro build failure in ARM64 cross-build 2025-03-19 10:54:58 -07:00
Saleem Abdulrasool
6ead8cb5bd utils: correct straggling function replacement 2025-03-19 09:00:06 -07:00
Alex Hoppen
d870056efd Merge pull request #80076 from ahoppen/foundation-tests-debug
[tests] Run swift-(corelibs-)foundation tests in debug configuration on Windows
2025-03-19 08:16:30 -07:00
Evan Wilde
9402a1689b Automatically choose a built ninja
Instead of using `--build-ninja` to decide to build ninja, build it
automatically if a sufficiently new enough version is not available.
Also record the build time taken to build the local Ninja so that we can
see how much time we would save by stashing a pre-built Ninja in CI.
2025-03-19 07:35:32 -07:00
Saleem Abdulrasool
f457d9ccd4 Merge pull request #80099 from hjyamauchi/minjectverbose
Make minject not verbose
2025-03-18 21:28:23 -07:00
Evan Wilde
012ac5da5d Merge pull request #80093 from etcwilde/ewilde/ninja-skip-build-testing
Disable building Ninja tests
2025-03-18 14:28:27 -07:00
Alex Hoppen
3557451e54 [tests] Run swift-(corelibs-)foundation tests in debug configuration on Windows
This should improve CI times because building in debug configuration instead of release configuration is significantly faster. Since we don’t install the build of swift-(corelibs-)foundation using SwiftPM into the toolchain, this doesn’t have any performance impact on users of the toolchain.
2025-03-18 14:11:38 -07:00
Hiroshi Yamauchi
187c7981c5 Make minject not verbose 2025-03-18 13:15:04 -07:00
Evan Wilde
d2d5925695 Disable building Ninja tests
Ninja builds its tests by default.
We don't run the Ninja test suite, we aren't doing development on Ninja,
and we are using a release tag that has been verified to work. There
isn't much point in building the tests if we're not going to use them.
Disabling building the Ninja tests. If it is desirable to build them,
one can set `BUILD_TESTING` to `YES` and re-run their build.
2025-03-18 09:32:40 -07:00
Saleem Abdulrasool
6d0a40c169 utils: adjust missed helpers in build.ps1
These were missed in the conversion from host/build/target to host based
builds.
2025-03-18 09:13:02 -07:00
Saleem Abdulrasool
179dc983b7 utils: version testing frameworks
This adjusts the install location for the testing frameworks to be
versioned with the product version. These are somewhat closely tied to
the compiler, and it makes sense to tie them to the product version.
2025-03-18 08:59:43 -07:00
Saleem Abdulrasool
7940b24ec7 utils: remove Host, Build, Target duplication
Adopt the `$Arch` parameter uniformly. If something is built for the
host we can use `$HostArch` explicitly (which identifies the
environment that the toolchain will run on). `$BuildArch` gives us an
explicit architecture when building for the machine where the toolchain
is being built. For the target libraries, we simply pass in the
appropriate `$Arch` value.
2025-03-17 17:50:21 -07:00
Stefan Gränitz
117b95498a utils: add one more xfail for Android tests in build.ps1 2025-03-17 09:20:31 +01:00
Evan Wilde
bac5232d18 Merge pull request #80034 from etcwilde/ewilde/ninja-build-fix
[build-script] Build Ninja with CMake
2025-03-16 23:15:35 -07:00
Saleem Abdulrasool
ef1a1d1644 Merge pull request #80037 from swiftlang/revert-79944-windrd-update-default-sdks
Revert "utils: Update default Android SDKs in build.ps1"
2025-03-16 16:25:36 -07:00
Jeff
644462cb5e utils: Improve build.ps1 build summary report. (#80026)
* utils: Display total time taken in build Summary.

* utils: Add % to summary data in build.ps1.

* Cleanup and formatting.
2025-03-16 16:23:02 -07:00
Saleem Abdulrasool
2f60c73ad6 Merge pull request #80039 from compnerd/crossed
utils: explicitly cross-compile the experimental runtimes
2025-03-16 15:04:47 -07:00
Stefan Gränitz
d6ac1eca74 [windows][toolchain] Run non-executable Swift Runtime tests for Android (#79185)
We cross-compile the Swift runtime libs for the Android SDKs in the Windows toolchain. This patch adds a build step that runs non-executable tests for them.
2025-03-16 22:52:38 +01:00
Saleem Abdulrasool
e33bf2a464 Merge pull request #80012 from jeffdav/win-build-validate-pinned-params
utils: Validate Pinned params in build.ps1.
2025-03-15 20:56:20 -07:00
Saleem Abdulrasool
74ab62c00c utils: explicitly cross-compile the experimental runtimes
Pass additional parameters to setup the cross-compilation for the
experimental runtime.
2025-03-15 16:56:53 -07:00
Saleem Abdulrasool
2499f6937f Revert "utils: Update default Android SDKs in build.ps1 (#79944)"
This reverts commit c4a472eccf.
2025-03-15 08:55:53 -07:00
Evan Wilde
e46e3220b5 [build-script] Build Ninja with CMake
This patch switches the Ninja build from using the configure.py script
to building with the just-built CMake.
The configure.py in Ninja 1.11.1 still uses Python 2.7, importing the
`pipes` module. The pipes module was deprecated in Python 3.11 and
removed in 3.13, so folks using newer versions of Python are running
into issues with this.

The CMake build doesn't have this issue and is also perfectly valid, so
we can switch to that.
2025-03-15 08:53:38 -07:00
Evan Wilde
f7655ae393 Merge pull request #79973 from etcwilde/ewilde/build-script-cmake
[build-script] CMake bootstrapping updates
2025-03-14 18:48:15 -07:00
Evan Wilde
9826e27390 Merge pull request #79856 from etcwilde/ewilde/bootstrap-stage0-config
Build Preset: Bootstrap Stage-0 Toolchain
2025-03-14 14:44:40 -07:00
Evan Wilde
90bf96c104 [build-script] Don't rebuild CMake
This patch updates the CMake-building mechanism to avoid
re-bootstrapping CMake if we already bootstrapped one that is new
enough.

I've made it so that all paths through the function return the path to a
CMake so we can use the result of the function as the cmake path without
having to check.

The function will choose one of the following ways of getting CMake in
order of preference:
 - One we already built
 - The system CMake
 - Bootstrapping one from scratch

It prefers one we built over checking the system CMake because, if we
have already built a CMake previously, it's a good indication that
there either was no system CMake installed, or it wasn't new enough. We
shouldn't waste time checking it again if a previous run detected that
it wasn't good enough.

The system CMake is preferable to building one from scratch if we don't
need to though, so we determine if the system CMake is sufficient.

Finally, if one that we built either doesn't exist, or isn't new enough,
and the system either doesn't have a CMake, or a new enough CMake, build
one. It is built into the location that we are checking for caching, so
the next time we run build-script, it should hit the first case and
choose the already-built CMake instead of building it again.
2025-03-14 13:33:14 -07:00
Evan Wilde
71b7725d44 [build-script] Log CMake Bootstrap build time
Include the CMake bootstrap time in the build-script build times.
We're including everything else. Would be good to determine how much
time we can save by caching a new enough pre-built CMake in the builder
images.

Importing the log_time_in_scope exposes a cyclic dependency cycle
between the `swift_build_support` and `build_swift` python modules in
such a way that the tests fail due to re-importing parts of build_swift:

```
ImportError: Failed to import test module: tests.build_swift.test_migration
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/lib/python3.8/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/home/build-user/swift/utils/build_swift/tests/build_swift/test_migration.py", line 14, in <module>
    from build_swift import migration
  File "/home/build-user/swift/utils/build_swift/build_swift/migration.py", line 18, in <module>
    from swift_build_support.swift_build_support.targets import \
  File "/home/build-user/swift/utils/swift_build_support/swift_build_support/targets.py", line 15, in <module>
    from . import cmake
  File "/home/build-user/swift/utils/swift_build_support/swift_build_support/cmake.py", line 26, in <module>
    from swift_build_support.swift_build_support.utils import log_time_in_scope
  File "/home/build-user/swift/utils/swift_build_support/swift_build_support/utils.py", line 20, in <module>
    from build_swift.build_swift.constants import SWIFT_BUILD_ROOT
ModuleNotFoundError: No module named 'build_swift.build_swift'
```

I've put the import of log_time_in_scope into the function definition
to ensure that build_swift has been fully loaded by the time we need
log_time_in_scope, ensuring that there is order between the two pieces.

Python caches the imported module, so if we accidentally re-import the
log_time_in_scope, nothing actually changes.

This re-orders the instantiation of the BuildScriptInvocation object so
that it comes before the creation of the CMake path. This ensures that
BuildScriptInvocation() does not delete the build log after logging the
CMake bootstrap time. This is fine because the toolchain and arguments
are reference types, so updating the CMake path in both of those will be
reflected in the copy taken in the BuildScriptInvocation() object.
2025-03-14 13:33:12 -07:00
Saleem Abdulrasool
b4a2908fb5 Merge pull request #79830 from jeffdav/win-build-timing
utils: Cleanup timing functions in build.ps1.
2025-03-14 12:35:00 -07:00
Saleem Abdulrasool
d74c7681ef Merge pull request #79932 from compnerd/unstage
utils: adjust for new install rules for testing frameworks
2025-03-14 09:46:12 -07:00
Jeff
93f9db67f8 utils: Hoist WiX artifact definition. (#79953)
* utils: Hoist WiX artifact definition.

* Fix merge damage from rebase.
2025-03-13 23:05:20 -07:00