SwiftPM Boostrap Crash

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] [bootstrap] Refactor to be compatible with Python 2 or 3 by RLovelett · Pull Request #108 · apple/swift-package-manager · GitHub
[2] allout.txt · GitHub

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 ?

···

On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] [bootstrap] Refactor to be compatible with Python 2 or 3 by RLovelett · Pull Request #108 · apple/swift-package-manager · GitHub
[2] allout.txt · GitHub
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

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.

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

:boom:

$ export
PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
$ cd ~/Source/swiftpm
$ Utilities/bootstrap

:boom:

···

On Tue, Jan 5, 2016, at 05:32 PM, Max Howell wrote:

> On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] [bootstrap] Refactor to be compatible with Python 2 or 3 by RLovelett · Pull Request #108 · apple/swift-package-manager · GitHub
> [2] allout.txt · GitHub
> _______________________________________________
> swift-build-dev mailing list
> swift-build-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev

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@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

:boom:

$ export
PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
$ cd ~/Source/swiftpm
$ Utilities/bootstrap

:boom:

On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] [bootstrap] Refactor to be compatible with Python 2 or 3 by RLovelett · Pull Request #108 · apple/swift-package-manager · GitHub
[2] allout.txt · GitHub
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

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 GitHub - apple/swift: The Swift Programming Language
$ 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? :smirk:

···

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@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
>
> :boom:
>
> $ export
> PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
> $ cd ~/Source/swiftpm
> $ Utilities/bootstrap
>
> :boom:
>
>>
>>> On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] allout.txt · GitHub
>>> _______________________________________________
>>> swift-build-dev mailing list
>>> swift-build-dev@swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-build-dev
>>
> _______________________________________________
> swift-build-dev mailing list
> swift-build-dev@swift.org
> https://lists.swift.org/mailman/listinfo/swift-build-dev

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@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 GitHub - apple/swift: The Swift Programming Language
$ 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? :smirk:

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@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

:boom:

$ export
PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
$ cd ~/Source/swiftpm
$ Utilities/bootstrap

:boom:

On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] allout.txt · GitHub
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

$
/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@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 GitHub - apple/swift: The Swift Programming Language
> $ 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? :smirk:
>
> 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@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
>>>
>>> :boom:
>>>
>>> $ export
>>> PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
>>> $ cd ~/Source/swiftpm
>>> $ Utilities/bootstrap
>>>
>>> :boom:
>>>
>>>>
>>>>> On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] allout.txt · GitHub
>>>>> _______________________________________________
>>>>> swift-build-dev mailing list
>>>>> swift-build-dev@swift.org
>>>>> https://lists.swift.org/mailman/listinfo/swift-build-dev
>>>>
>>> _______________________________________________
>>> swift-build-dev mailing list
>>> swift-build-dev@swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-build-dev
>>

Compile it with swiftc

···

On Jan 6, 2016, at 1:03 PM, Ryan Lovelett <swift-dev@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@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 GitHub - apple/swift: The Swift Programming Language
$ 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? :smirk:

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@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

:boom:

$ export
PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
$ cd ~/Source/swiftpm
$ Utilities/bootstrap

:boom:

On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] allout.txt · GitHub
_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

_______________________________________________
swift-build-dev mailing list
swift-build-dev@swift.org
https://lists.swift.org/mailman/listinfo/swift-build-dev

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@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@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 GitHub - apple/swift: The Swift Programming Language
>>> $ 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? :smirk:
>>>
>>>> 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@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
>>>>>
>>>>> :boom:
>>>>>
>>>>> $ export
>>>>> PATH="/Library/Developer/Toolchains/swift-latest.xctoolchain/usr/bin:$PATH"
>>>>> $ cd ~/Source/swiftpm
>>>>> $ Utilities/bootstrap
>>>>>
>>>>> :boom:
>>>>>
>>>>>>
>>>>>>> On Jan 5, 2016, at 1:08 PM, Ryan Lovelett via swift-build-dev <swift-build-dev@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] [bootstrap] Refactor to be compatible with Python 2 or 3 by RLovelett · Pull Request #108 · apple/swift-package-manager · GitHub
>>>>>>> [2] allout.txt · GitHub
>>>>>>> _______________________________________________
>>>>>>> swift-build-dev mailing list
>>>>>>> swift-build-dev@swift.org
>>>>>>> https://lists.swift.org/mailman/listinfo/swift-build-dev
>>>>> _______________________________________________
>>>>> swift-build-dev mailing list
>>>>> swift-build-dev@swift.org
>>>>> https://lists.swift.org/mailman/listinfo/swift-build-dev
>>

