[swift-dev] New to building Swift toolchain

Maksym Grebenets mgrebenets at gmail.com
Sat Sep 16 08:26:17 CDT 2017


Hi all

I guess like many other iOS devs with c/c++ background I really wanted to
get into Swift development one day, at least a tiny bit, at least to
understand how things work.

So new refactoring tools and starter tasks finally pulled me in.

With a lot of struggle and a lot of help from community I was able to
understand how lit works, how to walk the AST and write changes back to the
editor. I've got code and tests for new refactoring kind and new
refactoring action, so I was like "yay, time to build the keychain and just
try it in Xcode!!!".

That's where I was thrown back to the "what do I do?" state again...

I pulled latest *master* branch and ran *build-toolchain *and all of that
just to be told after almost an hour or so that there are 3 failing tests...

So I thought:

cd swift
git checkout swift-DEVELOPMENT-SNAPSHOT-2017-09-15-a
cd ..
./swift/utils/update-checkout --tag swift-DEVELOPMENT-SNAPSHOT-2017-09-15-a

then build and fail again :(...

OK then, so I just disable the tests and give it another go:

# build-presets.ini
#test
#validation-test
#long-test

Yay! I got a toolchain!
I copy it over to /Library/Developer/Toolchains/
Select it in Xcode (latest Xcode 9 GM) and... no luck
The source code highlighting disappears,
I get "An internal error occurred. Source editor functionality is
limited..." error.
All of the refactoring actions are disabled.

I guess those 3 failing tests did matter in the end...


I may be frustrated, because I don't understand what's going on, but I
don't feel like giving up.

I'd appreciate any help or advice I can get!

Should I choose an older tag from before to get all tests passing?
Should I build using Xcode beta rather then GM?
Is there any way to build/re-build the OS X toolchain any faster?
Why does it take so long even if I just re-run same command again?
Where did I get it wrong so the toolchain doesn't really work with Xcode?
Can I connect lldb to process that runs my lit tests?

I'm sorry for having so many questions, but you can imagine there isn't a
lot of information for newbies like me trying to get into Swift compiler
development. Well, let's just say I couldn't find much :) I've just
realized that this mail list is better option that StackOverflow about an
hour ago :) Though, of course, I have read Brian Gesiak's posts and the
swift.org blog post on refactoring.

Just to sum up all of the above, how to I get to build local Xcode
toolchain which I can plug in to Xcode and test?

Thank you!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20170916/f44fb74f/attachment.html>


More information about the swift-dev mailing list