Commit Graph

409 Commits

Author SHA1 Message Date
Saleem Abdulrasool
9819577c96 utils: make -BuildTargets optional in build.ps1
This doesn't really add much to readability and is almost always
`default`. Simply assume the default behaviour and allow callers
to alter the behaviour if needed.
2024-09-05 16:49:21 -07:00
Saleem Abdulrasool
f7719332fc utils: improve android swift-corelibs-foundation support
Adjust the build invocation for swift-corelibs-foundation to account for
changes required for building for android after re-coring the library.
We use the SDKRoot to find the necessary libraries.
2024-09-05 12:18:19 -07:00
Andrew Rogers
7709bdab28 [android] build libxml2 and curl with -fPIC
Sets `CMAKE_POSITION_INDEPENDENT_CODE=YES` when building libxml2 and
curl. This causes `-fPIC` to be passed to clang when compiling, which is
required for the i686 Android build to succeed.

This change makes `build.ps1` consistent with the Python build files
swift_build_support\products\libxml2.py and
swift_build_support\products\curl.py, which already define this cmake
property. It is already propertly set for zlib in both locations.
2024-09-04 11:14:01 -07:00
Andrew Rogers
a6684fd9c9 apply PR feedback 2024-09-03 13:18:43 -07:00
Andrew Rogers
c9ee368536 [android] conditionally build ds2 for Android SDK
Conditionally include the ds2 debug server in the Android SDK build in
build.ps1 via the `-IncludeDS2` flag.
2024-09-03 11:24:19 -07:00
Hiroshi Yamauchi
911933e25d Merge pull request #76015 from hjyamauchi/buildps1
Fix another cross-compile build failure.
2024-08-22 09:06:27 -07:00
Jeremy Schonfeld
96c3357731 Enable swift-corelibs-foundation tests on Windows (#75932) 2024-08-21 10:10:48 -07:00
Hiroshi Yamauchi
cc6b74342a Fix another cross-compile build failure.
This fix is similar to https://github.com/swiftlang/swift/pull/75970
but for `Build-TestingMacros`.
2024-08-21 09:38:08 -07:00
Saleem Abdulrasool
135ce460d0 Merge pull request #75985 from compnerd/testing-style
utils: adjust the swift-testing build to match style
2024-08-20 13:05:26 -07:00
Hiroshi Yamauchi
8ee61aa82c Merge pull request #75957 from hjyamauchi/cacheflag
Make it possible to specify the sccache storage location via a flag.
2024-08-20 11:13:49 -07:00
Saleem Abdulrasool
4f3da9591a utils: adjust the swift-testing build to match style
This renames the `Build-*` phase associated with building swift-testing.
Rather than name it `Build-SwiftTesting` match the other functions and
name it `Build-Testing`.
2024-08-20 09:33:30 -07:00
Saleem Abdulrasool
ebe17694d4 Merge pull request #75949 from compnerd/testing-macros
utils: improve testing macro setup for Windows
2024-08-20 09:32:57 -07:00
Mishal Shah
ebf3ec7939 Merge pull request #75970 from hjyamauchi/crosscompilefix
Fix cross-compile build failure.
2024-08-20 00:43:10 -07:00
Andrew Rogers
511e8795ef [Android] fix NDK extract location
The Android NDK is being extracted with an extra intermediate directory:

  $BinaryCache\android-ndk-r26b\android-ndk-r26b

The Android build fails because it expects the NDK contents to live
immediately under the directory:

  $BinaryCache\android-ndk-r26b

The extra android-ndk-r26b sub-dir comes from the NDK zip archive
itself, which we have no control over. To work-around, allow callers
of Extract-ZipFile to control whether or not it should create the
extraction sub-dir. Override the default behavior for NDK extraction
only.
2024-08-19 16:36:01 -07:00
Hiroshi Yamauchi
3054eab6b0 Fix cross-compile build failure.
In Build-FoundationMacros, use the build Swift SDK for the build case
and when cross-compiling, use the swift syntax build from the build
arch binary cache as opposed to the host arch binary cache or else the
architecture mismatch will happen.
2024-08-19 16:33:46 -07:00
Saleem Abdulrasool
2d0c707b63 utils: improve testing macro setup for Windows
Build the testing macros early along with the Foundation macros and then
build a copy for distribution as well. This brings testing macros in
line with the Foundation macros.
2024-08-19 14:25:18 -07:00
Hiroshi Yamauchi
36e071684e Make it possible to specify the sccache storage location via a flag.
This allows the cache to be stored outside the binary cache.
2024-08-19 09:59:49 -07:00
Saleem Abdulrasool
59019af4b3 utils: raise PinnedVersion to an argument
This is required so that we can use a custom pinned toolchain. The three
arguments required are:
  - `PinnedBuild` (URL to toolchain)
  - `PinnedSHA256` (SHA256 for installer)
  - `PinnedVersion` (toolchain version)

Prior to this, we would error out as `PinnedVersion` would be unset and
could not be specified as it was not an argument.
2024-08-19 09:06:29 -07:00
Saleem Abdulrasool
5a497a68b8 utils: update WiX and fetch if packaging
Skip fetching and extracting WiX if not packaging. Skip fetching the
pinned toolchain and NDK if not building.
2024-08-16 14:43:02 -07:00
Hiroshi Yamauchi
43dd793b2f Fix the pinned toolchain version handling for the ARM64 build. 2024-08-14 13:12:33 -07:00
Saleem Abdulrasool
482b004a69 Merge pull request #75717 from compnerd/curl 2024-08-13 07:32:26 -07:00
Jeremy Schonfeld
36dee56942 Enable swift-foundation tests on Windows in toolchain builds (#75811) 2024-08-12 15:44:47 -07:00
Saleem Abdulrasool
8b66cb51bf Merge pull request #75785 from compnerd/macrOS
utils: build Foundation macros for distribution
2024-08-12 09:41:21 -07:00
Saleem Abdulrasool
0ccfc50998 utils: migrate away from fetched SQLite
With the introduction of swift-toolchain-sqlite, we have a version of
SQLite that we can use to build the toolchain. Prefer this over the
fetched amalgamation which simplifies the logic for the toolchain and
ensures that we are able to track this as a regular component.
2024-08-10 11:30:07 -07:00
Saleem Abdulrasool
e97499b773 utils: build Foundation macros for distribution
This adds a build of the Foundation macros for distribution in the
toolchain.
2024-08-09 21:16:27 -07:00
Rintaro Ishizaki
1c6552fb7b Merge pull request #75515 from rintaro/add-swift-testing
Build and install swift-testing in toolchains
2024-08-09 21:09:20 -07:00
Saleem Abdulrasool
f4d6eda177 Merge pull request #75712 from al45tair/improve-windows-build-script
[Build][Windows] Don't extract archives needlessly.
2024-08-08 14:26:51 -07:00
Rintaro
f069aecca5 [Windows] Build and install swift-testing in Windows toolchains
* Basically following XCTest scheme.
 * Build TestingMacro separately from Testing library and install it to
   the toolchain's `bin`
 * Testing swift-testing itself is TODO
2024-08-08 13:13:45 -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
Rintaro Ishizaki
65cd1de3a9 [Windows] Avoid 'install' twice
In `Build-CMakeProjects` function, when `$InstallTo` is not an empty
string, `install` target is automatically built. Specifying `install` in
`$BuildTargets` makes it built twice.
2024-08-06 09:32:32 -07:00
Alastair Houghton
ddedfe0b3d [Build][Windows] Don't extract archives needlessly.
Avoid extracting archives every time you run a build.
2024-08-06 15:59:09 +01:00
Saleem Abdulrasool
b11d9953c9 utils: correct indentation (NFC)
Adjust the indentation after recent changes for Foundation's build.
2024-08-01 11:53:03 -07:00
Alex Lorenz
d3cfaa3788 Merge pull request #75549 from hyp/eng/buildps1-host-android-sdk-windows-foundation-macros
[build.ps1] add host SDK path when building foundation for Android on…
2024-08-01 11:30:45 -07:00
Rintaro Ishizaki
fdc1d2f70a Merge pull request #75571 from rintaro/windows-clean
[Windows] Fix 'clean'
2024-07-31 09:55:09 -07:00
Rintaro
e1d4af50e6 [Windows] Fix 'clean'
Automatically detect the last component number so 'clean' removes the
build cache directries correctly
2024-07-30 13:43:07 -07:00
Alex Lorenz
386b945d8b [build.ps1] add host SDK path when building foundation for Android on windows
This lets us build the FoundationMacros for the windows host
2024-07-30 12:24:29 -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
Saleem Abdulrasool
628d4c56cd Merge pull request #75510 from compnerd/exclude
utils: try to downscope builds for the runtime
2024-07-27 09:53:49 -07:00
Saleem Abdulrasool
09f9c2667f utils: try to downscope builds for the runtime
This tweaks the build configuration for the runtime to downscope what we
actually build to what we require. This should have a negligible
improvement to the build times.
2024-07-26 09:59:12 -07:00
Saleem Abdulrasool
b0366e768e utils: enable HCS on Windows builds
This enables a minor optimization where we can outline cold BBs now that
HCS will not attempt to outline scoped EH functions.
2024-07-25 11:10:28 -07:00
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
Alex Lorenz
6a7be95027 Merge pull request #74754 from hyp/eng/android-compiler-rt-buildps1
[windows][toolchain] build  android compiler-rt builtins when buildin…
2024-07-16 12:35:42 -07:00
Jeremy Schonfeld
b55f881645 Revert swift-corelibs-foundation-windows checkout (#75255) 2024-07-15 17:35:24 -07:00
Alex Lorenz
bd2c3ea53b [windows][toolchain] build android compiler-rt builtins when building Android SDK with build.ps1 2024-07-12 17:22:13 -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
Alex Lorenz
42c43e6262 Merge pull request #75140 from hyp/eng/windows-local-build
[windows][build.ps1] only use swift-corelibs-foundation-windows checkout
2024-07-11 12:26:10 -07:00
Alex Lorenz
d6ed2e982a [windows][build.ps1] only use swift-corelibs-foundation-windows checkout
in CI

https://github.com/swiftlang/swift/pull/75073 has broken a local
toolchain build on windows using build.ps1,
as the local build does not use update_checkout on windows, and
thus does not checkout swift-corelibs-foundation-windows.
2024-07-10 13:49:47 -07:00
Saleem Abdulrasool
31fc0a65e5 Merge pull request #75104 from compnerd/pinning
utils: pin the latest build for ARM64 to bootstrap on Windows
2024-07-10 09:02:05 -07:00
Saleem Abdulrasool
b4f2f4983d utils: pin the latest build for ARM64 to bootstrap on Windows
We need a bootstrapping toolchain. Now that we have an ARM64 build for
Windows, pin that to provide a default pinned toolchain. This should
allow us to build natively on Windows ARM64 without having to specify
the download image ourselves.
2024-07-09 09:48:22 -07:00
Jeremy Schonfeld
a23fd6f183 Move main/6.0 windows Foundation builds to separate branch (#75073) 2024-07-08 18:28:01 -07:00