axodotdev / axodotdev/axoupdater

pure rust self-install logic

Open
#85 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
31
Forks
13
PR merge metrics
No merged PRs in 30d

Description

The installer.sh and installer.ps1 scripts in cargo-dist are a hybrid of rustup's installer bootstrap scripts and [this rust code](https://github.com/rust-lang/rustup/tree/master/src/cli/self_update).

In rustup the installer scripts just handle detecting target triple, unpacking the archive into a tempdir *and then run the rustup binary to finish installing itself*. Updating rustup at that point is rustup itself doing the fetch and unpack, and again running its new self.

This is honestly the ideal way for an installer to work, as it gives the cli dev all the room in the world to add custom install logic/output in a way that's a pain with shell. Plus, rust code is a lot easier to maintain/test/trust than random shell scripts. In an ideal world we could actually share code with rustup and mutually improve/maintain this updater logic.

There are three features here:

* a cargo-dist setting for "hey (power)shell installers, don't do any install-dir stuff, just run this binary with these arguments"
* an axoupdater setting for "hey just unpack the archive and then run this binary with these arguments"
* an axoupdater library API for "all the logic [installer.sh](github.com/axodotdev/cargo-dist/blob/main/cargo-dist/templates/installer/installer.sh.j2) and [installer.ps1](https://github.com/axodotdev/cargo-dist/blob/main/cargo-dist/templates/installer/installer.ps1.j2) do to setup PATH and whatnot" (i.e. [rustup's self_update code](https://github.com/rust-lang/rustup/tree/master/src/cli/self_update))

Contributor guide

Open the contributing guide

Research direction

Start by reading cargo-dist/templates/installer/installer.sh.j2 and installer.ps1.j2, then compare their behavior with rustup's src/cli/self_update code. Trace how cargo-dist settings and axoupdater currently handle installation, unpacking, and execution. Done means supporting the three requested settings/API layers and moving the installer behavior into reusable Rust logic.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust, shell
Domain
release, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.