Skip to content

Replace __FILE__ and similar with #file or related - breaking change for swift 2.2+ #265

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

Closed
wants to merge 1 commit into from

Conversation

younata
Copy link
Member

@younata younata commented Mar 12, 2016

Hey friends! (Hi Jeff! Hi Brian!)

Note that as of the most recent (mar 1) swift 3.0 prerelease, there's a compiler bug that this triggers. Might be fixed by next prerelease, might not. If not, then help would be nice?

A stack trace of the compiler bug, if you're interested:

Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"), function cast, file /Users/buildnode/jenkins/workspace/oss-swift-package-osx/llvm/include/llvm/Support/Casting.h, line 237.
0  swift                    0x00000001084e4a6b llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 43
1  swift                    0x00000001084e3d26 llvm::sys::RunSignalHandlers() + 70
2  swift                    0x00000001084e5112 SignalHandler(int) + 322
3  libsystem_platform.dylib 0x00007fff9ac4eeaa _sigtramp + 26
4  swift                    0x0000000108f995ed FirstTarget + 71701
5  swift                    0x00000001084e4f26 abort + 22
6  swift                    0x00000001084e4f01 __assert_rtn + 81
7  swift                    0x0000000105d0d00f swift::irgen::bindGenericRequirement(swift::irgen::IRGenFunction&, swift::irgen::GenericRequirement, llvm::Value*, llvm::function_ref<swift::CanType (swift::CanType)>) + 239
8  swift                    0x0000000105d0b149 swift::irgen::bindFromGenericRequirementsBuffer(swift::irgen::IRGenFunction&, llvm::ArrayRef<swift::irgen::GenericRequirement>, swift::irgen::Address, llvm::function_ref<swift::CanType (swift::CanType)>) + 361
9  swift                    0x0000000105d0afcf swift::irgen::NecessaryBindings::restore(swift::irgen::IRGenFunction&, swift::irgen::Address) const + 79
10 swift                    0x0000000105cd43bf swift::irgen::HeapLayout::getPrivateMetadata(swift::irgen::IRGenModule&) const + 447
11 swift                    0x0000000105cd4956 swift::irgen::IRGenFunction::emitUnmanagedAlloc(swift::irgen::HeapLayout const&, llvm::Twine const&, swift::irgen::HeapNonFixedOffsets const*) + 38
12 swift                    0x0000000105cc954f swift::irgen::emitFunctionPartialApplication(swift::irgen::IRGenFunction&, llvm::Value*, llvm::Value*, swift::irgen::Explosion&, llvm::ArrayRef<swift::SILParameterInfo>, llvm::ArrayRef<swift::Substitution>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::CanTypeWrapper<swift::SILFunctionType>, swift::irgen::Explosion&) + 3311
13 swift                    0x0000000105d62ee6 swift::SILVisitor<(anonymous namespace)::IRGenSILFunction, void>::visit(swift::ValueBase*) + 45510
14 swift                    0x0000000105d53ffb (anonymous namespace)::IRGenSILFunction::emitSILFunction() + 9579
15 swift                    0x0000000105d516a0 swift::irgen::IRGenModule::emitSILFunction(swift::SILFunction*) + 1168
16 swift                    0x0000000105c84f5c swift::irgen::IRGenModuleDispatcher::emitGlobalTopLevel() + 428
17 swift                    0x0000000105d35725 performIRGeneration(swift::IRGenOptions&, swift::ModuleDecl*, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, swift::SourceFile*, unsigned int) + 1125
18 swift                    0x0000000105d35cf6 swift::performIRGeneration(swift::IRGenOptions&, swift::SourceFile&, swift::SILModule*, llvm::StringRef, llvm::LLVMContext&, unsigned int) + 70
19 swift                    0x0000000105be4402 frontend_main(llvm::ArrayRef<char const*>, char const*, void*) + 12034
20 swift                    0x0000000105bdd489 main + 2937
21 libdyld.dylib            0x00007fff8d1265ad start + 1
22 libdyld.dylib            0x0000000000000072 start + 1928174278
Stack dump:
0.  Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2016-03-01-a.xctoolchain/usr/bin/swift -frontend -c /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeCloseTo.swift /Users/you/workspace/Nimble/Sources/Nimble/Wrappers/MatcherFunc.swift /Users/you/workspace/Nimble/Sources/Nimble/Expectation.swift /Users/you/workspace/Nimble/Sources/Nimble/Adapters/NimbleXCTestHandler.swift /Users/you/workspace/Nimble/Sources/Nimble/Utils/Stringers.swift /Users/you/workspace/Nimble/Sources/Nimble/Utils/SourceLocation.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeLessThanOrEqual.swift /Users/you/workspace/Nimble/Sources/Nimble/Adapters/AssertionDispatcher.swift /Users/you/workspace/Nimble/Sources/Nimble/Utils/Functional.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeAnInstanceOf.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeLogical.swift /Users/you/workspace/Nimble/Sources/Nimble/ObjCExpectation.swift /Users/you/workspace/Nimble/Sources/Nimble/DSL+Wait.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/AllPass.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeAKindOf.swift /Users/you/workspace/Nimble/Sources/Nimble/Adapters/AssertionRecorder.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeVoid.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/PostNotification.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/Match.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/ThrowError.swift -primary-file /Users/you/workspace/Nimble/Sources/Nimble/Matchers/Equal.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeLessThan.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeGreaterThan.swift /Users/you/workspace/Nimble/Sources/Nimble/Adapters/AdapterProtocols.swift /Users/you/workspace/Nimble/Sources/Nimble/Adapters/NimbleEnvironment.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/RaisesException.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/Contain.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeGreaterThanOrEqualTo.swift /Users/you/workspace/Nimble/Sources/Nimble/Wrappers/AsyncMatcherWrapper.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeginWith.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeIdenticalTo.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeEmpty.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/BeNil.swift /Users/you/workspace/Nimble/Sources/Nimble/Utils/Async.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/EndWith.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/MatcherProtocols.swift /Users/you/workspace/Nimble/Sources/Nimble/Wrappers/ObjCMatcher.swift /Users/you/workspace/Nimble/Sources/Nimble/DSL.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/SatisfyAnyOf.swift /Users/you/workspace/Nimble/Sources/Nimble/Expression.swift /Users/you/workspace/Nimble/Sources/Nimble/FailureMessage.swift /Users/you/workspace/Nimble/Sources/Nimble/Matchers/HaveCount.swift -target x86_64-apple-macosx10.9 -enable-objc-interop -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -I /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Products/Debug -F /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Products/Debug -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -F /Applications/Xcode.app/Contents/Developer/Library/Frameworks -enable-testing -g -import-underlying-module -module-cache-path /Users/you/Library/Developer/Xcode/DerivedData/ModuleCache -serialize-debugging-options -Xcc -I/Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/swift-overrides.hmap -Xcc -iquote -Xcc /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Nimble-generated-files.hmap -Xcc -I/Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Nimble-own-target-headers.hmap -Xcc -I/Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Nimble-all-non-framework-target-headers.hmap -Xcc -ivfsoverlay -Xcc /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/all-product-headers.yaml -Xcc -iquote -Xcc /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Nimble-project-headers.hmap -Xcc -I/Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Products/Debug/include -Xcc -I/Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/DerivedSources/x86_64 -Xcc -I/Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/DerivedSources -Xcc -DDEBUG=1 -Xcc -DDEBUG=1 -Xcc -ivfsoverlay -Xcc /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/unextended-module-overlay.yaml -Xcc -working-directory/Users/you/workspace/Nimble -emit-module-doc-path /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Objects-normal/x86_64/Equal~partial.swiftdoc -Onone -module-name Nimble -emit-module-path /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Objects-normal/x86_64/Equal~partial.swiftmodule -serialize-diagnostics-path /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Objects-normal/x86_64/Equal.dia -emit-dependencies-path /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Objects-normal/x86_64/Equal.d -emit-reference-dependencies-path /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Objects-normal/x86_64/Equal.swiftdeps -o /Users/you/Library/Developer/Xcode/DerivedData/Nimble-avfmctrdkmaawddbgnnrooogzuvv/Build/Intermediates/Nimble.build/Debug/Nimble-OSX.build/Objects-normal/x86_64/Equal.o 
1.  While emitting IR SIL function @_TF6Nimble5equaluRxs8HashablerFGSqGVs3Setx__GVS_17NonNilMatcherFuncGS1_x__ for 'equal' at /Users/you/workspace/Nimble/Sources/Nimble/Matchers/Equal.swift:88:8

…for swift 2.2+

Note that as of the most recent (mar 1) swift 3.0 prerelease, there's a compiler bug that this triggers. Might be fixed by next prerelease, might not
@morganchen12
Copy link
Contributor

CI doesn't seem to like this so much. If we bump the development snapshot version hopefully it'll fix itself?

@jeffh
Copy link
Member

jeffh commented Mar 13, 2016

As @morganchen12 mentioned, the version of swift referenced via swiftenv needs to be updated to the latest snapshot.

Also, I think these changes would force us to maintain a separate branch until Xcode stable has these changes.

@phatblat phatblat mentioned this pull request Mar 22, 2016
@younata
Copy link
Member Author

younata commented Mar 24, 2016

Closing in favor of #269

@younata younata closed this Mar 24, 2016
phatblat pushed a commit to phatblat/Nimble that referenced this pull request May 3, 2020
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.

3 participants