Skip to content

macOS: Toolchains are not installed in SWIFTLY_HOME_DIR #277

Open
@ADKaster

Description

@ADKaster

After installing the pkg to bootstrap from, setting both SWIFTLY_BIN_DIR and SWIFTLY_HOME_DIR does not impact where toolchains are installed.

(venv) andrew@Andrews-MacBook-Pro-2:~/Source/test/swiftly-install$ SWIFTLY_BIN_DIR=$PWD/bin SWIFTLY_HOME_DIR=$PWD/share ~/.swiftly/bin/swiftly init --no-modify-profile --quiet-shell-followup 
Swiftly will be installed into the following locations:

/Users/andrew/Source/test/swiftly-install/share - Data and configuration files directory including toolchains
/Users/andrew/Source/test/swiftly-install/bin - Executables installation directory

These locations can be changed with SWIFTLY_HOME_DIR and SWIFTLY_BIN_DIR environment variables and run this again.

Once swiftly is installed it will install the latest available swift toolchain.

Proceed? (Y/n): 
y
Installing swiftly in /Users/andrew/Source/test/swiftly-install/bin/swiftly...
Creating shell environment file for the user...

The initial toolchain was already installed by a previous "init" call, but installing a new toolchain still doesn't put it in my set SWIFTLY_HOME_DIR.

(venv) andrew@Andrews-MacBook-Pro-2:~/Source/test/swiftly-install$ SWIFTLY_BIN_DIR=$PWD/bin SWIFTLY_HOME_DIR=$PWD/share ./bin/swiftly install main-snapshot-2025-03-25
Installing main-snapshot-2025-03-25
                                               Downloading main-snapshot-2025-03-25
100% [================================================================================================================]
Downloaded 1616.8 MiB of 1616.8 MiB

Installing package in user home directory...
The global default toolchain has been set to `main-snapshot-2025-03-25`
main-snapshot-2025-03-25 installed successfully!
NOTE: We have updated some elements in your path and your shell may not yet be
aware of the changes. You can run this command to update your shell.

    hash -r

(venv) andrew@Andrews-MacBook-Pro-2:~/Source/test/swiftly-install$ ls share
config.json	env.sh
(venv) andrew@Andrews-MacBook-Pro-2:~/Source/test/swiftly-install$ cat share/env.sh 
export SWIFTLY_HOME_DIR="/Users/andrew/Source/test/swiftly-install/share"
export SWIFTLY_BIN_DIR="/Users/andrew/Source/test/swiftly-install/bin"
if [[ ":$PATH:" != *":$SWIFTLY_BIN_DIR:"* ]]; then
    export PATH="$SWIFTLY_BIN_DIR:$PATH"
fi

Seems like they're placed in /Users/andrew/Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2025-03-25-a.xctoolchain instead?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions