Commit Graph

284 Commits

Author SHA1 Message Date
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
a8255f2601 abi-checker: allow ABI checker to deserialize @_implementationOnly modules on demand
This could prevent the tool from crashing when module recovery failed.
2020-08-11 10:41:01 -07:00
Meghana Gupta
b34791a0a0 Update code as per Apple Style Guide
whitelist -> allowlist
blacklist -> denylist
2020-07-24 11:37:15 -07:00
Xi Ge
4448a229df ABI-checker: include Swift symbols only when ABI checking is enabled
ABI checking logics are largely Swift-specific, so we should exclude
symbols from the underlying Clang module.

rdar://64373983
2020-06-16 16:41:07 -07:00
Karoy Lorentey
68351d2110 Revert "Merge remote-tracking branch 'origin/master-next'"
This reverts commit 1c9b0908e6, reversing
changes made to 3eb82c1836.
2020-06-08 16:48:38 -07:00
swift_jenkins
45975414d9 Merge remote-tracking branch 'origin/master' into master-next 2020-05-23 18:58:49 -07:00
Xi Ge
c5730beb42 API checker: only diagnose adding enum cases to exhaustive enums
Adding new cases to a non-exhaustive enum type isn't source-breaking
since it only triggers a warning.

rdar://63464929
2020-05-23 15:56:22 -07:00
swift_jenkins
66e1d00d86 Merge remote-tracking branch 'origin/master' into master-next 2020-05-11 11:19:10 -07:00
Xi Ge
9883e664b2 ABIChecker: don't diagnose missing availability attribute for decls where the attribute doesn't apply
rdar://62990671
2020-05-11 08:35:11 -07:00
swift_jenkins
b441bd2a5f Merge remote-tracking branch 'origin/master' into master-next 2020-04-27 21:18:36 -07:00
Xi Ge
6b6a65fd5b ABI Checker: add an option to serialize diagnostics to a file path 2020-04-27 16:51:08 -07:00
swift_jenkins
ebc4926f8b Merge remote-tracking branch 'origin/master' into master-next 2020-04-21 09:57:24 -07:00
Xi Ge
7f8b5f7ead ABI-checker: specify default baseline file names for non-Darwin platforms
rdar://62111064
2020-04-21 09:26:37 -07:00
Michael Forster
21adecc9c2 Another StringRef -> std::string conversion fix.
This is needed to make this code compile on master-next.
2020-04-21 06:28:30 +02:00
Xi Ge
701ad83d87 Merge pull request #31141 from nkcsgexi/abi-checker-baseline-directory
ABI-checker: add an option to dump generated baselines into a directory. NFC
2020-04-20 16:18:33 -07:00
Xi Ge
c68c1234b4 ABI-checker: add an option to dump generated baselines into a directory. NFC
Using a directory instead of an exact file name for the generated
baseline allows the tool to use target triple as file name, which is
expected by the diagnostic phase.
2020-04-20 14:31:58 -07:00
Michael Forster
00b09c723c More StringRef -> std::string conversion fixes.
This is needed for the master-next branch.
2020-04-20 09:47:41 +02:00
Xi Ge
4effe03d07 ABI-checker: allow users to specify a directory containing baseline files. NFC
The ABI-checker tool could pick up a baseline file to use according to
the given target triple.
2020-04-18 14:39:22 -07:00
Xi Ge
140a151de1 ABI-checker: diagnose missing available attributes for members of extensions instead of the extensions themselves
rdar://61644469
2020-04-11 19:00:49 -07:00
Xi Ge
cec45195a2 APIChecker: adding enum cases are source breaking changes
rdar://60041622
2020-03-05 16:23:49 -08:00
swift_jenkins
70bfa0cfc1 Merge remote-tracking branch 'origin/master' into master-next 2020-01-06 12:17:27 -08:00
Harlan Haskins
4d731735d2 [api-digester] Teach the api-digester about hasMissingDesignatedInitializers
Because we won’t be serializing this attribute, add custom diagnostics for the cases where:

- We add @_hasMissingDesignatedInits to an open class, which means subclasses won’t be able to inherit its inits
- We remove @_inheritsConvenienceInitializers, which means APIs are removed
2020-01-06 10:15:07 -08:00
swift_jenkins
b9f998ffa4 Merge remote-tracking branch 'origin/master' into master-next 2019-11-15 15:56:48 -08:00
Xi Ge
c8ce5b304c ABI/API checker: don't complain about changing var to let or vice versa
The tool diagnoses the removal of getter/setter for properties, so complaining about the keyword change can be redundant.

