Skip to content

Fix the quick install scripts, and test them on Linux, macOS and Windows - #245

Merged
wu-sheng merged 1 commit into
masterfrom
fix-install-scripts
Nov 11, 2026
Merged

wu-sheng merged 1 commit into
masterfrom
fix-install-scripts

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

The README's quick install commands fail: scripts/install.sh and scripts/install.bat read the latest version from data/releases.yml on the website, which the website no longer has (apache/skywalking-website#928), so both stop at "Can't get the latest version".

Changes

  • Latest version: both scripts take it from the latest GitHub release. https://github.com/apache/skywalking-cli/releases/latest redirects to .../releases/tag/<version>, so there is no API rate limit and no JSON to parse, in bash or cmd.
  • Download: from downloads.apache.org, falling back to archive.apache.org, which has every release but picks up a new one later. Files go to a temporary directory that is removed afterwards, instead of the current directory.
  • install.sh:
    • Installs the binary for the machine's architecture (amd64, arm64, 386) instead of always amd64, so Apple silicon and Linux arm64 get native binaries, also from a Rosetta 2 shell.
    • Accepts sha512sum or shasum. Minimal Linux images have no shasum.
    • Uses sudo only when /usr/local/bin is not writable.
  • install.bat:
    • Picks windows-386 on 32-bit Windows.
    • Checks the sha512 with Get-FileHash instead of parsing CertUtil output.
    • Adds the install directory to the system PATH once. setx Path "...;%path%" /m wrote the merged user and system PATH into the system one, cut it at 1024 characters, and added the directory again on every run.
  • New Install Scripts workflow:
    • Runs install.sh on ubuntu x64, ubuntu arm64 and macOS, and install.bat on Windows.
    • Each script runs twice, to check that reinstalling over an existing install works. On Windows it also checks the system PATH has the directory exactly once.
    • Triggers: changes to the scripts, plus a weekly run, because an outside change is what broke them this time.
    • It is not part of the Required check.

Tested locally (macOS, bash 3.2)

install.sh was run against a file:// mirror of the 0.16.0 release, with the install directory pointed at a scratch directory:

  • It falls back past a missing host, verifies the checksum, installs darwin-arm64 (also from an arch -x86_64 shell), and leaves no temporary files.
  • A wrong checksum, a failed version lookup, and missing sha512 tools each abort with a message.
  • shellcheck, actionlint and license-eye are clean.

install.bat is tested only by the Windows job here.

install.sh and install.bat read the latest version from data/releases.yml on the website, which the website no
longer has, so both stopped at "Can't get the latest version".

- Both take the version from the latest GitHub release, whose URL redirects to .../releases/tag/<version>; no API
  rate limit and no JSON to parse, in bash or cmd.
- Both download from downloads.apache.org, falling back to archive.apache.org, which has every release but picks up
  a new one later. Downloads go to a temporary directory that is removed afterwards.
- install.sh installs the binary for the machine's architecture (amd64, arm64, 386) instead of always amd64, also
  under Rosetta 2, accepts sha512sum or shasum, and uses sudo only when /usr/local/bin is not writable.
- install.bat picks windows-386 on 32-bit Windows, checks the sha512 with Get-FileHash instead of parsing CertUtil
  output, and adds the install directory to the system PATH once. setx wrote the merged user and system PATH into
  the system PATH, cut it at 1024 characters, and added the directory again on every run.
- A new Install Scripts workflow runs install.sh on ubuntu x64, ubuntu arm64 and macOS, and install.bat on Windows,
  twice each, when the scripts change and every Monday, since an outside change broke them last time.
@wu-sheng wu-sheng added this to the 0.17.0 milestone Nov 11, 2026
@wu-sheng wu-sheng added the bug Something isn't working label Nov 11, 2026
@wu-sheng
wu-sheng merged commit cf7b56c into master Nov 11, 2026
11 checks passed
@wu-sheng
wu-sheng deleted the fix-install-scripts branch November 11, 2026 02:46
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

Successfully merging this pull request may close these issues.

2 participants