Skip to content

[stdlib] RawRepresentable: revert to default _rawHashValue(seed:) #25873

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 1 commit into from
Jul 1, 2019

Conversation

lorentey
Copy link
Member

@lorentey lorentey commented Jun 28, 2019

https://bugs.swift.org/browse/SR-10734
rdar://problem/51319164

@lorentey
Copy link
Member Author

@swift-ci smoke 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.

Sorry for the trouble…

@lorentey
Copy link
Member Author

@jrose-apple It was me who introduced this bug -- I tried to be overly clever with single shot hashing. :/

@jrose-apple
Copy link
Contributor

Huh, my mistake must have been around something else then.

…don't we still have it wrong if they only override hash(into:) and not hashValue or vice versa? ><

@lorentey
Copy link
Member Author

Yeah, RawRepresentable types that only implement hashValue remain broken.

(And they won't even get the usual warning about only implementing hashValue -- we probably should warn if ==/hash(into:)/hashValue do not all come from the same level. Or just warn on hashValue implementations in general?)

@lorentey
Copy link
Member Author

The original sin was adding the generic == definition for RawRepresentable, and that goes back to before the dawn of time itself.

@lorentey
Copy link
Member Author

17:15:37 FAIL: Swift(linux-x86_64) :: stdlib/RawRepresentable-tricky-hashing.swift (7381 of 12050)
17:15:37 ******************** TEST 'Swift(linux-x86_64) :: stdlib/RawRepresentable-tricky-hashing.swift' FAILED ********************
[...]
17:15:37 error: no check strings found with prefix 'CHECK:'

🤦‍♂️

@lorentey lorentey force-pushed the RawRepresentable-hashing branch from e26805e to 09bf1f7 Compare June 29, 2019 18:51
@lorentey
Copy link
Member Author

@swift-ci smoke test

@lorentey
Copy link
Member Author

lorentey commented Jul 1, 2019

12:22:24 FAIL: Swift(macosx-x86_64) :: PrintAsObjC/extensions.swift (9855 of 12114)
12:22:24 ******************** TEST 'Swift(macosx-x86_64) :: PrintAsObjC/extensions.swift' FAILED ********************
12:22:24 Script:
12:22:24 --
12:22:24 : 'RUN: at line 3';   rm -rf "/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp" && mkdir -p "/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp"
12:22:24 : 'RUN: at line 4';   /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/bin/swiftc -frontend -target x86_64-apple-macosx10.9  -module-cache-path '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache' -sdk '/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk' -swift-version 4  -typo-correction-limit 10   -enable-source-import -sdk '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/Inputs/clang-importer-sdk' -I '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/Inputs/clang-importer-sdk/swift-modules'   -disable-sil-ownership-verifier -emit-module -o /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/PrintAsObjC/extensions.swift -disable-objc-attr-requires-foundation-module
12:22:24 : 'RUN: at line 5';   /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/bin/swiftc -frontend -target x86_64-apple-macosx10.9  -module-cache-path '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache' -sdk '/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk' -swift-version 4  -typo-correction-limit 10   -enable-source-import -sdk '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/Inputs/clang-importer-sdk' -I '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/Inputs/clang-importer-sdk/swift-modules'   -disable-sil-ownership-verifier -parse-as-library /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp/extensions.swiftmodule -typecheck -emit-objc-header-path /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp/extensions.h -import-objc-header /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/PrintAsObjC/../Inputs/empty.h -disable-objc-attr-requires-foundation-module
12:22:24 : 'RUN: at line 6';   '/usr/bin/python' '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64' --sanitize SOURCE_DIR='/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift' --use-filecheck '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/llvm-macosx-x86_64/bin/FileCheck'  /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/PrintAsObjC/extensions.swift < /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp/extensions.h
12:22:24 : 'RUN: at line 7';   '/usr/bin/python' '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/utils/PathSanitizingFileCheck' --sanitize BUILD_DIR='/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64' --sanitize SOURCE_DIR='/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift' --use-filecheck '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/llvm-macosx-x86_64/bin/FileCheck'  --check-prefix=NEGATIVE /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/PrintAsObjC/extensions.swift < /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp/extensions.h
12:22:24 : 'RUN: at line 8';   '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/llvm-macosx-x86_64/bin/clang' -fmodules-cache-path='/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/swift-test-results/x86_64-apple-macosx10.9/clang-module-cache' -fsyntax-only -x objective-c-header -fobjc-arc -fmodules -fmodules-validate-system-headers -Weverything -Werror -Wno-unused-macros -Wno-incomplete-module -Wno-auto-import -F '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test/Inputs/clang-importer-sdk'/frameworks -I /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/include -isysroot '/Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/swift/test'/Inputs/clang-importer-sdk /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/swift-macosx-x86_64/test-macosx-x86_64/PrintAsObjC/Output/extensions.swift.tmp/extensions.h
12:22:24 --
12:22:24 Exit Code: 70
12:22:24 
12:22:24 Command Output (stderr):
12:22:24 --
12:22:24 fatal error: error in backend: Unexpected end of file
12:22:24 
clang-7: error: clang frontend command failed with exit code 70 (use -v to see invocation)
12:22:24 Apple clang version 7.0.0 (https://github.com/apple/swift-clang.git 54d8dfd1a03ffabb107be7ea0d475c43ce25bc32) (https://github.com/apple/swift-llvm.git 8d110eebee5f8218a3ca87da92f61a2d4e49c307) (based on LLVM 7.0.0)
12:22:24 Target: x86_64-apple-darwin18.6.0
12:22:24 Thread model: posix
12:22:24 InstalledDir: /Users/buildnode/jenkins/workspace/swift-PR-osx-smoke-test/branch-master/buildbot_incremental/llvm-macosx-x86_64/bin
12:22:24 clang-7: note: diagnostic msg: PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
12:22:24 clang-7: note: diagnostic msg: 
12:22:24 ********************
12:22:24 
12:22:24 PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
12:22:24 Preprocessed source(s) and associated run script(s) are located at:
12:22:24 clang-7: note: diagnostic msg: /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/lit_tmp_DywuxP/extensions-ac9bb0.h
12:22:24 clang-7: note: diagnostic msg: /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/lit_tmp_DywuxP/extensions-ac9bb0.cache
12:22:24 clang-7: note: diagnostic msg: /var/folders/_8/79jmzf2142z2xydc_01btlx00000gn/T/lit_tmp_DywuxP/extensions-ac9bb0.sh
12:22:24 clang-7: note: diagnostic msg: Crash backtrace is located in
12:22:24 clang-7: note: diagnostic msg: /Users/buildnode/Library/Logs/DiagnosticReports/clang-7_<YYYY-MM-DD-HHMMSS>_<hostname>.crash
12:22:24 clang-7: note: diagnostic msg: (choose the .crash file that corresponds to your crash)
12:22:24 clang-7: note: diagnostic msg: 
12:22:24 
12:22:24 ********************
12:22:24 
12:22:24 --
12:22:24 
12:22:24 ********************

@lorentey
Copy link
Member Author

lorentey commented Jul 1, 2019

@swift-ci smoke test macOS platform

@jrose-apple
Copy link
Contributor

We still haven't figured that one out yet. :-(

@lorentey lorentey merged commit f029162 into swiftlang:master Jul 1, 2019
@lorentey lorentey deleted the RawRepresentable-hashing branch July 1, 2019 23:23
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.

2 participants