rdar://problem/57201030
2019-11-14 13:59:26 -08:00
Xi Ge
64c0680686 Merge remote-tracking branch 'apple/master' into master-next 2019-10-28 10:19:36 -07:00
Xi Ge
7d600eb27a ABI/API checker: teach the tool to emit diagnostics to serialized source location for decls 2019-10-17 16:31:56 -07:00
swift-ci
b71f094f77 Merge remote-tracking branch 'origin/master' into master-next 2019-09-16 18:29:18 -07:00
Xi Ge
8912ef9fd0 ABI/API checker: move node mapping information from under -v to under -debug. NFC 2019-09-16 15:30:02 -07:00
swift-ci
d628a95f15 Merge remote-tracking branch 'origin/master' into master-next 2019-09-12 17:10:18 -07:00
Xi Ge
78bb298389 ABI/API checker: diagnose adding new designated initializers to open classes
If client's subclass provides an implementation of all of its superclass designated
initializers, it automatically inherits all of the superclass convenience initializers.
This means if a new designated init is added to the base class, the inherited
convenience init may be missing and cause breakage.

SR-11454
2019-09-12 15:46:45 -07:00
swift-ci
7d42e53828 Merge remote-tracking branch 'origin/master' into master-next 2019-09-11 19:50:26 -07:00
Xi Ge
4189b6c99b AST: promote API/ABI impact bit of decl attributes to AST, NFC
ABI/API checker used to hard-code whether adding or removing of a
decl attribute could break the existing ABI/API. This is not ideal because
new attributes may be added to AST without updating the checker. After this
change, new decl attribute could be specified whether it has ABI/API
impact and the checker could pick up the knowledge instantly.
2019-09-11 17:58:36 -07:00
Mike Ash
1758566d35 Merge branch 'master' into master-next 2019-09-11 16:56:06 -04:00
Xi Ge
a7e8620582 ABI/API checker: include SDK version number when generating diagnostic baselines 2019-09-10 17:00:46 -07:00
Jordan Rose
eefb0d0644 Merge remote-tracking branch 'origin/master' into master-next 2019-09-04 14:01:43 -07:00
Xi Ge
d8b611d060 ABI/API checker: teach the tool to diagnose against a builtin empty baseline
Framework authors may be interested in comparing the current framework build
against an empty baseline to find public APIs without @available attributes. This
change makes such exercise easier.
2019-09-04 11:07:39 -07:00
swift-ci
2a63b4224f Merge remote-tracking branch 'origin/master' into master-next 2019-09-01 12:30:03 -07:00
Xi Ge
cc6a246deb Revert "Revert "swift-api-digester: teach the tool to find framework-specific baselines from relative path"" 2019-09-01 09:19:43 -07:00
eeckstein
63a3cee0bf Revert "swift-api-digester: teach the tool to find framework-specific baselines from relative path" 2019-09-01 09:51:06 +02:00
Xi Ge
178e5d5ecf swift-api-digester: teach the tool to find framework-specific baselines from relative path
The framework baselines are installed at 'lib/swift/FrameworkABIBaseline' and the
tool is inside 'bin'. This patch teaches the executable to locate baselines
from the relative path.

In addition, this patch moves the stdlib ABI/API baselines to the canonical
location so we don't have to check the stability of the stdlib using a
different mechanism from other Swift frameworks.
2019-08-30 23:14:03 -07:00
swift-ci
ab6df6d527 Merge remote-tracking branch 'origin/master' into master-next 2019-08-28 14:29:46 -07:00
Xi Ge
6374d3676a ABI/API checker: diagnose ObjC name changes as breakages
rdar://54797695
2019-08-28 11:56:03 -07:00
Arnold Schwaighofer
02b908dca3 Merge remote-tracking branch 'origin/master' into master-next 2019-08-28 06:51:13 -07:00
Xi Ge
1e656662d9 Frontend: add a front-end option to specify module names for which we prefer to loading via interfaces
ABI checker imports Swift frameworks by using Swift interfaces for various
reasons. The existing way of controlling preferred importing mechanism is by
setting an environment variable (SWIFT_FORCE_MODULE_LOADING), which may lead
to performance issues because the stdlib could also be loaded in this way.

This patch adds a new front-end option to specify module names for
which we prefer to importing via Swift interface. The option currently is only
accessible via swift-api-digester.

rdar://54559888
2019-08-27 19:40:58 -07:00
swift-ci
354f95d983 Merge remote-tracking branch 'origin/master' into master-next 2019-08-27 13:30:46 -07:00
Xi Ge
4108beb92d ABI/API checker: always print fully qualified names for types when diagnosing module difference
This change introduces a Json format change where we always print fully
qualified type names everywhere. This is beneficial for diagnosing purposes but
may not be ideal for generating migrator scripts. To resolve this conflict, the
patch also introduces a flag -migrator to opt-out fully qualified type names.

After the format change, we need to update the ABI and API baselines for the
Swift stdlib.
2019-08-27 11:42:28 -07:00
Arnold Schwaighofer
2b41f8d8d5 Merge remote-tracking branch 'origin/master' into master-next 2019-08-26 08:57:42 -07:00