Skip to content

macOS: Update installation instructions #279

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
sdavids opened this issue Mar 30, 2025 · 1 comment
Open

macOS: Update installation instructions #279

sdavids opened this issue Mar 30, 2025 · 1 comment

Comments

@sdavids
Copy link

sdavids commented Mar 30, 2025

https://www.swift.org/install/macos/

The installation instructions do not work when one sets up SWIFTLY_HOME_DIR before following them.

$ env -i zsh -df
$ export TERM=xterm-256color
$ export PATH="${HOME}/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
$ export XDG_DATA_HOME="${HOME}/.local/share"
$ export SWIFTLY_HOME_DIR="${XDG_DATA_HOME}/swiftly"
$ export SWIFTLY_BIN_DIR="${HOME}/.local/bin"
$ env
HOME=/Users/redacted
LOGNAME=redacted
SHLVL=1
PWD=/Users/redacted/Downloads
OLDPWD=/Users/redacted/Downloads
PATH=/Users/redacted/.local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
XDG_DATA_HOME=/Users/redacted/.local/share
SWIFTLY_HOME_DIR=/Users/redacted/.local/share/swiftly
SWIFTLY_BIN_DIR=/Users/redacted/.local/bin
TERM=xterm-256color
_=/usr/bin/env

$ curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \
~/.swiftly/bin/swiftly init --quiet-shell-followup && \
. ~/.swiftly/env.sh && \
hash -r
...
Swiftly will be installed into the following locations:

/Users/redacted/.local/share/swiftly - Data and configuration files directory including toolchains
/Users/redacted/.local/bin - Executables installation directory
...
The global default toolchain has been set to `Swift 6.0.3`
Swift 6.0.3 installed successfully!
.: no such file or directory: /Users/redacted/.swiftly/env.sh

I think the installation instructions should be updated to:

curl -O https://download.swift.org/swiftly/darwin/swiftly.pkg && \
installer -pkg swiftly.pkg -target CurrentUserHomeDirectory && \
~/.swiftly/bin/swiftly init --quiet-shell-followup && \
. "${SWIFTLY_HOME_DIR:-~/.swiftly}/env.sh" && \
hash -r
@sdavids sdavids changed the title Update installation instructions macOS: Update installation instructions Mar 30, 2025
@cmcgee1024
Copy link
Member

This change belongs on the swift website repo. You might be interested in this PR, which fixes this problem and adds fish support too: swiftlang/swift-org-website#946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants