[swift-dev] Build and install custom toolchain?

Daniel Dunbar daniel_dunbar at apple.com
Wed Dec 9 23:37:59 CST 2015

Agreed, we should probably try and clean up the command line syntax (and --help) to direct people towards the options that make the most sense. Having just an "--install" option that did something sensible for your current platform + other options would make a lot of sense to me.

I'd recommend filing specific enhancement requests as bugs, since these should be easy things for people to cherry pick off. Ditto for the bug about the install path.

 - Daniel

> On Dec 9, 2015, at 9:34 PM, Kevin Ballard via swift-dev <swift-dev at swift.org> wrote:
> It does help, thanks. I'm surprised there's no script (or option to build-script) to do this automatically. Seems like a reasonable thing to want to do upon occasion.
> Also, I assume that those of us who aren't at Apple probably don't want to be using /Applications/Xcode.app/Contents/Developer/Toolchains/ as our install dir, but instead /Library/Developer/Toolchains/ like where the snapshot installs.
> -Kevin Ballard
> On Wed, Dec 9, 2015, at 04:18 PM, Mish Awadah wrote:
>> Hi Kevin,
>> Here’s what I’ve done in the past to build a toolchain using the build script. 
>> function build_osx_package() {
>>    YEAR=$(date +"%Y")
>>    MONTH=$(date +"%m")
>>    DAY=$(date +"%d")
>>    ARCHIVE="${TOOLCHAIN_VERSION}-osx.tar.gz"
>>    SYM_ARCHIVE="${TOOLCHAIN_VERSION}-osx-symbols.tar.gz"
>>    BUNDLE_IDENTIFIER="org.swift.${YEAR}${MONTH}${DAY}"
>>    DISPLAY_NAME="Swift Development Snapshot"
>>    SWIFT_BUILD_ROOT="${SRC_DIR}/build"
>>    SWIFT_INSTALL_DIR="${SRC_DIR}/swift-nightly-install"
>>    SWIFT_INSTALL_SYMROOT="${SRC_DIR}/swift-nightly-symroot"
>>    SWIFT_TOOLCHAIN_DIR="/Applications/Xcode.app/Contents/Developer/Toolchains/${TOOLCHAIN_NAME}.xctoolchain"
>>    ./swift/utils/build-script --preset="buildbot_osx_package" install_destdir="${SWIFT_INSTALL_DIR}" installable_package="${SWIFT_INSTALLABLE_PACKAGE}" install_toolchain_dir="${SWIFT_TOOLCHAIN_DIR}" install_symroot="${SWIFT_INSTALL_SYMROOT}" symbols_package="${SYMBOLS_PACKAGE}" darwin_toolchain_bundle_identifier="${BUNDLE_IDENTIFIER}" darwin_toolchain_display_name="${DISPLAY_NAME}" darwin_toolchain_xctoolchain_name="${TOOLCHAIN_NAME}" darwin_toolchain_version="${TOOLCHAIN_VERSION}"
>> }
>> HTH,
>> - mish
>>> On Dec 9, 2015, at 2:32 PM, Kevin Ballard via swift-dev <swift-dev at swift.org> wrote:
>>> Is there an easy way to build and install my own toolchain into /Library/Developer/Toolchains? I assume there must be some automated way to construct the package installer, but nothing immediately leaps out at me. It looks like build-script can create a root, but that seems to be for BNI, which isn't helpful.
>>> The reason for doing this here is I have a Vim plugin that lets me execute Swift scripts from vim buffers, and it supports using the swift from any given Xcode. I want to teach it how to find swift in /Library/Developer/Toolchains instead, which requires that I actually install a toolchain there (teaching it how to use the build folder from my swift checkout is doable, but that's not very portable).
>>> -Kevin Ballard
>>> _______________________________________________
>>> swift-dev mailing list
>>> swift-dev at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-dev
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

More information about the swift-dev mailing list