-
Notifications
You must be signed in to change notification settings - Fork 10.5k
FreeBSD: No availability OS version #83601
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
FreeBSD: No availability OS version #83601
Conversation
3c7fa26
to
3098a6f
Compare
@swift-ci please test |
We're failing in this test because we're consistently dropping the version number on non-Apple platforms. The question now is, do we want to keep the triple version number for windows triples and make the test pass, or do we want to strip it and change the test? |
CC @compnerd for input on how to proceed with |
I think that we want to keep the version tuple around for Windows if it is in the specific position. The problem is that there are two version numbers:
This is alternatively spelt: |
I'm going to trust that LLVM is doing the right thing, since this ultimately falls back there. If it isn't, then that's an LLVM bug. |
The definitions of how version numbers were extracted from target triples split between the minimum platform version and for determining the minimum inlining version. This resulted in inlinable and transparent functions not being imported correctly on non-Apple platforms where the version number is retained as part of the target triple. Specifically, `_checkExpectedExecutor` was found in the module, but didn't have the appropriate availability version assigned, resulting in it failing to import and the compiler silently omitting the check in SILGen when compiling for FreeBSD. This patch refactors the implementation of `getMinPlatformVersion` into a separate function that is used in both places so that they cannot get out of sync again. Note: This changes how Windows is handled. getMinPlatformVersion returned an empty version number for Windows, while the availability implementation returned the OS version number. This makes both consistently return the OS version number.
3098a6f
to
3fcca83
Compare
@swift-ci please test |
Transparent and inlinable declarations had the OS version availability applied to them. This broke some declarations coming from the standard library, specifically
_checkExpectedExecutor
. Rather than crashing, SILGen silently omits the check, resulting in failing tests, and unchecked code. FreeBSD is not one of the platforms where availability is set up, so clear the availability version number like what is done for all non-Apple platforms.