Commit Graph

409 Commits

Author SHA1 Message Date
Stefan Gränitz
7b261935d1 fixup! Change compiler notation in Build-CMakeProject 2024-12-05 14:46:47 +01:00
Stefan Gränitz
a39de72b22 fixup! Factor out Get-BuiltToolchainTool analog to Get-PinnedToolchainTool and give both an optional Name param 2024-12-05 14:46:40 +01:00
Hiroshi Yamauchi
b623958889 Merge pull request #77940 from hjyamauchi/winarm64ci
Fix python arch on the windows arm64 CI
2024-12-04 10:11:37 -08:00
Stefan Gränitz
addd7a28c5 Change compiler notation in Build-CMakeProject 2024-12-04 16:47:17 +01:00
Stefan Gränitz
861df6f6b4 Consolidate Python module installation 2024-12-04 16:19:46 +01:00
Stefan Gränitz
bcaaaa521e Consolidate dependency infos 2024-12-04 16:19:46 +01:00
Stefan Gränitz
6ca7ed6f56 Drop workaround for FindFirstFileExA issue with CMake pre-3.26.3 2024-12-04 16:18:44 +01:00
Stefan Gränitz
2bcb1a770b Add version check for sccache 2024-12-04 16:18:07 +01:00
Stefan Gränitz
a7af8eaff4 Configure compiler launcher for C and C++ unconditionally 2024-12-04 16:18:07 +01:00
Stefan Gränitz
ebeaa004d4 [windows][toolchain] Enable sccache for Clang
We need sccache 0.7.4 or newer for clang support
2024-12-04 16:18:07 +01:00
Stefan Gränitz
07029daf74 Replace "Android" string compares with [Platform]::Android enum 2024-12-04 16:17:15 +01:00
Stefan Gränitz
8882b93a5d Replace "Windows" string compares with [Platform]::Windows enum 2024-12-04 16:17:13 +01:00
Stefan Gränitz
e933aefbe0 Initialize sccache dir right away 2024-12-04 16:16:24 +01:00
Stefan Gränitz
8308a79641 Rename DriverBinaryCache and streamline path concat 2024-12-04 16:16:23 +01:00
Stefan Gränitz
0079c3417b Factor out Get-BuiltToolchainTool analog to Get-PinnedToolchainTool and give both an optional Name param 2024-12-04 16:16:23 +01:00
Stefan Gränitz
1a21d16374 Hoist CompilersBinaryCache variable to global scope 2024-12-04 16:16:23 +01:00
Stefan Gränitz
d922df0bdb Factor out function Get-ClangDriverName 2024-12-04 16:16:23 +01:00
Hiroshi Yamauchi
5d7d63f0ee Fix python arch on the windows arm64 CI
https://ci-external.swift.org/job/swift-main-windows-toolchain-arm64/777/consoleText
```
Error: Program 'python.exe' failed to run: The specified executable is not a valid application for this OS platform.At C:\Users\swift-ci\jenkins\workspace\swift-main-windows-toolchain-arm64\swift\utils\build.ps1:545 char:7
+       & $Executable @Args | Out-Null
+       ~~~~~~~~~~~~~~~~~~~.
```
2024-12-03 14:40:24 -08:00
Saleem Abdulrasool
020d67330c build: enable libxml2 in the toolchain, use llvm-mt
Enable support for libxml2 on Windows to allow `llvm-mt` to be usable.
This then allows us to use `llvm-mt` as the manifest tool when building
for Windows. Remove the then obsoleted workaround of `-D CMAKE_MT=mt`.
This reduces the dependency on the MSVC toolchain and paves the path to
enabling the use of the manifest tool in SPM.
2024-12-02 17:05:20 -08:00
YR Chen
ab04b3adf3 [build.ps1] don't use host Python any more (#76594)
* [build.ps1] don't use host Python any more

* [build.ps1] fix compatibility with Windows Powershell

