Commit Graph

1225 Commits

Author SHA1 Message Date
Guillaume Lessard
df33b83c78 [StdlibUnittest] add a TestRunPredicate for WASI 2025-03-21 15:47:25 -07:00
Alejandro Alonso
5d745fe5d5 Update MinimalCollections.swift 2025-03-13 10:50:06 -07:00
Alejandro Alonso
0646c61cf5 Fix bidirectional test to account for RandomAccess 2025-03-13 10:11:51 -07:00
Nate Cook
ff86a69dd7 Add a StdlibUnitTest modifier for requiring a stdlib version (#79838)
It would be great if this could also set the availability for the `code:`
block, but this at least cuts out some boilerplate.
2025-03-08 13:07:20 -06:00
Alejandro Alonso
708d72d2c3 Update tests for 6.1 Unicode 16 stdlib 2025-01-15 14:09:57 -08:00
Allan Shortlidge
17fd27554b stdlib: Adopt internal imports to suppress some warnings in tests. 2024-11-13 09:51:29 -08:00
Daniel Rodríguez Troitiño
63022333d8 [unittest] Disambiguate references to errno (#77155)
In Xcode 16 SDKs there seem to be two `errno` visible for some files,
one in the `Darwin` module, and one in the `_errno` module (which seems
new for this Xcode version).

Disambiguate the references by prepending `Darwin`, which should be the
one that was being used before Xcode 16 SDKs.
2024-10-22 15:48:56 -07:00
Alastair Houghton
0963036734 [Build] Make sure we declare LINUX_STATIC dependencies on Musl.
Everywhere there's a `SWIFT_MODULE_DEPENDS_LINUX Glibc`, there should be
a corresponding `SWIFT_MODULE_DEPENDS_LINUX_STATIC Musl`.

This usually won't bite us, depending on build order and parallelism, but
I hit one of these yesterday so went looking to see if there were any
others.

rdar://136208589
2024-09-18 09:40:58 +01: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
Alexander Cyon
c21b1e68fd [stdlib] Fix typos 2024-07-06 13:09:57 +02:00
Alex Lorenz
57b89d5303 [android] add an android NDK Swift overlay module, and use it instead of Glibc 2024-05-28 12:57:38 -07:00
Alastair Houghton
0fa5e65bb2 [Stdlib][Build] Fix the standard library build for fully static Linux.
Mostly this just means adding `Musl` as a module dependency of various
things and making sure that we build things for `swift_static` even
if `SWIFT_BUILD_STATIC_STDLIB` isn't enabled.

There's also a slight difference in the declaration of `memcmp()`;
musl's declaration is more like the one we have on Darwin.

rdar://123508245
2024-05-07 16:56:20 +01: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
Finagolfin
09ef130457 [android] Update to LTS NDK 26c
NDK 26 renamed the directory in which it places the Android compiler-rt from
`lib64/`, and added a bunch of nullability annotations to the Bionic libc.
2024-02-28 22:11:38 +05:30
Max Desiatov
633d5bc45a Enable x86_64 and i686 ELF triples for embedded Swift (#70642)
This is just as useful for x86 bare metal as the already enabled `arm*-none-none-eabi` triples.
2024-01-26 21:39:17 +00:00
Guillaume Lessard
50b83c8e69 Merge pull request #68423 from glessard/se0405-take2
[se-0405] rename `String.init(validatingUTF8:)`
2024-01-22 09:29:21 -08:00
Daniel Rodríguez Troitiño
e2d420835d [test] Make BlocksRuntimeStubs use never_install component. (#70545)
For some reason, 4 years ago, in ea90256 I added this target to `dev`,
which does not make sense because these stubs are only intended for
testing. Make them `never_install` to avoid distributing them when doing
`install-dev`.
2023-12-19 18:05:43 -08:00
Nate Chandler
10ce0c6b16 [SILGen] Used move_value for lexical lets.
Instead of using begin_borrow [lexical] + copy_value.
2023-12-14 13:35:26 -08:00
Ian Anderson
4dbc58723a [CMake] [Darwin] Don't add the Darwin overlay as a dependency if the overlays aren't being built
Allow for the overlays to not be built in Darwin by respecting SWIFT_BUILD_SDK_OVERLAY.
2023-10-17 11:03:57 -07:00
Yuta Saito
cdd01f9df2 [wasm][cmake] Add WASI specific stdlib dependencies
WASI target has its own libc module WASILibc, so we need to add it as
well as other libc modules.
2023-09-25 18:18:50 +00:00
Guillaume Lessard
0c916f507d [stdlib] replace uses of String(validatingUTF8:)
- use the new name `String(validatingCString:)`
2023-09-11 14:17:05 -07:00
Max Desiatov
fc1043ec3b StdlibUnittest: fix building with WASI (#67394)
This file can now be built for WASI when `WASILibc` is imported. Only slight branching is needed to disable child process spawning for this platform.
2023-07-19 18:51:40 +01:00
Max Desiatov
972af58bba WASI: support emulated signals in InterceptTraps.cpp (#67393)
When building with `_WASI_EMULATED_SIGNAL` excluding signal support on WASI is no longer needed.
2023-07-19 18:50:54 +01:00
Mike Ash
ea6a2e26f2 [Test] Remove stdlib/NSStringAPI.swift and some supporting code.
This is testing the Foundation overlay, which is no longer part of the Swift project.
2023-07-12 12:18:58 -04:00
Max Desiatov
9943f73d0f SwiftPrivate/IO.swift: unify #if canImport checks on non-Windows platforms (#67142)
This simplifies the import statements and adds support for WASILibc.
2023-07-06 10:16:41 +01:00
Max Desiatov
21a2b78801 stdlib/benchmark: add canImport(Musl) where needed (#67120)
This allows compiling stdlib and benchmarks when targeting musl instead of Glibc.
2023-07-05 19:55:08 +01:00
Yuta Saito
21d1e961bc [build] Fix cmake config for reflection test without dynamic stdlib
Build SwiftReflectionTest only if swift-reflection-test is available
because it depends on the tool and the tool is not available when no
dynamic stdlib is built
2023-06-29 11:22:38 +00:00
swift-ci
6b19b852e9 Merge pull request #65953 from Catfish-Man/contiguous-conundrum-tests-2
Add some tests for default implementations on RangeReplaceableCollection
2023-05-18 21:29:27 -07:00
David Smith
9beb1c1147 Build fix 2023-05-18 16:54:25 -07:00
Doug Gregor
8b4fe6be18 Eliminate some unnecessary shadowing generic parameters 2023-05-17 11:04:11 -07:00
David Smith
42d60c3c9c Add some tests for default implementations on RangeReplaceableCollection 2023-05-16 12:27:27 -07:00
Alejandro Alonso
cc62bb1ddc Update copyright years 2023-03-29 10:35:30 -07:00
Alejandro Alonso
f16f0c3c23 Update the stdlib to use Unicode 15 data 2023-03-29 10:18:16 -07:00
Anton Korobeynikov
9c227626b8 Enable propagation of @differentiable attribute from storage declarations to setters. (#63988)
Fixes #63169 and TF-129
2023-03-06 07:57:19 -08:00
Erik Eckstein
712fd7922b Merge remote-tracking branch 'origin/main' into rebranch 2023-01-09 08:48:47 +01:00
Karoy Lorentey
c94556165e Merge pull request #62794 from lorentey/character-recognizer
[stdlib] Export grapheme breaking facility
2023-01-04 23:54:48 -08:00
Karoy Lorentey
4d9edad297 [test] Improve grapheme breaking tests
Instead of just checking the number of breaks in each test case,
expose and check the actual positions of those breaks, too.
2022-12-29 17:56:45 -08:00
Evan Wilde
f8a54181a9 Zipper all the things!
This patch goes through and adds zippering and the swift module
dependencies to a bunch of pieces of the swift runtimes. Here's to
hoping I hit everything that needed to be hit. :D

With this patch, I'm seeing the appropriate modules under
lib/swift/maccatalyst, so things seem to be working right.
2022-12-22 13:41:59 -08:00
swift-ci
1250635d84 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-08 17:33:17 -08:00
Saleem Abdulrasool
309976fe6d Merge pull request #62175 from mhjacobson/freebsd-make-SwiftReflectionTest-depend-on-Glibc
SwiftReflectionTest: add dependency on Glibc module on FreeBSD
2022-12-08 20:26:19 -05:00
swift-ci
097fc7f780 Merge remote-tracking branch 'origin/main' into rebranch 2022-12-03 07:56:29 -08:00
Jonathan Grynspan
e057172b6f Make _swift_willThrow atomic (#62349)
* Make _swift_willThrow atomic
2022-12-03 10:41:56 -05:00
Matt Jacobson
894abd5c3e SwiftReflectionTest: add dependency on Glibc module on FreeBSD 2022-11-18 04:46:52 -05:00
Erik Eckstein
6f8fdc03d0 stdlib: upgrade C++ standard of StdlibUnittest from C++14 to C++17 2022-11-15 17:23:08 +01:00
Saleem Abdulrasool
b841523e4f Merge pull request #61799 from mhjacobson/freebsd-define-RTLD_DEFAULT
stdlib: define RTLD_DEFAULT for FreeBSD
2022-11-11 12:47:48 -08:00
Matt Jacobson
90e466b1a8 stdlib: define RTLD_DEFAULT for FreeBSD
It's defined the same as on Darwin and OpenBSD.
2022-10-29 04:58:52 -04:00
Robert Widmann
25e1c9f52a Add Missing _StringProcessing Dependencies
These two modules themselves depend on modules that implicitly import the _StringProcessing library. Take OSLog as an example, which imports ObjectiveC, which implicitly imports _StringProcessing. Thus, we can get into the following bad scenario:

- A compiler at module format X builds _StringProcessing
- A rebase is performed and the compiler is rebuilt at module format Y > X
- OSLog builds before _StringProcessing (since it has no dependency)
- But _StringProcessing is at module format X < Y, so we have to rebuild it

This normally manifests as an error at the desks of compiler engineers about a mismatch in the module format for _StringProcessing. Let's fix that by making CMake schedule _StringProcessing before them.
2022-10-25 13:40:52 -07:00
Alexis Laferrière
fbf0f5a8e2 [OSLog] Add missing imports for implicit uses of NSObject 2022-06-29 12:11:19 -07:00