Commit Graph

709 Commits

Author SHA1 Message Date
Alejandro Alonso
7e0eaf7b99 Remove metadata section functions from the stdlib (#39236)
add aliases in test suite
2021-09-14 11:55:39 -07:00
Alexis Laferrière
bccea96fcc [Test] Use -parse-stdlib to avoid loading an incompatible stdlib
Tests using a mock SDK can't load the stdlib of the normal SDK (or the
just-built one) with the recent changes. Use `-parse-stdlib` in those
tests to prevent loading the stdlib implicitly.
2021-09-13 16:44:16 -07:00
Karoy Lorentey
2c50ae5118 [test] stability-stdlib-abi*: Mask out unstable parts of private names
The type `Hasher._Core` is `@frozen` but its stored properties are `private`, which currently makes them show up in api-digester ABI reports, leading to failures like this one:

```
+Var Hasher._Core._buffer has mangled name changing from 'Swift.Hasher._Core.(_buffer in _A19879A32F7D08A6DD54BABBA00BBA0C) : Swift.Hasher._TailBuffer' to 'Swift.Hasher._Core.(_buffer in _16630011A164FCBB1F12E5E0A3A7C863) : Swift.Hasher._TailBuffer'
```

These names aren't ABI impacting, so this checker probably should ignore their name changes. (The property names do appear in the .swiftinterface files, but IIUC the only their type and ordering matters.)

These ever-changing unstable ids make it impossible to add an entry to the expectation list that would allow these tests to pass. Work around this issue by postprocessing the reports to replace the unstable parts with the constant string `#UNSTABLE ID#`.

rdar://82552099
2021-09-01 17:39:52 -07:00
Xi Ge
d7f5dc4b28 ABIChecker: diagnose mangled name changes
Moving generic constraint from extension to its member or vice versa may change the mangled name
of the member without changing the generic signature, thus introducing ABI breakages. This change
teaches the ABI checker to diagnose USR (mangled name) changes to cover such cases.

rdar://78276290
2021-08-23 17:06:37 -07:00
Xi Ge
3d8fcf20f3 ABIChecker: include import decls in the intermediate JSON file
Removing an import statement can be potentially source-breaking. We should
prepare for diagnosing such case.
2021-08-18 15:55:00 -07:00
Xi Ge
ed13a2f0e4 ABI checker: require explicit @available attributes for new APIs
Before this change, the ABI checker didn't complain about missing @available
attributes on new APIs if the enclosing scopes of new APIs have
availability information. Instead, we should require explicit @available attributes
for new APIs to prevent them inheriting wrong availability information from a
preexisting scope.

