Skip to content

Run stable ABI tests on all Apple platforms #24833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

slavapestov
Copy link
Contributor

A number of tests exercise features only available in Apple OSes that
shipped with Swift 5.0 in the OS; this includes the following versions:

  • macOS 10.14.4
  • iOS 12.2
  • tvOS 12.2
  • watchOS 5.2

Previously these tests were restricted to running on macOS only, with
an explicit -target x86_64-apple-macosx10.14.4. To get better test
coverage, add a new %target-stable-abi-triple substitution which
expands to a triple with the correct OS version on all Apple platforms.

On non-Apple platforms, this is the same as %target-variant-triple,
but for now any test that uses this exercises Apple platform features
anyway.

One caveat is that since iOS 12.2 does not have a 32-bit slice, we
have to skip any tests that use -target %target-stable-abi-triple
on this platform. A new swift_stable_abi feature flag can be tested
with 'REQUIRES: swift_stable_abi'. To get maximum test coverage,
I split off a 'stable_abi' version of a few tests that build with both
an old and new deployment target. This allows the old deployment
target case to still be tested on 32-bit iOS.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good. I'd suggest explicitly using %target-pre-stable-abi-triple more often, though—even though that's our default in the normal configurations, I'm not sure it is for the Apple-internal bots that test Swift-in-the-OS. @Rostepher, @clackary, do you happen to know?

test/lit.cfg Outdated
@@ -568,6 +568,44 @@ if config.benchmark_o != 'Benchmark_O':
# Add substitutions for the run target triple, CPU, OS, and pointer size.
config.substitutions.append(('%target-triple', config.variant_triple))

if platform.system() == 'Darwin':
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird to check this via the host rather than the target. run_vendor == 'apple' should be good enough.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds reasonable.

stable_version)
else:
config.pre_stable_abi_triple = config.variant_triple
config.stable_abi_triple = config.variant_triple
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should config.stable_abi_triple be NO_STABLE_ABI or something on other platforms?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to leave the possibility of writing tests that use stable ABI on Apple platforms but don't care elsewhere.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, okay.

@slavapestov slavapestov force-pushed the cross-platform-stable-abi-tests branch from 4f37677 to d3c96c2 Compare May 16, 2019 18:17
@slavapestov
Copy link
Contributor Author

@jrose-apple Please take a look. I added -target %taget-pre-stable-abi-triple in a few spots too.

@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 4f37677fd74c229eda08bc5c48838cb26d9e6aa9

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 4f37677fd74c229eda08bc5c48838cb26d9e6aa9

Copy link
Contributor

@jrose-apple jrose-apple left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tentatively looks all right to me, but I'd be vigilant for issues in our internal CI while this merges through.

# iOS 12.2 does not support 32-bit targets, so we cannot run tests that
# want to deploy to an iOS that has Swift in the OS.
if run_os == 'ios' and run_ptrsize == '32':
pre_stable_version = '10'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

10.3, really, but this is fine too.

@slavapestov slavapestov force-pushed the cross-platform-stable-abi-tests branch from d3c96c2 to 1f95aeb Compare May 16, 2019 20:33
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - d3c96c2dd4d3b7273d579f2ade25739f34e62338

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - d3c96c2dd4d3b7273d579f2ade25739f34e62338

A number of tests exercise features only available in Apple OSes that
shipped with Swift 5.0 in the OS; this includes the following versions:

- macOS 10.14.4
- iOS 12.2
- tvOS 12.2
- watchOS 5.2

Previously these tests were restricted to running on macOS only, with
an explicit -target x86_64-apple-macosx10.14.4. To get better test
coverage, add a new %target-stable-abi-triple substitution which
expands to a triple with the correct OS version on all Apple platforms.

On non-Apple platforms, this is the same as %target-variant-triple,
but for now any test that uses this exercises Apple platform features
anyway.

One caveat is that since iOS 12.2 does not have a 32-bit slice, we
have to skip any tests that use -target %target-stable-abi-triple
on this platform. A new swift_stable_abi feature flag can be tested
with 'REQUIRES: swift_stable_abi'. To get maximum test coverage,
I split off a 'stable_abi' version of a few tests that build with both
an old and new deployment target. This allows the old deployment
target case to still be tested on 32-bit iOS.
@slavapestov slavapestov force-pushed the cross-platform-stable-abi-tests branch from 1f95aeb to 5d66bb8 Compare May 16, 2019 21:02
@slavapestov
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 1f95aeb10bcc1a7e74b5c9ff75dc2d2bd2530fe1

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 1f95aeb10bcc1a7e74b5c9ff75dc2d2bd2530fe1

@slavapestov slavapestov merged commit 49b19f5 into swiftlang:master May 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants