[swift-corelibs-dev] Building Foundation in Xcode

Ian Partridge ian at poncho.org.uk
Mon Mar 14 09:49:25 CDT 2016


Hi David,

You need the latest Foundation from git, I think.  Brian fixed that
compilation problem here:

https://github.com/apple/swift-corelibs-foundation/commit/9fbcf1be1b75d5d9046735f13eddbaef4b3a408a

It would be really nice if the snapshots at
https://swift.org/download/ could be refreshed!

Thanks,
Ian

On 14 March 2016 at 07:45, David Hart via swift-corelibs-dev
<swift-corelibs-dev at swift.org> wrote:
> One step closer :) I built a master version the toolchain, fixed most
> errors, but left with own a few:
>
> Foundation/NSRunLoop.swift:14:43: error: type 'CFRunLoopActivity' has no
> member 'BeforeTimers'
>     internal let kCFRunLoopBeforeTimers =
> CFRunLoopActivity.BeforeTimers.rawValue
>
> Of course, this is happening because the new version of ClangImporter is now
> importing enum values with lowerCamelCase. It’s beforeTimers, not
> BeforeTimers. I can fix it, but was wondering if it was in need of fixing or
> if I had built the toolchain with the wrong branch of swift.
>
> David.
>
> On 14 Mar 2016, at 06:44, Brian Gesiak <modocache at gmail.com> wrote:
>
> Taylor,
>
> Funny you should mention that. The tests take a long time to run, and I
> don't really mind if a local toolchain I use has one or two failing tests.
> So I delete these two lines before building a toolchain:
> https://github.com/apple/swift/blob/a11e911f662c02c14e28286d76d154370ce5f5e1/utils/build-presets.ini#L711-L712
>
> That disables the tests. Your toolchain builds much faster, but beware: you
> may have a bug or two in there! ;)
>
> - Brian Gesiak
>
>
> _____________________________
> From: Taylor Franklin <taylorleefranklin at gmail.com>
> Sent: Monday, March 14, 2016 12:37 AM
> Subject: Re: [swift-corelibs-dev] Building Foundation in Xcode
> To: Brian Gesiak <modocache at gmail.com>
> Cc: Pushkar N Kulkarni <pushkar.nk at in.ibm.com>,
> <swift-corelibs-dev at swift.org>, David Hart <david at hartbit.com>
>
>
> Brian,
>
> I have also been having issues, so I tried your suggestions and I cannot
> even get a toolchain built on the Swift master branch. I also tried the
> swift-3-api-guidelines branch, assuming that is where the Swift 3 code
> lives.
>
> Anyway, I get the error:
> Failing Tests (1):
>     Swift :: Driver/filelists.swift
>
> Does the build-toolchain script take certain parameters or have other
> prerequisites?
> Thanks for any help.
>
> - Taylor
>
> On Sun, Mar 13, 2016 at 2:34 PM, Brian Gesiak via swift-corelibs-dev
> <swift-corelibs-dev at swift.org> wrote:
>>
>> David,
>>
>> The repository has been migrated to Swift 3. You'll need a Swift 3
>> .xctoolchain to build it. There isn't a snapshot available yet, but you can
>> build your own using the script added to Swift in
>> https://github.com/apple/swift/pull/1630.
>>
>> Even using the Swift 3 toolchain, I encountered build errors related to
>> NSRunLoop. Applying
>> https://github.com/apple/swift-corelibs-foundation/pull/284 got everything
>> working for me.
>>
>> Hope that helps!
>>
>> - Brian Gesiak
>>
>>
>>
>> On Sun, Mar 13, 2016 at 12:31 PM -0700, "David Hart" <david at hartbit.com>
>> wrote:
>>
>>> Ok, I’m also encountering errors, but many more than Pushkar:
>>>
>>> OS: OS X El Capitan
>>> Xcode: Version 7.3 beta 5 (7D162j)
>>> Toolchain: Xcode Swift DEVELOPMENT Snapshot 2016-03-01 (a)
>>>
>>> And the errors I’m getting seem to come from a mismatch with the Standard
>>> Library:
>>>
>>> Foundation/FoundationErrors.swift:10:48: Use of undeclared type
>>> ‘ErrorProtocol'
>>> Foundation/NSString.swift:1220:55: Use of undeclared type ‘CVarArg’
>>> Foundation/NSData.swift:18:38: Use of undeclared type ‘OptionSet’
>>> Foundation/NSNotification.swift:95:11: Use of undeclared type ‘Sequence'
>>>  ...
>>>
>>> Any ideas what I’m doing wrong?
>>>
>>> On 03 Mar 2016, at 20:01, Pushkar N Kulkarni via swift-corelibs-dev <
>>> swift-corelibs-dev at swift.org> wrote:
>>>
>>> Brian, Philippe - Thanks for your prompt responses!
>>>
>>> You were right, I was using the  2016-02-08 toolchain. Using the latest (
>>> 2016-03-01) solved the problem :)
>>>
>>> Pushkar N Kulkarni,
>>> IBM Runtimes
>>>
>>> "Any sufficiently advanced technology is indistinguishable from magic." -
>>> Arthur Clarke
>>>
>>>
>>> -----Brian Gesiak <modocache at gmail.com> wrote: -----
>>> To: < swift-corelibs-dev at swift.org>, Pushkar N Kulkarni/India/IBM at IBMIN
>>> From: Brian Gesiak < modocache at gmail.com>
>>> Date: 03/02/2016 11:26PM
>>> Subject: Re: [swift-corelibs-dev] Building Foundation in Xcode
>>>
>>> Hello Pushkar,
>>>
>>> One idea that comes to mind: are you launching Xcode 7.2 using a recent
>>> Swift toolchain? To do so, follow the instructions on this page:
>>> https://swift.org/download/#latest-development-snapshots
>>>
>>> Specifically, you'll want to launch Xcode using the xcrun
>>> launch-with-toolchain command.
>>>
>>> Forgive me if this isn't the problem--I'm not at a computer right now,
>>> but that error message vaguely reminds me of what happens when one tries to
>>> build Foundatoon with an older version of Swift.
>>>
>>> - Brian Gesiak
>>>
>>>
>>>
>>> On Wed, Mar 2, 2016 at 8:09 AM -0800, "Pushkar N Kulkarni via
>>> swift-corelibs-dev" <swift-corelibs-dev at swift.org> wrote:
>>>
>>>> I am very new to Xcode and  tried building Foundation and running
>>>> TestFoundation in Xcode 7.2.1, using the instructions given here.
>>>>
>>>> In step 3, Foundation doesn't build because Xcode reports a compilation
>>>> failure in NSObjCRuntime.swift (please refer to the attached snapshot):
>>>> Use of unresolved identifier '_typeByName'
>>>>
>>>> I can see that this function is defined outside of the Foundation
>>>> project, in the swift project (stdlib/public/core/Misc.swift). I think there
>>>> are other functions defined in the stdlib and used in Foundation. I am not
>>>> sure why this particular symbol causes a problem.
>>>>
>>>> Could someone please tell me how the symbol could be imported so that
>>>> Foundation could be compiled and linked?
>>>>
>>>> <Image.1456916107867.jpg>
>>>>
>>>> Pushkar N Kulkarni,
>>>> IBM Runtimes
>>>>
>>>> "Any sufficiently advanced technology is indistinguishable from magic."
>>>> - Arthur Clarke
>>>>
>>>
>>> _______________________________________________
>>> swift-corelibs-dev mailing list
>>> swift-corelibs-dev at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
>>>
>>>
>>
>> _______________________________________________
>> swift-corelibs-dev mailing list
>> swift-corelibs-dev at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
>>
>
>
>
> --
> Taylor Franklin
> iOS Developer | IBM Mobile Innovation Lab
> 972-207-2051  | taylorleefranklin at gmail.com
> Blog:  http://taylorfranklin.me | LinkedIn:
> https://www.linkedin.com/in/taylorfranklin
>
>
>
>
> _______________________________________________
> swift-corelibs-dev mailing list
> swift-corelibs-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-corelibs-dev
>



-- 
Ian Partridge


More information about the swift-corelibs-dev mailing list