rdar://81719628
2021-08-10 11:24:08 -07:00
Stephen Canon
a3ba517837 Mark legacy overloads of &+ and &- unavailable. (#38723)
These were defined for both FixedWidthInteger and FixedWidthInteger & SignedInteger for source compatibility with Swift 3; the latter set probably should have been removed when we stabilized the ABI, but were not. We can't easily remove them entirely (because we need them for ABI stability now), but we can mark them unavailable so that the typechecker doesn't have to consider them..
2021-08-05 21:18:48 -04:00
Guillaume Lessard
63aef41138 [test] list expected changes to MutableCollection 2021-07-28 10:29:18 -06:00
Ted Kremenek
6a1e58a5c3 Merge pull request #38103 from kylemacomber/never-identifiable
Conform Never to Identifiable
2021-07-02 19:31:24 -07:00
Owen Voorhees
d5cf49b399 Merge pull request #37991 from owenv/digester-disable-fail-on-error 2021-06-30 22:35:56 -07:00
Kyle Macomber
4c169c12ba Conform Never to Identifiable
rdar://75988520
2021-06-28 20:11:55 -07:00
Owen Voorhees
734d7ae058 [APIDigester] Add a -disable-fail-on-error option 2021-06-20 11:00:13 -07:00
Xi Ge
aff404dfc6 ABIChecker: diagnose missing convenience inits only when checking source compatibility
rdar://76790246
2021-06-15 10:53:49 -07:00
Mishal Shah
23c3b15f5f Support Xcode 13 beta
* Updating availability versions
* Remove all remaining overlays in stdlib/public/Darwin/*:
   - ObjectiveC
   - Dispatch
   - CoreFoundation
   - CoreGraphics
   - Foundation
2021-06-07 12:04:31 -07:00
Owen Voorhees
07fb294c8a [APIDigester] Provide a category when serializing diagnostics representing API or ABI breakage 2021-05-04 19:35:35 -07:00
Karoy Lorentey
40529fbe25 [stdlib][test] Update stdlib abi test docs 2021-04-28 15:39:01 -07:00
Karoy Lorentey
b11c6e42ea [stdlib][test] Update stdlib abi test docs 2021-04-28 14:10:06 -07:00
Luciano Almeida
ca8ffdcc47 [tests][SR-9425] Adapt existing api-digester tests cases to new enum equatable witness 2021-04-20 19:50:13 -03:00
Doug Gregor
fcd5d43457 Revert "stdlib: Add reasync variants of '&&', '||' and '??'" 2021-04-05 16:45:44 -07:00
Slava Pestov
c473869141 stdlib: Add reasync variants of '&&', '||' and '??'
Fixes rdar://problem/72770687.
2021-03-31 19:21:08 -04:00
tbkka
26ab27648e Casting from AnyHashable to AnyHashable should never create another wrapper (#36470)
* Casting from AnyHashable to AnyHashable should never create another wrapper

This adds a conformance for _HasCustomAnyHashableRepresentation to
AnyHashable that simply returns self.  This ensures that anytime
you try to create a new AnyHashable wrapper for an existing
AnyHashable, you just get back the original.

Resolves rdar://75180619

* Move the `Struct AnyHashable` change to `without-asserts` list

As suggested by @lorentey
2021-03-22 09:03:29 -07:00
Doug Gregor
9579390024 [SE-0304] Rename ConcurrentValue to Sendable 2021-03-18 22:48:20 -07:00
Doug Gregor
7496701c9f Limit ConcurrentValue inference to non-public, non-frozen structs and enums 2021-03-02 16:26:08 -08:00
Doug Gregor
b5e4b085aa Infer ConcurrentValue conformances for structs and enums.
When a struct or enum has only ConcurrentValue-conforming instance
data, infer conformance to ConcurrentValue.
2021-03-02 00:23:33 -08:00
Doug Gregor
267838db44 Undo change to "expected" output. It was in the wrong place 2021-02-22 16:00:20 -08:00
Doug Gregor
364b245b4a Update test for intentionally-benign ABI change to standard library 2021-02-22 07:25:23 -08:00
Doug Gregor
d9e4184742 Make Error and CodingKey conform to ConcurrentValue.
Make both Error and CodingKey conform to ConcurrentValue, so that
thrown errors always conform to ConcurrentValue. Downgrade (to
warnings) and ConcurrentValue-related diagnostics that are triggered
by this change in existing Error and CodingKey-conforming types to
reduce the impact on source compatibility.
2021-02-20 22:01:28 -08:00
Doug Gregor
06dc593cec Merge pull request #35264 from DougGregor/concurrent-value-protocol
[Concurrency] Introduce "ConcurrentValue" protocol and checking.
2021-02-05 10:28:26 -08:00
Doug Gregor
866a8d8944 Introduce checking for ConcurrentValue conformance across actors.
When referring to an actor-isolated declaration from outside of the
actor, ensure that the types involved conform to the `ConcurrentValue`
protocol. Otherwise, produce a diagnostic stating that it is unsafe to
pass such types across actors.

Apply the same rule to local captures within concurrent code.
2021-02-03 17:37:43 -08:00
Karoy Lorentey
70584f92b7 [test] Reinstate stdlib ABI checks
The noasserts flavor was previously XFAILed.

rdar://72856256
2021-02-02 21:32:07 -08:00
Doug Gregor
5897dbed5c Update tests for deterministic serialization/printing of members 2021-01-20 13:40:48 -08:00
Mishal Shah
79324dfb4c Disable stability-stdlib-abi-without-asserts.test (72856256) 2021-01-07 09:41:05 -08:00
Nate Cook
e56a76baa7 Update API Digester test w/ temporary RangeSet removal (#35160) 2020-12-19 12:00:50 +00:00
Nate Cook
c35b567001 Temporary removal of RangeSet/DiscontiguousSlice (#35076) 2020-12-14 08:42:01 -06:00
Erik Eckstein
7f6d86655e stdlib: add availability attributes to the COW debug checking functions.
This is only relevant for assert builds of the library.
Fixes an undefined symbol error if an executable, compiled with an assert build of the stdlib, is back deployed on a platform which does not support lazy symbol binding.

rdar://problem/71201102
2020-11-13 10:41:25 +01:00
Xi Ge
00577acacd ABI checker: when invoking via build system, explicitly mention ABI breakge in diagnostics
The error messages emitted from the ABI checker are mostly explanations of breakages. We should
explicitly mention why they are emitted to differentiate them from other compiler diagnostics.

rdar://68864860
2020-09-14 10:50:28 -07:00
Xi Ge
950eb74e67 ABI Checker: use lower-cased decl keywords to be consistent with source. NFC 2020-09-12 10:35:03 -07:00
Xi Ge
55e77785df ABI checker: add a mechansim for specifying allowd ABI breakages
When the checker found a breakage listed in the user-specified list,
the breage should be consumed internally without failing the check.

rdar://68086477
2020-08-31 10:57:15 -07:00
Xi Ge
5faedbd1ab Merge pull request #33667 from nkcsgexi/allow-list-rename
ABIChecker: rename argument -protocol-requirement-white-list to -protocol-requirement-allow-list. NFC
2020-08-27 16:52:34 -07:00
Xi Ge
103b61c8be ABIChecker: rename argument -protocol-requirement-white-list to -protocol-requirement-allow-list 2020-08-27 12:06:25 -07:00
Xi Ge
1a44db3dcf ABIChecker: exclude decls with the @_alwaysEmitIntoClient attribute
Removing or updating @_alwaysEmitIntoClient functions are never ABI-breaking, thus
we should exclude them from the symbol set for ABI stability checking.

rdar://67883661
2020-08-27 10:58:48 -07:00
Xi Ge
8f72547e2f [test] ABIChecker: add a test for -use-interface-for-module flag 2020-08-25 16:40:59 -07:00
Slava Pestov
92bc89b78f GSB: Add an inferred AnyObject constraint to @objc protocol requirement signatures
This simplifies GenericSignatureImpl::requiresClass(), which no longer
has to look through the conformances of the equivalence class.
2020-08-13 00:23:47 -04:00
Saleem Abdulrasool
84ea2a984b SR-13362: no baseline is available for the standard library on ASi
The standard library on non-Intel targets get compared to the baseline
from the Intel targets which is not guaranteed to be identical.  Mark
the checks as expected failures on non-x86_64 targets.  Although this is
entirely unsatisfying, it allows progress in the short term.
2020-08-07 09:12:03 -07:00
Vedant Kumar
2308bb18b1 Add _getMetadataSection{,Count,Name} to API digester allow list (#33138)
These APIs are needed to build SwiftReflectionTest.swift when testing
Release builds.

This rolls back 014918c0, which hid these APIs in non-asserts builds
causing a failure:

  https://ci-external.swift.org/job/oss-swift-RA-linux-ubuntu-16.04-android-arm64/5708/consoleText

rdar://66103895
2020-07-28 15:19:18 -07:00
Meghana Gupta
c042638a37 Merge pull request #33098 from meg-gupta/updatestyle
Update code as per Apple Style Guide
2020-07-25 07:44:44 -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
Meghana Gupta
b34791a0a0 Update code as per Apple Style Guide
whitelist -> allowlist
blacklist -> denylist
2020-07-24 11:37:15 -07:00
Karoy Lorentey
a8c785b58a [test] Update & reenable stdlib ABI stability tests 2020-07-17 21:59:45 -07:00
Mishal Shah
40d00247f0 [Apple Silicon] [Test] Remove explicitly-specified target. 2020-07-02 19:14:56 -07:00