soroban-cli icon indicating copy to clipboard operation
soroban-cli copied to clipboard

Make installing binary releases a native experience

Open leighmcculloch opened this issue 1 year ago • 17 comments
trafficstars

Installing the CLI from source is the primary way we advertise installing the CLI.

However, building from source is time consuming and makes some assumptions about environment setup, additional compilers like a C compiler, and uses non-trivial amounts of memory resources, bandwidth, CPU capabilities, and ... patience.

We also prebuild binaries for Windows (x86), macOS (x86, arm64), and Linux (x86, arm64). Theoretically no one needs to build from source except those on esoteric systems. In terms of commands on the command line installing from source is the simplest, and so I think it is highly unlikely that folks use the prebuilt binaries much, especially given than our CI job for publishing the binaries is partly broken and requires manual running after each release and even on times we've forgotten no one has complained.

We should make these binaries easy to install using tools folks already have on their system.

While we do support cargo-bininstall, that binary is not often installed for folks and itself is a reasonably large installation. It's a good option to have on hand for folks who have it, but shouldn't be the core of the distribution story.

I think we should make a one line shell script install that works for the majority of users:

curl -L https://cli.stellar.org | bash

And similar for Windows if such a command exists, or winget is probably more appropriate given it is built-in to Windows.

I think we should also add release targets for all of the following, over time. For any platform where multiple options are listed, I've ordered them by priority.

Crossplatform

  • [ ] ~curl | bash (e.g. curl -L https://cli.stellar.org | bash)~ [Edit: Deprioritizing for now.]
  • [ ] ~NPM, that installs the prebuilt binary (e.g. npm -g install @stellar/stellar-cli)~ [Edit: Deprioritizing for now.]
  • [ ] ~Cargo, that installs the prebuilt binary (e.g. cargo install stellar-cli-bin)~ [Edit: Deprioritizing for now.]
  • [ ] ~Docker (e.g. docker run -i stellar/stellar-cli)~ https://github.com/stellar/stellar-cli/pull/1550

Windows (x86)

  • [ ] Winget (e.g. winget install Stellar.StellarCLI) @fnando

macOS (x86, arm64)

  • [x] Homebrew - We currently run a homebrew source-only tap. https://github.com/Homebrew/homebrew-core/pull/180191 @leighmcculloch

Linux (x86, arm64)

  • [x] Homebrew - Same as above for supporting Homebrew on Linux. https://github.com/Homebrew/homebrew-core/pull/180191
  • [ ] ~Debian/Ubuntu~
    • ~SDF hosts an apt repo that could house the stellar-cli as a package to install.~

CI

  • [x] GitHub Actions - Add an action to the repo so the cli can be installed from binary with: @leighmcculloch - uses: stellar/[email protected] @leighmcculloch

leighmcculloch avatar Jul 12 '24 04:07 leighmcculloch