* Try to address CI failure
2024-12-02 10:40:17 -08:00
Stefan Gränitz
cf748a9dd0 Exclude Anroid targets for the moment 2024-11-28 17:06:33 +01:00
Stefan Gränitz
934c9e3816 Build sanitizers for all enabled SDKs by default 2024-11-28 13:02:08 +01:00
Stefan Gränitz
4a93d76818 Rename option: IncludeSanitizers -> BuildSanitizers 2024-11-26 16:56:56 +01:00
Stefan Gränitz
76be949750 Align default targets for builtins and runtimes on x86_64 hosts 2024-11-26 16:56:56 +01:00
Saleem Abdulrasool
16fa7d599c utils: unlock building swift-inspect
When building for ARM64, we can now build swift-inspect as we use CMake
for the cross-compilation.
2024-11-22 09:19:52 -08:00
Stefan Gränitz
9b024399fc Add missing default for IncludeSanitizers option 2024-11-21 15:57:45 +01:00
Stefan Gränitz
1857d1c2af Initial patch for early feedback 2024-11-21 14:50:19 +01:00
Saleem Abdulrasool
c72246cb15 utils: use CMake to build swift-inspect for Windows
This switches us to use CMake to build swift-inspect. In doing so, we
can now cross-compile this tool. Due to the use of CMake, we now have
install rules for the products, which allows the toolchain deployment
and simpler rules in the installer.
2024-11-20 21:21:39 -08:00
Saleem Abdulrasool
9d5db10c8b utils: remove DEVTOOLS_ROOT property for MSIs
This property was unused and has been removed from the WiX rules as of
swiftlang/swift-installer-scripts#347. Simplify the invocation.
2024-11-20 09:23:40 -08:00
Saleem Abdulrasool
5319f1e30d utils: adjust Windows build to use shared LMDB
This adjusts the build to create a shared (static) build of LMDB.
Re-order the build rules, wire up the LMDB build into IndexStoreDB and
SourceKit-LSP.
2024-11-18 13:06:26 -08:00
Alex Hoppen
8bf9406146 Merge pull request #77656 from ahoppen/action-output
[Windows] Change log output to `Testing …` when testing a SwiftPM project in build.ps1
2024-11-15 18:20:41 -08:00
Alex Hoppen
91ca044d77 [Windows] Change log output to Testing … when testing a SwiftPM project in build.ps1 2024-11-15 14:28:38 -08:00
Henrik G. Olsson
0678829cf7 Add @PointerBounds macro (#76969)
Add @PointerBounds macro

@PointerBounds is a macro intended to be applied by ClangImporter when
importing functions with pointer parameters from C headers. By
leveraging C attributes we can get insight into bounds, esapability, and
(eventually) lifetimes of pointers, allowing us to map them to safe(r)
and more ergonomic types than UnsafePointer.

This initial macro implementation supports CountedBy and Sizedby, but
not yet EndedBy. It can generate function overloads with and without an
explicit count parameter, as well as with UnsafeBufferPointer or Span
(if marked nonescaping), and any of their combinations. It supports
nullable/optional pointers, and both mutable and immutable pointers.
It supports arbitrary count expressions. These are passed to the macro
as a string literal since any parameters referred to in the count
expression will not have been declared yet when parsing the macro.

It does not support indirect pointers or inout parameters. It supports
functions with return values, but returned pointers can not be bounds
checked yet.

Bounds checked pointers must be of type Unsafe[Mutable]Pointer[?]<T>
or Unsafe[Mutable]RawPointer[?]. Count expressions must conform to
the BinaryInteger protocol, and have an initializer with signature
"init(exactly: Int) -> T?" (or be of type Int).

rdar://137628612

---------

Co-authored-by: Doug Gregor <dgregor@apple.com>
2024-11-11 14:54:25 -08:00
Saleem Abdulrasool
0d3aa3a009 utils: correct function name for PS style
The functions should be named [verb]-[noun], remove the extraneous `-`
in the name. Also homogenise the call to avoid the parenthesis.
2024-11-08 12:55:58 -08:00
Alex Hoppen
7a005bf853 Merge pull request #77084 from ahoppen/sourcekit-lsp-tests
[Windows] Run SourceKit-LSP tests from build.ps1
2024-10-18 21:31:27 -07:00
Mishal Shah
05ad720f57 Revert "Drop references to clang-pseudo-gen after removal" 2024-10-18 20:58:41 -07:00
Alex Hoppen
88382de01f [Windows] Run SourceKit-LSP tests from build.ps1
Building and running the tests currently takes 2:10min locally on my machine, but quite a few tests are currently disabled on Windows.
2024-10-18 15:13:25 -07:00
Stefan Gränitz
51f41842fe Drop references to clang-pseudo-gen after removal
pseudo was removed from clang-tools-extra in upstream PR https://github.com/llvm/llvm-project/pull/109154
Drop two explicit references in swift and unblock Windows CI
2024-10-17 14:43:18 +02:00
Alex Hoppen
bb217a3a97 [Windows] Run swift-format tests from build.ps1
The basic idea is that we build all libraries for the executable that will be included in the toolchain using CMake. swift-format then has a mode in its Package manifest that allows it to build just the test and test support targets, requiring all search paths to find those libraries to be passed in. We use that to only build swift-format's test using SwiftPM and re-use all the libraries that were already built using CMake.
2024-10-11 16:51:13 -07:00
YR Chen
e9a8ebb494 [build.ps1] fix misuse of varibles in Extract-Toolchain 2024-10-02 10:17:51 -07:00
YR Chen
a67f82b500 [build.ps1] Fix newer PS Core compatibility
In Powershell Core, `$_` from `Get-ChildItem` output will be interpreted as full path. Use `$($_.Name)` to ensure only base file name is used.
2024-10-02 10:17:51 -07:00
YR Chen
cb724f8a6d [build.ps1] eliminate cmdlet aliases 2024-10-02 10:17:51 -07:00
Saleem Abdulrasool
946ee34153 Merge pull request #76706 from hyp/eng/android-lld
[android][build.ps1] use the newly built lld when linking swift runti…
2024-10-02 10:10:31 -07:00
Saleem Abdulrasool
069302e502 utils: do not allow the compiler mismatch for the STL
When using a development toolchain or the 6.0 toolchain, do not allow
the mismatch of the compiler as we have a new enough compiler.
2024-09-25 15:12:43 -07:00
Alex Lorenz
66715b6c2c [android][build.ps1] use the newly built lld when linking swift runtime for android
the linker in the NDK might be too old, and not support all relocations, so we should use the lld we have just built in the toolchain
2024-09-25 11:50:58 -07:00
Jeremy Schonfeld
6a5ae8d5df Copy Testing modules/binaries in Install-Platform (#76352)
* Copy Testing modules/binaries in Install-Platform

* Copy full Testing.swiftmodule directory rather than individual files

* Fix Copy-Directory command
2024-09-25 08:21:21 -07:00
Hiroshi Yamauchi
b2cb3758f9 Merge pull request #76563 from hjyamauchi/mimalloc
Implement the mimalloc option to speed up the compiler on Windows
2024-09-23 09:40:55 -07:00
Hiroshi Yamauchi
7b437ea4e4 Implement the mimalloc option to speed up the compiler on Windows
This is disabled by default.
2024-09-19 12:23:26 -07:00
Rintaro Ishizaki
ff0f9232aa [Windows] Teach Build-Testing how to find Foundation
Pass `Foundation_DIR` to the cmake.
2024-09-16 12:30:53 -07:00
Saleem Abdulrasool
adf3bde077 Merge pull request #76290 from compnerd/targets
utils: make `-BuildTargets` optional in build.ps1
2024-09-09 13:51:36 -07:00