Skip to content

pure rust self-install logic #85

@Gankra

Description

@Gankra

The installer.sh and installer.ps1 scripts in cargo-dist are a hybrid of rustup's installer bootstrap scripts and this rust code.

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 and installer.ps1 do to setup PATH and whatnot" (i.e. rustup's self_update code)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions