<div dir="ltr">&gt; <span style="font-size:12.8px">I always run this after every build</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">If I understand you correctly, you first build swift and then run this script to create the toolchain right?  </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Are you using the `build-toolchain` script to build swift? I&#39;ve tried doing it sometime back and it included the testing also, which took a long time to complete. Is there a way to quicken the build (by disabling tests, incremental build, etc.,)?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px"><br></span></div><div class="gmail_extra">Regards,</div><div class="gmail_extra">Bhargav Gurlanka</div><div class="gmail_extra"><br><div class="gmail_quote">On 2 June 2016 at 23:06, Daniel Dunbar <span dir="ltr">&lt;<a href="mailto:daniel_dunbar@apple.com" target="_blank">daniel_dunbar@apple.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">FWIW, this:<div>  <a href="https://gist.github.com/ddunbar/598bf66952fba0e9d8aecc54995f018e" target="_blank">https://gist.github.com/ddunbar/598bf66952fba0e9d8aecc54995f018e</a></div><div>is the script I currently use on OS X to get a working &quot;swift-dev.xctoolchain&quot; out of a built Swift. It isn&#39;t designed to work for anyone but me, but it should be easy to adapt.<div><br></div><div>I always run this after every build, and then use `TOOLCHAINS=swift-dev swift build` (etc) to use the development compiler.</div><div><br></div><div>My &quot;toolchain-based build process&quot; proposal will hopefully make this a no-op.</div><div><br></div><div> - Daniel</div><div><br><div><blockquote type="cite"><div><div class="h5"><div>On Jun 2, 2016, at 3:12 AM, bhargav gurlanka via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" target="_blank">swift-build-dev@swift.org</a>&gt; wrote:</div><br></div></div><div><div><div class="h5"><div dir="ltr">Hi all,<div data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div></div></div></div></div></div></div></div>
<div><br></div><div>I&#39;m trying to build a custom toolchain, but it is failing with error: </div><div><font face="monospace, monospace"><br></font></div><div><div><font face="monospace, monospace">--- Installing swift ---</font></div><div><font face="monospace, monospace">+ env DESTDIR=// /usr/local/bin/cmake --build /Users/bhargavg/Documents/workspaces/xcode/github/apple/build/bhargavg/swift-macosx-x86_64 -- install</font></div><div><font face="monospace, monospace">ninja: error: unknown target &#39;install&#39;</font></div></div><div><font face="monospace, monospace">swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting<br></font></div><div><font face="monospace, monospace"><br></font></div><div><div><br></div><div>Script to build toolchain: </div></div><div><br></div><div><pre style="word-wrap:break-word;white-space:pre-wrap">#!/bin/bash
#
# Faster toolchain build: skips as much as possible.
#
# To use this toolchain from the command line:&quot;
#     export TOOLCHAINS=$(whoami)
#
# we build to the same prefix every time (instead of building
# to a versioned prefix) because every time the prefix changes
# *everything* rebuilds.

set -e
trap &quot;exit;&quot; SIGINT SIGTERM

SRCROOT=&quot;$HOME<span style="color:rgb(34,34,34);font-family:monospace,monospace;white-space:normal">/Documents/workspaces/xcode/github/apple/</span>&quot;

ALIAS=$(whoami)
TOOLCHAIN_NAME=&quot;swift-${ALIAS}.xctoolchain&quot;
TOOLCHAIN_PREFIX=&quot;$HOME/Library/Developer/Toolchains/${TOOLCHAIN_NAME}&quot;

export TOOLCHAINS=default

if [[ $1 == &quot;--reconfigure&quot; ]]; then
    RECONFIGURE=&quot;--reconfigure&quot;
fi

# so if anything is put in the wrong place we will *see* it
cd &quot;$HOME/Desktop&quot;

&quot;$SRCROOT/swift/utils/build-script&quot; \
        --release \
        --llvm \
        --llbuild \
        --swiftpm \
        --build-subdir=&quot;${ALIAS}&quot; \
        --assertions \
        --no-swift-stdlib-assertions \
        --install-prefix=&quot;${TOOLCHAIN_PREFIX}/usr&quot; \
        --lldb \
        --darwin-xcrun-toolchain=mxcl \
        -- \
        --lldb-use-system-debugserver \
        ${RECONFIGURE} \
        --skip-ios \
        --skip-tvos \
        --skip-watchos \
        --skip-build-linux \
        --skip-build-freebsd \
        --skip-build-cygwin \
        --skip-build-ios \
        --skip-build-ios-device \
        --skip-build-ios-simulator \
        --skip-build-tvos \
        --skip-build-tvos-device \
        --skip-build-tvos-simulator \
        --skip-build-watchos \
        --skip-build-watchos-device \
        --skip-build-watchos-simulator \
        --skip-build-xctest \
        --skip-build-foundation \
        --skip-build-libdispatch \
        --skip-build-benchmarks \
        --skip-test-cmark \
        --skip-test-lldb \
        --skip-test-swift \
        --skip-test-llbuild \
        --skip-test-swiftpm \
        --skip-test-xctest \
        --skip-test-foundation \
        --skip-test-libdispatch \
        --skip-test-linux \
        --skip-test-freebsd \
        --skip-test-cygwin \
        --skip-test-osx \
        --skip-test-ios-simulator \
        --skip-test-ios-host \
        --skip-test-tvos-simulator \
        --skip-test-tvos-host \
        --skip-test-watchos-simulator \
        --skip-test-watchos-host \
        --skip-test-benchmarks \
        --skip-test-optimized \
        --stdlib-deployment-targets=macosx-x86_64 \
        --swift-enable-ast-verifier=0 \
        --build-swift-examples=0 \
        --build-swift-stdlib-unittest-extra=0 \
        --build-swift-static-stdlib=1 \
        --compiler-vendor=apple \
        --swift-install-components=&quot;compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-xpc-service&quot; \
        --llvm-install-components=&quot;libclang;libclang-headers&quot; \
        --install-swift=1 \
        --install-llbuild=1 \
        --install-swiftpm=1 \
        --install-destdir=&quot;/&quot; \
        --install-lldb=1 \
        --toolchain-prefix=&quot;${TOOLCHAIN_PREFIX}&quot;


