Commit Graph

28 Commits

Author SHA1 Message Date
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
Kuba (Brecka) Mracek
6fe3ccc47d Drop read/write/close LibcShims and use the platform APIs directly from the SwiftPrivate module (#40211) 2022-02-08 15:32:49 -08:00
Daniel Rodríguez Troitiño
29e1b832ea [test] Move BlocksRuntimeStubs into its own folder under stdlib/.
BlocksRuntimeStubs is built for the target SDK(s), but it was using one
of the stdlib CMake helpers without setting up the same environment as
the stdlib/ folder is setting.

To avoid problems, like BlocksRuntimeStubs being built with the host
compiler, instead of the just built compiler, and other difficult to
understand problems, create a folder for it in stdlib/private/. This
will allow the usage of the stdlib CMake function in the same environment
that is normally used.
2020-11-24 15:28:59 -08:00
Kuba (Brecka) Mracek
d7dfa3e942 Bring up tests + validation tests for the 'freestanding' build and the standalone_minimal preset (#34386) 2020-10-26 16:32:36 -07:00
Augusto Noronha
3cb8f9b6fc Add entrypoints to the runtime that exposes metadata necessary for reflection tests on Linux (#32339) 2020-07-24 15:26:15 -07:00
marcrasi
ddef9292a6 [AutoDiff upstream] DifferentiationUnittest and some e2e tests (#30915)
Adds 2 simple e2e tests and some lit subsitutions and unittest libraries
necessary to support them.
2020-04-09 14:25:31 -07:00
Ravi Kandhadai
592bca7202 [oslog] [stdlib-private] Add a prototype of the new os_log swift APIs
that accept string interpolations.

The prototypes are added to stdlib/private directory and will be
used only in tests and in experimental code.
2019-03-14 15:26:21 -07:00
Saleem Abdulrasool
3225e36d63 stdlib: reorder add_subdirectory to repair the Windows build
Due to the horrible attrocities against software of the attempt to perform
cross-compilation in the swift build system, we need to emulate the linking
behaviour for Windows with the link against the import library.  The emulation
requires the custom creation of import library targets.  In order to actually
get the linking semantics correct, the dependendency targets must be created
prior to use (unlike standard CMake).  The reordering ensures that we get
correct linkage when building for Windows.

Perform a simple optimization to avoid a number of string comparisions for the
host system.
2018-12-14 13:56:16 -08:00
Saleem Abdulrasool
0693bec1f1 sdlib: rename SwiftPrivatePthreadExtras to SwiftPrivateThreadExtras
This is in preparation to make the code here more target agnostic for
porting to the Windows threading primitives.  This is used pretty
extensively in the tests, so disabling tests would lose a chunk of
coverage.
2018-11-26 13:09:31 -08:00
Andrew Trick
e560125d20 Create RuntimeUnittest library for C++ runtime unit tests from lit.
Create a new RuntimeUnittest library alongside the other stdlib unit
tests so we can write C++ runtime unit tests callable from lit.

Move runtime exclusivity tests into the stdlib unittest library and
create lit tests so we can verify that the runtime crashes with an
error message.
2018-10-13 10:06:35 -07:00
Dmitri Gribenko
1d6b08ba97 stdlib: share the Unicode dataset across different test files 2016-08-07 23:29:24 -07:00
Michael Gottesman
0258813113 Do not build SwiftReflectionTest when we are not including tests.
This avoids a cmake warning.
2016-07-19 13:38:36 -07:00
Brian Gesiak
83daa49a5a [CMake] Only build StdlibUnittest when SDK overlay is built
On Linux it used to be possible to build only the stdlib, without the
SDK overlays, like so:

```
utils/build-script -- --build-swift-stdlib --build-swift-sdk-overlay=0
```

However this invocation now results in the following error:

```
+ /usr/bin/cmake --build /home/modocache/GitHub/apple/build/Ninja-ReleaseAssert/swift-linux-x86_64 -- -j8 all swift-stdlib-linux-x86_64
ninja: error: '/home/modocache/GitHub/apple/swift/stdlib/private/SwiftPrivatePthreadExtras/swiftGlibc-linux-x86_64', needed by 'stdlib/private/SwiftPrivatePthreadExtras/linux/x86_64/SwiftPrivatePthreadExtras.o', missing and no known rule to make it
utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting
```

The problem is that SwiftPrivatePthreadExtras is always built, regardless
of whether the SDK overlay is built. I believe there's an explicit check
against this for Darwin platforms to prevent the same error.

The solution, implemented here, is to add the same check for Linux.
2016-06-16 14:29:30 -04:00
David Farler
790b7de5e4 Reenable building the SwiftReflectionTest library
This wasn't importing the Mach-O APIs from the right module.
2016-03-24 14:15:55 -07:00
David Farler
e65f685a23 Temporarily disable SwiftReflectionTest library builds
Some Mach APIs don't appear to resolve on iOS.
2016-03-24 12:40:59 -07:00
David Farler
0f62e6691c Add SwiftReflectionTest helper library
This is a small helper library to communicate information back to
swift-reflection-test from a test swift executable. Each swift test
file under test/Reflection should link this library to get the main
test hook to send responses back to the test tool.
2016-03-24 12:05:18 -07:00
Brian Gesiak
e7c022679d [stdlib] Rename "PrivateDarwin" to "PrivateLibc"
SwiftPrivateDarwinExtras is used by non-Darwin platforms as well; its
name is misleading. Rename it to SwiftPrivateLibcExtras, which is
closer to its actual function.
2016-02-22 11:07:24 -05:00
Dmitri Gribenko
b2290992fa Allow StdlibCollectionUnittest to be built on Linux and FreeBSD 2016-01-26 22:02:17 -07:00
Dmitri Gribenko
aeeb9c1325 Move collection testing code from StdlibUnittest to a new library
This brings down StdlibUnittest build time to 90 seconds with either
a DebugAssert or a ReleaseAssert compiler.

The new library, StdlibCollectionTests, is only built when running
validation tests.
2016-01-26 18:58:03 -08:00
Davide Italiano
f1b3965586 [stdlib] Port StdlibUnittest to FreeBSD. 2016-01-07 21:05:32 +00:00
Mishal Awadah
a77183c068 [stdlib] Removing unused library.
Fixes rdar://problem/23495046
2015-11-13 10:39:34 -08:00
David Farler
120ac7541c Move the glibc module to stdlib/public
Swift SVN r32050
2015-09-17 23:13:10 +00:00
Dmitri Hrybenko
d72ae21e7c When building the SDK overlay separately, build SwiftPrivate
SwiftPrivate is not installed in public releases of Xcode.

rdar://problem/20777797
rdar://problem/20780963

Swift SVN r28061
2015-05-02 00:24:12 +00:00
Dmitri Hrybenko
c421c51a42 StdlibUnittest: add facilities to replace NSLocale.currentLocale()
Will use this API to write tests for rdar://20171815.

Swift SVN r26391
2015-03-21 05:41:46 +00:00
Dmitri Hrybenko
b7498a1efd stdlib: add a private serialization API
These APIs will be used for writing automation tools in Swift.  Just
like other private APIs, this module is not exposed to extrenal users.

The primary motivation for doing instead of using NSCoder this is that
NSCoder does not work with structs and Swift containers.  Using classes
for everything just to satisfy NSCoder forces unnatural code.

This API requires two times (!) less boilerplate than NSCoding, since
the same method is used for serialization and deserialization.  This API
is also more type-safe, it does not require the user to write 'as' type
casts, unlike NSCoding.

Please take a look at
validation-test/stdlib/SwiftPrivateSerialization.swift to see the
intended use pattern.

The performance of the underlying implementation is already decent, and
there's a lot of room for improvement.

This is a re-commit of r25678, with a fix for 32-bit platforms.

Swift SVN r25877
2015-03-09 06:55:19 +00:00
Dmitri Hrybenko
350248dae5 Reorganize the directory structure under 'stdlib'
The standard library has grown significantly, and we need a new
directory structure that clearly reflects the role of the APIs, and
allows future growth.

See stdlib/{public,internal,private}/README.txt for more information.

Swift SVN r25876
2015-03-09 05:26:05 +00:00