<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">FWIW, this:<div class="">&nbsp; <a href="https://gist.github.com/ddunbar/598bf66952fba0e9d8aecc54995f018e" class="">https://gist.github.com/ddunbar/598bf66952fba0e9d8aecc54995f018e</a></div><div class="">is the script I currently use on OS X to get a working "swift-dev.xctoolchain" out of a built Swift. It isn't designed to work for anyone but me, but it should be easy to adapt.<div class=""><br class=""></div><div class="">I always run this after every build, and then use `TOOLCHAINS=swift-dev swift build` (etc) to use the development compiler.</div><div class=""><br class=""></div><div class="">My "toolchain-based build process" proposal will hopefully make this a no-op.</div><div class=""><br class=""></div><div class="">&nbsp;- Daniel</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2016, at 3:12 AM, bhargav gurlanka via swift-build-dev &lt;<a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi all,<div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""><div dir="ltr" class=""><div class=""></div></div></div></div></div></div></div>
<div class=""><br class=""></div><div class="">I'm trying to build a custom toolchain, but it is failing with error:&nbsp;</div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><div class=""><font face="monospace, monospace" class="">--- Installing swift ---</font></div><div class=""><font face="monospace, monospace" class="">+ env DESTDIR=// /usr/local/bin/cmake --build /Users/bhargavg/Documents/workspaces/xcode/github/apple/build/bhargavg/swift-macosx-x86_64 -- install</font></div><div class=""><font face="monospace, monospace" class="">ninja: error: unknown target 'install'</font></div></div><div class=""><font face="monospace, monospace" class="">swift/utils/build-script: fatal error: command terminated with a non-zero exit status 1, aborting<br class=""></font></div><div class=""><font face="monospace, monospace" class=""><br class=""></font></div><div class=""><div class=""><br class=""></div><div class="">Script to build toolchain:&nbsp;</div></div><div class=""><br class=""></div><div class=""><pre style="word-wrap: break-word; white-space: pre-wrap;" class="">#!/bin/bash
#
# Faster toolchain build: skips as much as possible.
#
# To use this toolchain from the command line:"
#     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 "exit;" SIGINT SIGTERM

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

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

export TOOLCHAINS=default

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

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

"$SRCROOT/swift/utils/build-script" \
        --release \
        --llvm \
        --llbuild \
        --swiftpm \
        --build-subdir="${ALIAS}" \
        --assertions \
        --no-swift-stdlib-assertions \
        --install-prefix="${TOOLCHAIN_PREFIX}/usr" \
        --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="compiler;clang-builtin-headers;stdlib;sdk-overlay;license;sourcekit-xpc-service" \
        --llvm-install-components="libclang;libclang-headers" \
        --install-swift=1 \
        --install-llbuild=1 \
        --install-swiftpm=1 \
        --install-destdir="/" \
        --install-lldb=1 \
        --toolchain-prefix="${TOOLCHAIN_PREFIX}"


# 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=$("${TOOLCHAIN_PREFIX}/usr/bin/swift" --version | ruby -e 'ARGF.read =~ /Swift version (\d+\.\d(\.\d+)?(-.*?)?) /; print "#{$1}\n"')

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

VERSION="${SWIFT_VERSION}-${ALIAS}+${DATE}"

cat &gt; "${TOOLCHAIN_PREFIX}/Info.plist" &lt;&lt;EOF
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<a href="http://www.apple.com/DTDs/PropertyList-1.0.dtd" class="">http://www.apple.com/DTDs/PropertyList-1.0.dtd</a>"&gt;
&lt;plist version="1.0"&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/" class="">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 "${SRCROOT}/swift/utils/swift-stdlib-tool-substitute" "${TOOLCHAIN_PREFIX}/usr/bin/swift-stdlib-tool"</pre></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">You can find the script at:&nbsp;<a href="https://gist.github.com/bhargavg/e40b2e7cfe3b34ca5decdb6531068365" class="">https://gist.github.com/bhargavg/e40b2e7cfe3b34ca5decdb6531068365</a></div><div class=""><br class=""></div><div class="">Regards,</div><div class="">Bhargav Gurlanka</div><div class=""><br class=""></div></div>
_______________________________________________<br class="">swift-build-dev mailing list<br class=""><a href="mailto:swift-build-dev@swift.org" class="">swift-build-dev@swift.org</a><br class="">https://lists.swift.org/mailman/listinfo/swift-build-dev<br class=""></div></blockquote></div><br class=""></div></div></body></html>