# doing by hand as the only other way to trigger this
# is by specifying --installable-package, which tars
# all installed products and is super slow

DATE=$(date +%Y.%m.%d)
SWIFT_VERSION=$(&quot;${TOOLCHAIN_PREFIX}/usr/bin/swift&quot; --version | ruby -e &#39;ARGF.read =~ /Swift version (\d+\.\d(\.\d+)?(-.*?)?) /; print &quot;#{$1}\n&quot;&#39;)

if [[ &quot;$SWIFT_VERSION&quot; == &quot;3.0-dev&quot; ]]; then
    SWIFT_VERSION=&quot;3.0.0-dev&quot;
fi

VERSION=&quot;${SWIFT_VERSION}-${ALIAS}+${DATE}&quot;

cat &gt; &quot;${TOOLCHAIN_PREFIX}/Info.plist&quot; &lt;&lt;EOF
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;<a href="http://www.apple.com/DTDs/PropertyList-1.0.dtd" target="_blank">http://www.apple.com/DTDs/PropertyList-1.0.dtd</a>&quot;&gt;
&lt;plist version=&quot;1.0&quot;&gt;
&lt;dict&gt;
        &lt;key&gt;Aliases&lt;/key&gt;
        &lt;array&gt;
                &lt;string&gt;${ALIAS}&lt;/string&gt;
        &lt;/array&gt;
        &lt;key&gt;CompatibilityVersion&lt;/key&gt;
        &lt;integer&gt;2&lt;/integer&gt;
        &lt;key&gt;CFBundleIdentifier&lt;/key&gt;
        &lt;string&gt;org.swift.${SWIFT_VERSION}.${ALIAS}&lt;/string&gt;
        &lt;key&gt;DisplayName&lt;/key&gt;
        &lt;string&gt;Swift ${SWIFT_VERSION}.${ALIAS}+${DATE}&lt;/string&gt;
        &lt;key&gt;ReportProblemURL&lt;/key&gt;
        &lt;string&gt;<a href="https://bugs.swift.org/" target="_blank">https://bugs.swift.org/</a>&lt;/string&gt;
        &lt;key&gt;Version&lt;/key&gt;
        &lt;string&gt;${DATE}&lt;/string&gt;
    &lt;key&gt;OverrideEnvironment&lt;/key&gt;
        &lt;dict&gt;
                &lt;key&gt;ENABLE_BITCODE&lt;/key&gt;
                &lt;false/&gt;
                &lt;key&gt;SWIFT_DISABLE_REQUIRED_ARCLITE&lt;/key&gt;
                &lt;true/&gt;
                &lt;key&gt;SWIFT_LINK_OBJC_RUNTIME&lt;/key&gt;
                &lt;true/&gt;
        &lt;/dict&gt;
&lt;/dict&gt;
&lt;/plist&gt;
EOF


# again, only way to trigger this otherwise is do a lengthy --installable-package step

cp &quot;${SRCROOT}/swift/utils/swift-stdlib-tool-substitute&quot; &quot;${TOOLCHAIN_PREFIX}/usr/bin/swift-stdlib-tool&quot;</pre></div><div><br></div><div><br></div><div>You can find the script at: <a href="https://gist.github.com/bhargavg/e40b2e7cfe3b34ca5decdb6531068365" target="_blank">https://gist.github.com/bhargavg/e40b2e7cfe3b34ca5decdb6531068365</a></div><div><br></div><div>Regards,</div><div>Bhargav Gurlanka</div><div><br></div></div></div></div>
_______________________________________________<br>swift-build-dev mailing list<br><a href="mailto:swift-build-dev@swift.org" target="_blank">swift-build-dev@swift.org</a><br><a href="https://lists.swift.org/mailman/listinfo/swift-build-dev" target="_blank">https://lists.swift.org/mailman/listinfo/swift-build-dev</a><br></div></blockquote></div><br></div></div></div></blockquote></div><div><br></div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div></div></div></div></div></div></div></div>
</div></div>