Skip to content
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

fix(install): do not use curl installed through snap #5442

Merged
merged 3 commits into from Oct 11, 2023

Conversation

chipbuster
Copy link
Contributor

Description

Changes the install script to check if the resolved curl is within /snap. If it is, the script prints a warning and acts as if curl is not installed, searching for other download programs.

Motivation and Context

For some reason, curl which comes from the default package on snapcraft is badly broken. Among its deficiencies are:

  1. Attempting to download from a GitHub URL to a location in the home directory results in an empty file being created, even though cURL reports success.
  2. Attempting to download from a GitHub URL to a location in /tmp results in no file being created at all, even though cURL reports success.
  3. Attempting to download to a path with a hidden directory results in spurious failures.

While the broken version of the curl program is capable of downloading the install script and piping it to sh, we have had strange issues when it is used within the installer (#5403). Given the severity and unpredictability of these problems, I think it is safer to disallow the usage of snap-installed curl until all the outstanding issues are fixed.

Closes #5403

How Has This Been Tested?

  • I have tested using MacOS
  • I have tested using Linux
  • I have tested using Windows

Tested on a fresh install of Ubuntu 23.04 installed with the non-legacy installer. Script works in default setting (since wget is installed by default), correctly bypassing curl if it is snap-installed and using it if it is apt-installed.

Checklist:

  • I have updated the documentation accordingly.
  • I have updated the tests accordingly.

Snap-installed curl doesn't work: when trying to download files from
GitHub, it either fails to download the file, or fails to write the
output at all.

Prevent a curl program which is installed with snap from being used to
download starship.
Copy link
Member

@davidkna davidkna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@davidkna davidkna merged commit 0e73817 into starship:master Oct 11, 2023
17 checks passed
@davidkna
Copy link
Member

Thanks for the fix @chipbuster!

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

Successfully merging this pull request may close these issues.

I Can't Download Starship on my Ubuntu System.
2 participants