Skip to content

Swiftly installation instructions are inaccurate for shells like fish #963

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
MahdiBM opened this issue Apr 8, 2025 · 3 comments
Open
Labels
bug Something isn't working

Comments

@MahdiBM
Copy link
Contributor

MahdiBM commented Apr 8, 2025

Describe the bug

https://www.swift.org/install/macos/
instructs to use this command to install swiftly:

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

However, for the fish shell the second-to-last line should be . ~/.swiftly/env.fish && \

The current instructions results in this error:

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

Proceed? (Y/n):
y
Creating shell environment file for the user...
Updating profile...
Fetching the latest stable Swift release...
Installing Swift 6.1.0
                                                   Downloading Swift 6.1.0
100% [========================================================================================================================]
Downloaded 1462.2 MiB of 1462.2 MiB

Installing package in user home directory...
The global default toolchain has been set to `Swift 6.1.0`
Swift 6.1.0 installed successfully!
.: Error encountered while sourcing file '/Users/my-user/.swiftly/env.sh':
.: No such file or directory

You can still manually run source /Users/my-user/.swiftly/env.fish.

To Reproduce

Steps to reproduce the behavior:

Use fish shell and follow the installation instructions.

Expected behavior

Smooth installation for users of other shells.

Actual behavior

Errors as described.

Screenshots

Environment details

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

If possible, minimal yet complete reproducer code (or link to code)

Swift.org version/commit hash

Additional context

@MahdiBM MahdiBM added the bug Something isn't working label Apr 8, 2025
@MahdiBM
Copy link
Contributor Author

MahdiBM commented Apr 8, 2025

Maybe the second to last line can be changed to . ~/.swiftly/env.$(basename $SHELL) && \?

I'm not 100% sure this'll behave correctly with Swiftly, but i think basename is available everywhere so using that should be fine.

@MahdiBM
Copy link
Contributor Author

MahdiBM commented Apr 8, 2025

cc @cmcgee1024 since this is swiftly related.

@cmcgee1024
Copy link
Member

See #946

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants