-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[test] Disable test on Linux that's ICU version-specific #20780
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linux could in theory have the ObjC runtime. Can we conditionalize this on "Darwin"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention for asking "is this a Darwin platform that has Apple's implementation of the objc runtime and Foundation" is spelled
#if _runtime(_ObjC)
. This is an internal conditional check (not exposed to users) and should return false on any Linux, where interop would otherwise be broken.This predates me and I don't really know why it's done this way, but it's followed consistently throughout the standard library in hundreds of places. CC @jrose-apple and @jckarter who might have opinions about this convention and whether it should change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It well predates
canImport
, which is at least part of the reason.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does
#if _runtime(_ObjC)
check whether the runtime is available or merely ObjC interoperability is enabled? I ask because there are a few tests that are run twice, once with interop and once without, and regardless of platform.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's asking if interop is enabled, i.e. "will the Swift runtime be one that interoperates with Objective-C".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@milseman – Can we please change this to "#ifdef darwin"? I'd really like to see the conflation of the ObjC runtime with the Darwin platform kept to a minimum.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have
-enable-objc-interop
which controls whether ObjC interop is present or not. Darwin and ObjC are not synonymous.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all practical purposes, they are. I would bet that any theoretical interop with any other ObjC runtime and Foundation implementation is going to require a lot more than a binary flag here, since the existing code paths for generating metadata and integrating with ObjC runtime and Foundation facilities are extremely specific to Apple's implementation. Maybe we can change the name to
_runtime(_AppleObjC)
and change the flag to-enable-objc-interop=apple
if it makes you all feel better, but I think this is the right condition to use in the standard library, regardless of what we name it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed https://bugs.swift.org/browse/SR-9358 for that.