Commit Graph

245 Commits

Author SHA1 Message Date
Alastair Houghton
0813e95569 Merge pull request #81440 from al45tair/currentos-availability
[Concurrency][Stdlib] Add SwiftStdlibCurrentOS availability, use it.
2025-07-07 12:04:00 +01:00
Michael Gottesman
243cfe0719 Merge pull request #79804 from gottesmm/pr-f26aec536f9d333150b49e0faf50a70a9a26ac53
Add a flag to enable-new-runtime-build that enables the new runtime build
2025-03-07 16:03:49 -08:00
Alex Hoppen
67f312cc2f Merge pull request #79834 from ahoppen/remove-syntax-lint
[build-script] Remove option to lint swift-syntax
2025-03-07 06:42:29 -08:00
Alex Hoppen
7256a92775 [build-script] Remove option to lint swift-syntax
This is being verified by GitHub Actions now as of https://github.com/swiftlang/swift-syntax/pull/2998.
2025-03-06 18:38:47 -08:00
Michael Gottesman
7418b42215 Add a flag to enable-new-runtime-build that enables the new runtime build.
What is nice about this is that by not using extra-cmake-args, we can avoid
passing this into LLVM as well when attempting to reproduce failures on the bots
(thus avoiding having to rebuild LLVM as well).
2025-03-05 14:10:26 -08:00
Michael Gottesman
f68e23aaf1 Merge pull request #79329 from gottesmm/pr-295dfc37ee8e5bf71b1249c2717a30c37de1aee2
[build-script] Add an option to force the linker used.
2025-02-14 21:09:09 -08:00
Michael Gottesman
3e2a6f6665 [build-script] Add an option to force the linker used.
I have been doing this using extra-cmake-args/etc... just feels better to have
an actual option to do this.

