[swift-build-dev] SwiftPM Boostrap Crash

Ryan Lovelett swift-dev at ryan.lovelett.me
Wed Jan 6 15:12:10 CST 2016


Hope that is the correct SDK path to use
(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk).

$
/Users/lovelett/Source/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swiftc
-v test.swift -sdk
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
Swift version 2.2-dev (LLVM 3ebdbb2c7e, Clang f66c5bb67b, Swift
2a27acd5e8)
Target: x86_64-apple-macosx10.9
/Users/lovelett/Source/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swift
-frontend -c -primary-file test.swift -target x86_64-apple-macosx10.9
-enable-objc-interop -sdk
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
-color-diagnostics -module-name test -o
/var/folders/cv/6rpdnxyn7qv8vql_5gbvpjz00000gn/T/test-8dfcaf.o
/usr/bin/ld
/var/folders/cv/6rpdnxyn7qv8vql_5gbvpjz00000gn/T/test-8dfcaf.o
-force_load
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_macosx.a
-framework CoreFoundation -syslibroot
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
-lobjc -lSystem -arch x86_64 -L
/Users/lovelett/Source/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx
-rpath
/Users/lovelett/Source/build/Ninja-DebugAssert/swift-macosx-x86_64/lib/swift/macosx
-macosx_version_min 10.9.0 -no_objc_category_merging -o test
ld: can't open output file for writing: test, errno=21 for architecture
x86_64
<unknown>:0: error: link command failed with exit code 1 (use -v to see
invocation)

On Wed, Jan 6, 2016, at 04:05 PM, Max Howell wrote:
> Compile it with swiftc
> 
> > On Jan 6, 2016, at 1:03 PM, Ryan Lovelett <swift-dev at ryan.lovelett.me> wrote:
> > 
> > $
> > /Users/lovelett/Source/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swift
> > test.swift
> > (Function)
> > 
> > Is that what you meant or should I compile it?
> > 
> >> On Wed, Jan 6, 2016, at 03:04 PM, Max Howell wrote:
> >> Can your compiled-swift link a basic swift file which imports and uses
> >> Darwin, like:
> >> 
> >>    import Darwin
> >> 
> >>    print(fopen)
> >> 
> >> 
> >>> On Jan 6, 2016, at 12:00 PM, Ryan Lovelett <swift-dev at ryan.lovelett.me> wrote:
> >>> 
> >>> Indeed.
> >>> 
> >>> From my top-level source directory I did this:
> >>> 
> >>> $ rm -rf build clang cmark llbuild lldb llvm swift
> >>> swift-corelibs-foundation swift-corelibs-xctest swift-integration-tests
> >>> swift-llvm swiftpm
> >>> $ git clone https://github.com/apple/swift.git
> >>> $ cd swift
> >>> $ utils/update-checkout --clone
> >>> $ utils/build-script --llbuild --swiftpm
> >>> 
> >>> I'm close to just reformatting my hard-drive. Though it is a work
> >>> computer and I think IT might get mad at me. What they don't know won't
> >>> hurt them right? 😏
> >>> 
> >>>> On Wed, Jan 6, 2016, at 12:03 PM, Daniel Dunbar wrote:
> >>>> Hi Ryan,
> >>>> 
> >>>> Am I correct in assuming that when you say you "recloned" all the repos
> >>>> that you also completely blew away your built products?
> >>>> 
> >>>> - Daniel
> >>>> 
> >>>>> On Jan 6, 2016, at 5:43 AM, Ryan Lovelett via swift-build-dev <swift-build-dev at swift.org> wrote:
> >>>>> 
> >>>>> I'm now convinced there is some sort of setting/folder being cached
> >>>>> somewhere that is causing this. I have 2 Macs (a work one, and a
> >>>>> personal one). Doing the same steps with the same code revisions checked
> >>>>> out on my work one triggers this crash; my personal one works as
> >>>>> expected.
> >>>>> 
> >>>>>> On Tue, Jan 5, 2016, at 05:32 PM, Max Howell wrote:
> >>>>>> These are Swift standard library symbols not being found.
> >>>>>> 
> >>>>>> In order to work against the PR you don’t need to build from source, you
> >>>>>> can just use the latest snapshots.
> >>>>>> 
> >>>>>> Though obviously we should try to fix this anyway.
> >>>>>> 
> >>>>>> Does it build if you don’t use the swift/utils/build-script, but instead
> >>>>>> just step into the swiftpm source directory and do: Utilities/bootstrap ?
> >>>>> 
> >>>>> Same result regardless of whether I run it like this:
> >>>>> 
> >>>>> $ cd ~/Source/swiftpm
> >>>>> $ Utilities/bootstrap
> >>>>> --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk
> >>>>> --swiftc=/Users/lovelett/Source/build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swiftc
> >>>>> --sbt=/Users/lovelett/Source/build/Ninja-DebugAssert/llbuild-macosx-x86_64/bin/swift-build-tool
> >>>>> --build=/Users/lovelett/Source/build/Ninja-DebugAssert/swiftpm-macosx-x86_64
> >>>>> 
> >>>>> 💥
> >>>>> 
> >>>>> $ export
> >>>>> PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
> >>>>> $ cd ~/Source/swiftpm
> >>>>> $ Utilities/bootstrap
> >>>>> 
> >>>>> 💥
> >>>>> 
> >>>>>> 
> >>>>>>> On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev at swift.org> wrote:
> >>>>>>> 
> >>>>>>> While trying to work on my pull request #108 [1] I've run into a
> >>>>>>> stumbling block that is beginning to drive me nuts. I feel like I've
> >>>>>>> done something wrong, since I don't see anyone else talking about it,
> >>>>>>> but am at a loss as to what to do.
> >>>>>>> 
> >>>>>>> When the bootstrap runs it is crashing with `ld: symbol(s) not found for
> >>>>>>> architecture x86_64`. I've posted [2] the full build log. It was
> >>>>>>> generated with utils/build-script --llbuild --swiftpm > allout.txt 2>&1.
> >>>>>>> 
> >>>>>>> SwiftPM is on commit df7736e3962bfe183451d52b9b865b92f4f9ab26 (just want
> >>>>>>> to point out it does not include my WIP branch) and everything else
> >>>>>>> should be on its latest.
> >>>>>>> 
> >>>>>>> The crash is repeatable. I delete all the swift repos and clone them all
> >>>>>>> down and run the compile again and it crashes same place every time.
> >>>>>>> Someone please help me so I can feel a little less incompetent (or more
> >>>>>>> as the case may be).
> >>>>>>> 
> >>>>>>> [1] https://github.com/apple/swift-package-manager/pull/108
> >>>>>>> [2] https://gist.github.com/b91c66f8ace399292ac9
> >>>>>>> _______________________________________________
> >>>>>>> swift-build-dev mailing list
> >>>>>>> swift-build-dev at swift.org
> >>>>>>> https://lists.swift.org/mailman/listinfo/swift-build-dev
> >>>>> _______________________________________________
> >>>>> swift-build-dev mailing list
> >>>>> swift-build-dev at swift.org
> >>>>> https://lists.swift.org/mailman/listinfo/swift-build-dev
> >> 


More information about the swift-build-dev mailing list