[Sema/SILGen/IRGen/StdLib] Implement metatype keypaths
This is the implementation for SE-0438: Metatype Keypaths which extends keypath usage to include references to static properties, eg. metatype keypaths:
struct Bee {
static let name = "honeybee"
}
let kp = \Bee.Type.name
@swift-ci please build toolchain macOS platform
@swift-ci please build toolchain Linux platform
@swift-ci please build toolchain macOS platform
@swift-ci please build toolchain macOS platform
@swift-ci please build toolchain Linux platform
@xedin This is ready for final review before I merge!
Great, I will take a look on Monday!
@swift-ci please build toolchain macOS platform
@swift-ci please build toolchain Linux platform
@swift-ci please test
@swift-ci please test
@swift-ci please test
@swift-ci please test
@swift-ci please test
Glad to see this long-awaited feature is in progress :-)
@swift-ci please test
@swift-ci please smoke test
It looks like some of the tests now need to be marked REQUIRES: asserts, because they currently fail in a noassert build:
<unknown>:0: error: experimental feature 'KeyPathWithStaticMembers' cannot be enabled in production compiler
Instead, it would be better to split off the tests for the new feature into their own file(s).
@amritpan could you please all the tests where you added the flat? Looks like we didn’t get all of them
We are seeing swift macOS toolchain bot failing most likely related to this PR.
FAIL: Swift(macosx-x86_64) :: abi/macOS/x86_64/stdlib.swift (9366 of 18223)
******************** TEST 'Swift(macosx-x86_64) :: abi/macOS/x86_64/stdlib.swift' FAILED ********************
Script:
--
: 'RUN: at line 1'; rm -rf "/Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/swift-macosx-x86_64/test-macosx-x86_64/abi/macOS/x86_64/Output/stdlib.swift.tmp" && mkdir -p "/Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/swift-macosx-x86_64/test-macosx-x86_64/abi/macOS/x86_64/Output/stdlib.swift.tmp"
: 'RUN: at line 2'; /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/llvm-macosx-x86_64/bin/llvm-nm -g --defined-only -f just-symbols /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/swift-macosx-x86_64/lib/swift/macosx/x86_64/libswiftCore.dylib > /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/swift-macosx-x86_64/test-macosx-x86_64/abi/macOS/x86_64/Output/stdlib.swift.tmp/symbols
: 'RUN: at line 3'; /Applications/Xcode-beta.app/Contents/Developer/usr/bin/python3 /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/swift/utils/swift-abi-symbol-checker.py /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/swift/test/abi/macOS/x86_64/stdlib.swift /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/swift-macosx-x86_64/test-macosx-x86_64/abi/macOS/x86_64/Output/stdlib.swift.tmp/symbols
: 'RUN: at line 4'; diff -u /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/swift/test/abi/macOS/x86_64/../../Inputs/macOS/x86_64/stdlib/baseline /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/swift-macosx-x86_64/test-macosx-x86_64/abi/macOS/x86_64/Output/stdlib.swift.tmp/symbols
--
Exit Code: 1
Command Output (stdout):
--
--- /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/swift/test/abi/macOS/x86_64/../../Inputs/macOS/x86_64/stdlib/baseline 2024-10-02 03:37:11
+++ /Users/ec2-user/jenkins/workspace/oss-swift-package-macos/build/buildbot_osx/swift-macosx-x86_64/test-macosx-x86_64/abi/macOS/x86_64/Output/stdlib.swift.tmp/symbols 2024-10-02 06:19:33
@@ -1,4 +1,8 @@
$ld$previous$@rpath/libswiftCore.dylib$$1$10.9$10.14.4$$
+<MISSING ADDITION> _$ss24_RuntimeFunctionCountersV03numabC0SivpZMV
+<MISSING ADDITION> _$ss24_RuntimeFunctionCountersV07runtimeB11NameToIndexSDySSSiGvpZMV
+<MISSING ADDITION> _$ss24_RuntimeFunctionCountersV07runtimeB5NamesSaySSGvpZMV
+<MISSING ADDITION> _$ss24_RuntimeFunctionCountersV07runtimebC7OffsetsSPys6UInt16VGvpZMV
_$s11MaskStorages4SIMDPTl
_$s11RawExponentSBTl
_$s11SubSequenceSlTl
--
********************
@amritpan could you please take a look?
@shahmishal I've opened this PR to resolve this. Thank you!
@slavapestov Created this PR: https://github.com/swiftlang/swift/pull/76824
@shahmishal It seems that the abi test failures are persisting? I've reopened #76826.