Just did this quickly while waiting for my Linux build to finish that uses
extra-cmake-args to set the linker.
2025-02-12 11:49:01 -08:00
Cyndy Ishida
3232df4d67 Reapply '[BuildSystem] Stop building for i386-watch-simulator (#77692)' (#79018)
* Reapply '[BuildSystem] Stop building for i386-watch-simulator (#77692)'

    * [BuildSystem] Stop building for i386-watch-simulator

    In Xcode16 it is not supported.

This initially broke client projects who were still building the legacy
architecture but now that's resolved.
2025-01-31 15:04:28 -08:00
Alastair Houghton
ca233af1ea [Backtracing] Fix Python test failure.
We needed to add `--enable-runtime-module` in the Python test scripts.

rdar://124913332
2025-01-21 19:02:47 +00:00
Alastair Houghton
760cc57bef [Backtracing] Rename _Backtracing to Runtime.
Move the backtracing code into a new Runtime module.  This means renaming
the Swift Runtime's CMake target because otherwise there will be a name
clash.

rdar://124913332
2025-01-17 10:09:36 +00:00
Yuta Saito
c68db65453 Merge pull request #78341 from kateinoigakukun/katei/add-sourcekit-lsp-verify
CI: Add `--sourcekit-lsp-verify-generated-files` build-script option
2025-01-16 01:09:43 +09:00
Yuta Saito
57cc7c28b9 CI: Add --sourcekit-lsp-verify-generated-files build-script option
To verify that autogenerated files in the source tree match the ones that
would be generated from source.
2024-12-21 19:03:07 +00:00
Henrik G. Olsson
ef9d2b744d Rename pointer bounds (#78210)
* Make pointer bounds non-experimental

* Rename @PointerBounds to @_SwiftifyImport

* Rename filenames containing PointerBounds

* Add _PointerParam exception to stdlib ABI test

* Add _PointerParam to stdlib API changes

* Rename _PointerParam to _SwiftifyInfo
2024-12-20 11:36:01 +01:00
Cyndy Ishida
1b869ef828 Revert "[BuildSystem] Stop building for i386-watch-simulator" (#77911)
* Revert "[Build] Fix swift_build_support tests."

This reverts commit fc2d1b3b23.

* Revert "[BuildSystem] Stop building for i386-watch-simulator (#77692)"

This reverts commit 1ab968d2b6.

This change can't be made without other issues fixed downstream first.
2024-12-03 23:17:12 -08:00
Cyndy Ishida
1ab968d2b6 [BuildSystem] Stop building for i386-watch-simulator (#77692)
* [BuildSystem] Stop building for i386-watch-simulator

In Xcode16 it is not supported.
2024-11-20 08:57:19 -08:00
Meghana Gupta
5b5acc64e0 Promote Nonescapable types to a language feature 2024-11-18 18:09:17 -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
Rintaro Ishizaki
3bc20a9596 [build-script] Enable new parser validation by default
Widen the parser validation coverage.
This encourages the developers to implement the new grammar in
SwiftParser in addition to the old C++ parser.

In case  there's an unavoidable reason not to implement in SwiftParser,
disable the validation for each test case by passing a frontend option
'-disable-experimental-parser-round-trip'. But please file an issue
and add FIXME like:

  // FIXME: Remove '-disable-experimental-parser-round-trip' (rdar://xxx).
2024-10-11 14:46:23 -07:00
Ian Anderson
5bf2c937ab [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

rdar://115192929
2024-09-11 22:26:37 -07:00
Artem Chikin
1baff87879 Revert "[CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms" 2024-09-09 09:57:14 -07:00
Ian Anderson
8959dd97fe [CMake] [Darwin] Don't build the SDK overlays by default on Apple platforms
The Apple SDKs have been providing the Darwin overlay since macOS 10.14.4, iOS 12.2, et al. More recently the SDK version has diverged from the Swift version making them incompatible. Stop building the overlay from Swift. Once the SDK overlays aren't being built, the clang overlays need to be built in testing.

%target-swift-emit-pcm doesn't use the sdk, but %target-swift-frontend does, which will cause them to have a mismatch with "builtin headers belong to system modules, and _Builtin_ modules are ignored for cstdlib headers" aka LANGOPT(BuiltinHeadersInSystemModules) aka -fbuiltin-headers-in-system-modules.

rdar://115192929
2024-09-06 13:28:14 -07:00
Vera Mitchell
c9cc58cd0b update build-script python tests 2024-09-03 13:52:43 -06:00
Rintaro Ishizaki
e98c5eab61 [build-script] Separate SwiftTestinMacros from SwiftTesting product
Also, build them for all hosts including cross compiling host.
2024-08-09 14:43:20 -07:00
Stuart Montgomery
97e85a6bf2 Build script changes to begin building and installing swift-testing into toolchains (on Darwin, so far) 2024-08-08 13:13:44 -07:00
Jeremy Schonfeld
f89db53698 Ensure Foundation tests don't run when passing --skip-foundation-tests (#75573) 2024-07-31 12:54:48 -07:00
Kuba Mracek
c9513c7925 [embedded] Add missing option to expected_options.py 2024-07-30 11:54:18 -07:00
Kuba Mracek
69964f9f22 [embedded] Don't build embedded stdlibs in 'standalone' builds 2024-07-30 10:42:55 -07:00
Finagolfin
6ede1c25e1 [android][build-script] Update the default arch to AArch64, as that is by far the most commonly used now 2024-07-20 17:56:51 +05:30
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
Carl Peto
ee57481d7c [AVR] AVR support - Initial PR
- Add simple support for the AVR architecture, as a supported conditional compilation value, and added to the default llvm targets to build.

(Later PRs will fix support for 16-bit pointers, which is broken in places, and any fixes needed to get the standard library to build.)

(Note: AVR as a target is expected to always be compiled with -enable-experimental-feature Embedded.)
2024-07-06 18:22:10 +01:00
Kuba (Brecka) Mracek
9e7501601c Merge pull request #74489 from kubamracek/embedded-less-stdlibs
[embedded] Don't build *all* the embedded stdlibs by default
2024-06-18 13:50:25 -07:00
Kuba Mracek
37ed08dc7b Add a build-script + CMake flag to enable/disable building the _Volatile module 2024-06-17 13:18:55 -07:00
Kuba Mracek
dc2edb6e9b [embedded] Don't build *all* the embedded stdlibs by default 2024-06-17 10:32:56 -07:00
Alastair Houghton
2056b26258 [Build] Move the .cfg file generation to a new product.
We need to move the `.cfg` file generation to a new product so that we can
land it in the default toolchain for Xcode.

rdar://128612098
2024-05-24 08:27:17 +01:00
Eric Miotto
ce0e620d1a [CMake] allow custom options when building the compiler with debug info
Currently those are hardcoded to `-g`, but in some Apple internal
configurations we would like to change them.

There are other part of the build system that hardcode `-g`
(e.g. in `SwiftCompilerSources` and `AddSwiftStdlib.cmake`),
but we are not interested in those at the moment -- we will address those
in the future if need be.

Supports rdar://127503136
2024-05-14 08:42:35 -07:00
Kuba Mracek
ab5425fc1f Update test expectations around --skip-build-lld 2024-05-09 15:46:48 -07:00
eeckstein
ade04a7945 Merge pull request #73417 from eeckstein/force-bootstrapping
Force enabling SwiftCompilerSources in the build
2024-05-07 07:55:23 +02:00
Erik Eckstein
410b81b447 Force enabling SwiftCompilerSources in the build
This means that `bootstrapping=off` cannot be used anymore.
2024-05-06 17:22:27 +02:00
Alastair Houghton
3627507eb1 [Build] Further static Linux SDK support changes.
Fix some indentation issues.

Change `build-script-impl` to make `build-linux-static` a positive argument.

Fix documentation for `--linux-archs` and `--linux-static-archs` (the options
are comma separated for `build-script`, but semicolon separated for
`build-script-impl`).

Set the default for `linux-static-archs` to `x86_64, aarch64` so that we
install the expected content in the toolchain.

Add missing default for `test_linux_static`.

Make sure to pass down `--skip-build-linux` and `--build-linux-static`.

Factor out config file generation and call it from the install step in `llvm.py`
as well as from the build step.

rdar://123503470
2024-05-03 09:12:49 +01:00
Alastair Houghton
bac73d012a [Build] Add options to the Python build script tests.
Apparently I'd failed to add a couple of lines here.

rdar://123503470
2024-05-02 14:56:18 +01:00
Alastair Houghton
fdc8ffd36f [Build] Updated following initial comments from Eric.
Change the `--linux[-static]-arch` option to `--linux[-static]-archs`, on the
basis that it supports multiple values.

Other tidying.

rdar://123503470
2024-05-02 14:56:18 +01:00
Alastair Houghton
ae1c0455f3 [Build] Add the new fully-static Linux SDK.
Declare a new `LINUX_STATIC` SDK and configure it.

Add options to set the build architectures for the `LINUX` and
`LINUX_STATIC` SDKs, similar to what we have for Darwin, because
we'll be cross-compiling.

Also add an option to point the build system at the sources for
the musl C library, which we're using for `LINUX_STATIC`.

rdar://123503470
2024-05-02 14:56:18 +01:00
Artem Chikin
01d891ad99 Merge pull request #72834 from artemcm/UpstreamVisionOS
Introduce visionOS Platform
2024-04-15 09:33:49 -07:00
Rintaro Ishizaki
a16ad9c274 Merge pull request #71173 from rintaro/cmake-parservalidatoin
[CMake] Add option to perform SwiftParser validation by default
2024-04-12 15:03:31 -07:00
Artem Chikin
1f14158a1d Introduce VisionOS Platform
This change introduces a new compilation target platform to the Swift compiler - visionOS.

- Changes to the compiler build infrastrucuture to support building compiler-adjacent artifacts and test suites for the new target.
- Addition of the new platform kind definition.
- Support for the new platform in language constructs such as compile-time availability annotations or runtime OS version queries.
- Utilities to read out Darwin platform SDK info containing platform mapping data.
- Utilities to support re-mapping availability annotations from iOS to visionOS (e.g. 'updateIntroducedPlatformForFallback', 'updateDeprecatedPlatformForFallback', 'updateObsoletedPlatformForFallback').
- Additional tests exercising platform-specific availability handling and availability re-mapping fallback code-path.
- Changes to existing test suite to accomodate the new platform.
2024-04-10 09:38:02 -07:00
Eric Miotto
0edd96e311 Merge pull request #72486 from edymtt/emiotto/add-flag-to-pass-arguments-to-dsymutil
build-script: add flag to pass arguments to dsymutil
2024-03-25 07:28:35 -07:00
Eric Miotto
efdd4954d3 build-script: add flag to pass arguments to dsymutil
This is currently needed to disable DWARF verification in
some Apple internal configurations.

Addresses rdar://125092216
2024-03-22 08:04:31 -07:00
Mike Ash
0491192337 [Runtime] Remove ExternalGenericMetadataBuilder. 2024-03-21 17:56:17 -04:00
Doug Gregor
922e3daaea Remove build infrastructure for globally enabling noncopyable types
Now that the compilation model of noncopyable types is enabled everywhere,
and one can enable the feature for specific modules, we no longer need a
separate build-script/CMake option to enable it globally. Remove it all.
2024-03-19 13:35:31 -07:00
Meghana Gupta
f3a85b118f Add build-script option and lit config for nonescapable_types
With this build-script has a flag --enable-experimental-nonescpable-types=1
to enable this feature in stdlib.

Also we can now add // REQUIRES: nonescapable_types to tests which run only when
the compiler is built with this feature turned on.
2024-03-06 21:57:03 -08:00