[swift-dev] Beginner's questions about building Swift from source etc.

Jens Persson jens at bitcycle.com
Fri Dec 11 00:09:51 CST 2015


Just to clarify (not sure if it's needed): Note that I can run Xcode with
my custom toolchain, eg:
xcrun launch-with-toolchain ./swift-SNAPSHOT-2015-12-11-a.xctoolchain

What I want to know is the part about switching between the command line
tools, not only between my Xcode and Xcode-beta (which I can do using
xcode-select) but also between those and my custom built Swift.

/Jens


On Fri, Dec 11, 2015 at 6:47 AM, Dmitri Gribenko <gribozavr at gmail.com>
wrote:

> Mish Awadah probably knows about setting up a custom toolchain in Xcode.
>
> Dmitri
>
> On Thu, Dec 10, 2015 at 9:44 PM, Jens Persson <jens at bitcycle.com> wrote:
> > Thanks again,
> > I pulled the latest Swift repos which included the fix of the failing
> test
> > and modified the build preset locally according to Dmitri's advice and
> the
> > build completes without problems.
> >
> > But now I wonder if there is a way to switch between the command line
> tools
> > of Xcode, Xcode-beta and the Swift I've just built from sources?
> >
> > I mean, when I want to switch between the command line tools of Xcode and
> > Xcode-beta I can simply do:
> > sudo xcode-select -s /Applications/Xcode[-beta].app
> >
> > Is there something similar that I can do in order to switch to the
> command
> > line tools from the one I built from sources?
> >
> > These instructions: https://swift.org/download/
> > just says "add the Swift toolchain to your path" (using export) but I'm
> > hesitant to do that since I don't know whether that will work when I
> already
> > have Xcode and Xcode-beta installed (and thus /usr/bin/swiftc etc)?
> >
> > /Jens
> >
> >
> > On Thu, Dec 10, 2015 at 6:11 PM, Dmitri Gribenko <gribozavr at gmail.com>
> > wrote:
> >>
> >> On Thu, Dec 10, 2015 at 7:41 AM, Jens Persson <jens at bitcycle.com>
> wrote:
> >> > Thanks!
> >> > I tried the above to compile with the buildbot_osx_package preset. It
> >> > kind
> >> > of worked, but it failed while performing the tests.
> >> > (TEST 'Swift :: Driver/Dependencies/bindings-build-record.swift'
> FAILED)
> >> > So, I got a working swiftc etc but no package or toolchain or anything
> >> > (at
> >> > least as far as I could see).
> >> >
> >> > However, trying out the resulting swiftc shows that it is slow, ie the
> >> > buildbot_osx_package preset did not imply --no-assertions
> >> > --no-swift-stdlib-assertions.
> >>
> >> Jens,
> >>
> >> I think you found an issue in our presets.  I filed
> >> https://bugs.swift.org/browse/SR-180  Here, we have an incorrect
> >> workaround that causes this issue:
> >>
> >> [preset: mixin_lightweight_assertions]
> >> assertions
> >>
> >> # FIXME: This should be:
> >> # no-assertions
> >> # swift-assertions
> >> # ... but our tests are expecting assertions to be either on or off
> >> everywhere.
> >>
> >> I think this hacky patch should get you unblocked (untested!):
> >>
> >>
> >>
> -------------------------------------------------------------------------------------
> >> diff --git a/utils/build-presets.ini b/utils/build-presets.ini
> >> index 6dc6d24..1ab441f 100644
> >> --- a/utils/build-presets.ini
> >> +++ b/utils/build-presets.ini
> >> @@ -462,12 +462,8 @@ swift-runtime-enable-leak-checker=1
> >>  # A mixin that enables 'lightweight' assertions that don't slow down
> the
> >>  # compiler significantly.
> >>  [preset: mixin_lightweight_assertions]
> >> -assertions
> >> -
> >> -# FIXME: This should be:
> >> -# no-assertions
> >> -# swift-assertions
> >> -# ... but our tests are expecting assertions to be either on or off
> >> everywhere.
> >> +no-assertions
> >> +swift-assertions
> >>
> >>  dash-dash
> >>
> >> @@ -592,8 +588,6 @@ build-subdir=buildbot_osx
> >>  ios
> >>  tvos
> >>  watchos
> >> -test
> >> -validation-test
> >>
> >>  dash-dash
> >>
> >>
> -------------------------------------------------------------------------------------
> >>
> >> Dmitri
> >>
> >> --
> >> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> >> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
> >
> >
> >
> >
> > --
> > bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden
> > http://www.bitcycle.com/
> > Phone: +46-73-753 24 62
> > E-mail: jens at bitcycle.com
> >
>
>
>
> --
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/
>



-- 
bitCycle AB | Smedjegatan 12 | 742 32 Östhammar | Sweden
http://www.bitcycle.com/
Phone: +46-73-753 24 62
E-mail: jens at bitcycle.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20151211/167757b3/attachment.html>


More information about the swift-dev mailing list