-
Notifications
You must be signed in to change notification settings - Fork 10.5k
stdlib: fix availability for internal COW checks. #37945
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
stdlib: fix availability for internal COW checks. #37945
Conversation
@swift-ci smoke test |
27d1dce
to
e08b9b9
Compare
@swift-ci smoke test |
Could you add a EDIT: And somehow protect the 9999 versions from accidental Find & Replace? if(enable_assertions)
# "9999" means: enable if linked with a built library,
# but not when linked with the OS libraries.
# Note: this must not be changed to a "real" OS version.
set(v9999 9999)
list(APPEND swift_stdlib_compile_flags "-Xfrontend" "-define-availability")
list(APPEND swift_stdlib_compile_flags "-Xfrontend" "\"SwiftStdlib_InternalCOWChecks:macOS ${v9999}, iOS ${v9999}, watchOS ${v9999}, tvOS ${v9999}\"")
endif() @available(SwiftStdlib_InternalCOWChecks, *)
if #available(SwiftStdlib_InternalCOWChecks, *) { |
e08b9b9
to
f8849a0
Compare
@swift-ci test |
Build failed |
Tracking radar: rdar://79412058 (Fix availability for internal COW checks) |
@benrimmington That's an excellent idea! Unfortunately there are some problems when this goes through a swift interface file: https://ci.swift.org/job/swift-PR-macos/27765/console |
Why are the failures only for watchOS simulator?
You could try adding a version number to the macro name: -list(APPEND swift_stdlib_compile_flags "-Xfrontend" "_InternalCOWChecks:macOS ${v9999}, iOS ${v9999}, watchOS ${v9999}, tvOS ${v9999}")
+list(APPEND swift_stdlib_compile_flags "-Xfrontend" "_InternalCOWChecks 1:macOS ${v9999}, iOS ${v9999}, watchOS ${v9999}, tvOS ${v9999}")
-@available(_InternalCOWChecks, *)
+@available(_InternalCOWChecks 1, *)
-if #available(_InternalCOWChecks, *) {
+if #available(_InternalCOWChecks 1, *) { EDIT: Changed the macro name to use version 1. |
Adding a version number does not help. The problem is that as soon as it goes through a
I think it depends on the installed Xcode what module files need to be rebuilt for which platform. |
The new Concurrency module uses a similar
The macro shouldn't be required by swiftinterface files, according to the #33439 description:
|
* move all ObjC array tests into a separate file ArraysObjc.swift.gyb * merge the remaining Arrays.swift.gyb and ArrayNew.swift.gyb files * move the utilities from ArrayTypesAndHelpers.swift into its only use into ArraysObjc.swift.gyb
Those checks should only be done if linked with a built library, but not when linked with the OS libraries.
f8849a0
to
9a68c5f
Compare
ok, seems to be a problem with generating swiftinterface files. I'll let this up to someone else to investigate and fix. Let's land this change to unblock CI. We can do the fine tuning later. |
@swift-ci test |
Build failed |
@swift-ci test macOS |
1 similar comment
@swift-ci test macOS |
Build failed |
@swift-ci test macOS |
Build failed |
COW checking needs that all libraries are consistently compiled with asserts enabled. This is not the case for the Foundation overlay anymore. Therefore it does not work with some tests which interop with Foundation. The solution here is to disable COW checking by default, but enable it for Array tests which do not interop with Foundation.
9a68c5f
to
0831240
Compare
@swift-ci smoke test |
@swift-ci please smoke test macOS platform |
Those checks should only be done if linked with a built library, but not when linked with the OS libraries.
Also: disable COW checking by default, and enable it for specific tests
COW checking needs that all libraries are consistently compiled with asserts enabled. This is not the case for the Foundation overlay anymore.
Therefore it does not work with some tests which interop with Foundation.
The solution here is to disable COW checking by default, but enable it for Array tests which do not interop with Foundation.
rdar://79412058