ld: can't open output file for writing: test

swiftc can’t write the output to the current directory. When you run this is your current directory writable?

Ok that was a real facepalm then drag your hand down your face for
emphasis moment.

The swift file I was trying to compile was called `test.swift` which
would become `test` once a linked executable. However I was in the root
of the GitHub - apple/swift: The Swift Programming Language repository that already has a
`test` directory. That is why it couldn't link. Sigh. Once I renamed it
to `ryan` it compiled and linked just fine.

Which then led me back to the actual problem, i.e., could not build
swiftpm. Still not sure **exactly** what was causing the issue but I was
able to get past it.

I started comparing the configuration, home brew, env config, etc, of my
work laptop (that didn't work) and my personal laptop (that did work)
and I noticed that my work machine had a bunch of homebrew packages that
my personal didn't. I uninstalled everything on my work laptop that
wasn't on my personal machine. Voila, it builds again.

Apologies for the radio silence. And thank you for all the support that
you were not required to give; it is appreciated.

···

On Thu, Jan 7, 2016, at 11:37 AM, Max Howell wrote:

ld: can't open output file for writing: test

swiftc can’t write the output to the current directory. When you run
this is your current directory writable?

That is very interesting information. I don't see offhand how a brew package could cause this problem, but if you see it again (esp. if you discover what package it was) please let us know!

- Daniel

···

On Jan 8, 2016, at 7:32 AM, Ryan Lovelett <swift-dev@ryan.lovelett.me> wrote:

Ok that was a real facepalm then drag your hand down your face for emphasis moment.

The swift file I was trying to compile was called `test.swift` which would become `test` once a linked executable. However I was in the root of the GitHub - apple/swift: The Swift Programming Language repository that already has a `test` directory. That is why it couldn't link. Sigh. Once I renamed it to `ryan` it compiled and linked just fine.

Which then led me back to the actual problem, i.e., could not build swiftpm. Still not sure exactly what was causing the issue but I was able to get past it.

I started comparing the configuration, home brew, env config, etc, of my work laptop (that didn't work) and my personal laptop (that did work) and I noticed that my work machine had a bunch of homebrew packages that my personal didn't. I uninstalled everything on my work laptop that wasn't on my personal machine. Voila, it builds again.

Apologies for the radio silence. And thank you for all the support that you were not required to give; it is appreciated.

On Thu, Jan 7, 2016, at 11:37 AM, Max Howell wrote:

ld: can't open output file for writing: test

swiftc can’t write the output to the current directory. When you run this is your current directory writable?

I’d guess that something in /usr/local/include or lib was getting selected instead of the correct swift libraries? Unless otherwise specified /usr/local is first in the search paths.

···

On Jan 8, 2016, at 8:43 AM, Daniel Dunbar <daniel_dunbar@apple.com> wrote:

That is very interesting information. I don't see offhand how a brew package could cause this problem, but if you see it again (esp. if you discover what package it was) please let us know!

- Daniel

On Jan 8, 2016, at 7:32 AM, Ryan Lovelett <swift-dev@ryan.lovelett.me <mailto:swift-dev@ryan.lovelett.me>> wrote:

Ok that was a real facepalm then drag your hand down your face for emphasis moment.

The swift file I was trying to compile was called `test.swift` which would become `test` once a linked executable. However I was in the root of the GitHub - apple/swift: The Swift Programming Language repository that already has a `test` directory. That is why it couldn't link. Sigh. Once I renamed it to `ryan` it compiled and linked just fine.

Which then led me back to the actual problem, i.e., could not build swiftpm. Still not sure exactly what was causing the issue but I was able to get past it.

I started comparing the configuration, home brew, env config, etc, of my work laptop (that didn't work) and my personal laptop (that did work) and I noticed that my work machine had a bunch of homebrew packages that my personal didn't. I uninstalled everything on my work laptop that wasn't on my personal machine. Voila, it builds again.

Apologies for the radio silence. And thank you for all the support that you were not required to give; it is appreciated.

On Thu, Jan 7, 2016, at 11:37 AM, Max Howell wrote:

ld: can't open output file for writing: test

swiftc can’t write the output to the current directory. When you run this is your current directory writable?

I would certainly *hope* no brew package is causing a copy of the Swift stdlibs to end up in usr/local?

- Daniel

···

On Jan 8, 2016, at 10:04 AM, Max Howell <max.howell@apple.com> wrote:

I’d guess that something in /usr/local/include or lib was getting selected instead of the correct swift libraries? Unless otherwise specified /usr/local is first in the search paths.

On Jan 8, 2016, at 8:43 AM, Daniel Dunbar <daniel_dunbar@apple.com <mailto:daniel_dunbar@apple.com>> wrote:

That is very interesting information. I don't see offhand how a brew package could cause this problem, but if you see it again (esp. if you discover what package it was) please let us know!

- Daniel

On Jan 8, 2016, at 7:32 AM, Ryan Lovelett <swift-dev@ryan.lovelett.me <mailto:swift-dev@ryan.lovelett.me>> wrote:

Ok that was a real facepalm then drag your hand down your face for emphasis moment.

The swift file I was trying to compile was called `test.swift` which would become `test` once a linked executable. However I was in the root of the GitHub - apple/swift: The Swift Programming Language repository that already has a `test` directory. That is why it couldn't link. Sigh. Once I renamed it to `ryan` it compiled and linked just fine.

Which then led me back to the actual problem, i.e., could not build swiftpm. Still not sure exactly what was causing the issue but I was able to get past it.

I started comparing the configuration, home brew, env config, etc, of my work laptop (that didn't work) and my personal laptop (that did work) and I noticed that my work machine had a bunch of homebrew packages that my personal didn't. I uninstalled everything on my work laptop that wasn't on my personal machine. Voila, it builds again.

Apologies for the radio silence. And thank you for all the support that you were not required to give; it is appreciated.

On Thu, Jan 7, 2016, at 11:37 AM, Max Howell wrote:

ld: can't open output file for writing: test

swiftc can’t write the output to the current directory. When you run this is your current directory writable?

Only the swift formula. But could be something with the same link name etc. etc.

If seen stranger things in my time.

···

I would certainly *hope* no brew package is causing a copy of the Swift stdlibs to end up in usr/local?

- Daniel

On Jan 8, 2016, at 10:04 AM, Max Howell <max.howell@apple.com <mailto:max.howell@apple.com>> wrote:

I’d guess that something in /usr/local/include or lib was getting selected instead of the correct swift libraries? Unless otherwise specified /usr/local is first in the search paths.

On Jan 8, 2016, at 8:43 AM, Daniel Dunbar <daniel_dunbar@apple.com <mailto:daniel_dunbar@apple.com>> wrote:

That is very interesting information. I don't see offhand how a brew package could cause this problem, but if you see it again (esp. if you discover what package it was) please let us know!

- Daniel

On Jan 8, 2016, at 7:32 AM, Ryan Lovelett <swift-dev@ryan.lovelett.me <mailto:swift-dev@ryan.lovelett.me>> wrote:

Ok that was a real facepalm then drag your hand down your face for emphasis moment.

The swift file I was trying to compile was called `test.swift` which would become `test` once a linked executable. However I was in the root of the GitHub - apple/swift: The Swift Programming Language repository that already has a `test` directory. That is why it couldn't link. Sigh. Once I renamed it to `ryan` it compiled and linked just fine.

Which then led me back to the actual problem, i.e., could not build swiftpm. Still not sure exactly what was causing the issue but I was able to get past it.

I started comparing the configuration, home brew, env config, etc, of my work laptop (that didn't work) and my personal laptop (that did work) and I noticed that my work machine had a bunch of homebrew packages that my personal didn't. I uninstalled everything on my work laptop that wasn't on my personal machine. Voila, it builds again.

Apologies for the radio silence. And thank you for all the support that you were not required to give; it is appreciated.

On Thu, Jan 7, 2016, at 11:37 AM, Max Howell wrote:

ld: can't open output file for writing: test

swiftc can’t write the output to the current directory. When you run this is your current directory writable?