Commit Graph

4 Commits

Author SHA1 Message Date
Joe Groff
ca48939816 Compatibility51: Backport the 5.2 implementation of the conformance cache.
The runtime that shipped with Swift 5.1 and earlier had a bug that interfered with backward
deployment of binaries that dynamically check for protocol conformances on conditionally-available
tests. This was fixed in the top-of-tree Swift runtime by https://github.com/apple/swift/pull/29887;
however, that doesn't do much good for running binaries on older OSes that don't have that fix.
In order for binaries built with a newer Swift compiler to run successfully on older OSes,
introduce a compatibility hook that replaces the conformance cache implementation in the original
OS runtime with a version based on the current implementation that has the fix for the protocol
conformance bug. Fixes rdar://problem/59460603
2020-04-24 10:52:29 -07:00
Slava Pestov
d37cf8e47a Disable test_backward_deploy_conformance completely on Swift-in-the-OS bots
Fixes <rdar://problem/59670363>.
2020-02-21 13:09:05 -05:00
Slava Pestov
00ed9e4885 Disable test_backward_deploy_conformance.swift on Swift-in-the-OS bots
We need a backward compatibility shim before this can work.

Fixes <rdar://problem/59631880>.
2020-02-20 13:02:12 -05:00
Slava Pestov
1ca2b61f7a Runtime: Less eager instantiation of type metadata in the conformance cache
The ConformanceCandidate constructor would eagerly instantiate metadata for
all non-generic types in the conformance cache. This was not the intention
of the code though, because it can compare nominal type descriptors --
which are emitted statically -- for those types that have them, namely
everything except for foreign and Objective-C classes.

Change the order of two calls so that the lazy path has a chance to run.
This fixes a crash when type metadata uses weakly-linked symbols
which are not available, which can come up in backward deployment
scenarios.

Fixes <rdar://problem/59460603>.
2020-02-17 16:24:42 -05:00