{"id":13702437,"url":"https://github.com/brson/multirust","last_synced_at":"2025-04-04T19:10:00.738Z","repository":{"id":24865293,"uuid":"28280863","full_name":"brson/multirust","owner":"brson","description":"[DEPRECATED] A tool for managing multiple Rust installations","archived":false,"fork":false,"pushed_at":"2019-02-10T00:13:11.000Z","size":363,"stargazers_count":656,"open_issues_count":63,"forks_count":36,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-10-11T07:37:33.025Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-20T22:19:34.000Z","updated_at":"2024-10-05T15:30:25.000Z","dependencies_parsed_at":"2022-08-07T11:01:24.037Z","dependency_job_id":null,"html_url":"https://github.com/brson/multirust","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fmultirust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fmultirust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fmultirust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brson%2Fmultirust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brson","download_url":"https://codeload.github.com/brson/multirust/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247234921,"owners_count":20905854,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T21:00:35.804Z","updated_at":"2025-04-04T19:10:00.723Z","avatar_url":"https://github.com/brson.png","language":"Shell","funding_links":[],"categories":["Development tools"],"sub_categories":["Operating systems"],"readme":"**Note: multirust is not actively maintained. Migrate to [rustup.rs](https://github.com/rust-lang-nursery/rustup.rs) ([help](#migrating-to-rustup)).**\n\n[![Build Status](https://travis-ci.org/brson/multirust.svg?branch=master)](https://travis-ci.org/brson/multirust)\n\nA simple tool for managing multiple installations of the Rust\ntoolchain. It replaces the standard Rust toolchain with components\nthat dynamically choose between alternate implementations based on\ncontext.\n\nFeatures:\n\n* Manage multiple installations of the official Rust binaries.\n* Configure Rust toolchains per-directory.\n* Install and update from Rust release channels: nightly, beta, and\n  stable.\n* Receive notifications of updates to release channels.\n* Install historical nightly toolchains from the official archives.\n* Install by specific stable version number.\n* Install additional `std`s for cross-compilation.\n* Install custom toolchains.\n* Isolate Cargo metadata per-installation.\n* Verify hashes of downloads.\n* Verify signatures (if GPG is available).\n* Resume partial downloads.\n* Requires only bash, curl and common unix utilities.\n* For Linux, OS X, and Windows (via MSYS2).\n\n# Migrating to rustup\n\nIf you have multirust installed and you would like to migrate to rustup.rs,\nfollow these steps (for Linux/Mac):\n\n1. First, uninstall Multirust using this command:\n```\ncurl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh -s -- --uninstall\n```\n2. Delete the folder `~/.multirust`.\n3. If the file `/usr/local/lib/rustlib/uninstall.sh` still exists, the uninstallation was not successful. Run `sudo /usr/local/lib/rustlib/uninstall.sh` to complete it.\n4. Install rustup using the instructions at [rustup.rs](https://www.rustup.rs/).\n\n\n# Quick installation\n\n```\ncurl -sf https://raw.githubusercontent.com/brson/multirust/master/blastoff.sh | sh\n```\n\nThis will build and install multirust, possibly prompting you for your\npassword via `sudo`. It will then download and install the stable\ntoolchain, configuring it as the default when executing `rustc`,\n`rustdoc`, and `cargo`.\n\n\n# Manual build, install and configure\n\nA manual build and install allows one to tailor `multirust` to meet specific needs.\n\nThe basic template is:\n\n```\ngit clone --recursive https://github.com/brson/multirust \u0026\u0026 cd multirust\ngit submodule update --init\n./build.sh \u0026\u0026 sudo ./install.sh\n```\n\nRun `sudo ./install.sh --uninstall` to uninstall.\n\nRun `multirust default nightly` to download and install the nightly\ncompiler and package manager and configure it as the default.\n\nAs an example customization, to install underneath your home\ndirectory in e.g. `~/my_stuff/bin/multirust`, you could use:\n\n```\n./build.sh \u0026\u0026 ./install.sh --prefix=~/my_stuff/\n```\n\n(In this scenario, `./install.sh --prefix=~/my_stuff/ --uninstall` to uninstall.)\n\nRun `./build.sh \u0026\u0026 ./install.sh --help` to see a list of available options.\n\n# Usage\n\nTo install Rust, run `multirust update \u003ctoolchain\u003e`. See `multirust help update` for\ndetails and to configure what this will install.\n\nOverriding the compiler in specific directories:\n\n```\nmkdir beta-project \u0026\u0026 cd beta-project\nmultirust override beta\n```\n\nNow any time the toolchain is executed in the `beta-project`\ndirectory or any subdirectory thereof the compiler from the beta\nrelease channel will be used.\n\nTo pin to a specific nightly:\n\n```\nmultirust override nightly-2014-12-18\n```\n\nOr a specific stable release:\n\n```\nmultirust override 1.0.0\n```\n\nInformation about the current override can be displayed with `multirust\nshow-override`. The current override can be deleted by running\n`multirust remove-override` from the directory where the override was\ncreated.\n\nCheck for updates with `multirust update nightly`. All three release\nchannels can be updated at once with `multirust update`.\n\n`multirust run` will run an arbitrary command in an environment\nconfigured for a given toolchain, so e.g. `multirust run beta cargo\nbuild` will run the beta cargo, regardless of the current\noverride. This can also be used to e.g. open a beta shell like\n`multirust run beta bash`.\n\nCommands can be abbreviated by using a prefix of the intended command,\nfor example `multirust ru` (`run`) or `multirust s-o` (`show-override`).\nIn the case of an ambiguous prefix, it picks the first match using the\norder of commands shown in `multirust help`.\n\n# Toolchain specification\n\n`multirust` supports several ways to indicate the toolchain: 'stable',\n'beta' and 'nightly' all download from the corresponding release\nchannel. When any of these toolchain specifiers are used `multirust`\nwill periodically notify you of available updates. All three channels\ncan be optionally appended with an archive date, as in\n'nightly-2014-12-18', in which case the toolchain is downloaded from\nthe archive for that date (if available). Any other specifier is\nconsidered an explicit Rust version number, as in '0.12.0', or a custom\ntoolchain identifier, depending on context.\n\n# Cross-compilation\n\n`multirust` can install additional standard libraries for\ncross-compilation targets. Once you have installed a toolchain, use\nthe `multirust list-available-targets` command to show which targets\ncan be added, and `multirust add-target` to add a target.\n\n# Custom toolchains\n\nCustom toolchains - those not distributed by The Rust Project - may be\ninstalled from either custom-built installer or from a local directory\ncontaining a build of Rust.\n\nTo install from an existing Rust build use either the `--copy-local`\nor the `--link-local` flags to the `update` command. `--copy-local`\nwill copy a build of Rust to multirust's private toolchain\ninstallation directory; `--link-local` will create a toolchain that is\na symlink to a build of Rust, convenient for those who frequently\nbuild Rust themselves:\n\n```\nmultirust update my-rust --link-local ~/dev/rust/build/x86_64-unknown-linux-gnu/stage2\n```\n\nA custom-built installer can be installed with `multirust update\n\u003ctoolchain\u003e --installer \u003cinstaller-path-or-url\u003e`, e.g. `multirust\nupdate my-rust --installer\nrust-1.0.0-dev-x86_64-unknown-linux-gnu.tar.gz`. In this case the\ntoolchain is installed via the specified installer and can then be\nactivated with `multirust default my-rust`.\n\nSince the main Rust build does not produce an installer that includes\nCargo, it may be easier to install the individual rustc and cargo\ninstallers instead of trying to produce the combined installer through\n[rust-packaging](https://github.com/rust-lang/rust-packaging). For\nthis reason the `--installer` flag takes a comma-separated list of\ninstallers, allowing custom rustc and cargo packages to be installed\nwith e.g.\n\n```\nmultirust update my-rust --installer rustc-1.0.0-dev-x86_64-unknown-linux-gnu.tar.gz,cargo-nightly-x86_64-unknown-linux-gnu.tar.gz\n```\n\nThese three options can also be supplied to the `default` and\n`override` commands, in which case the toolchain is also\nactivated after installation.\n\n# Implementation Details\n\n`multirust` installs a script called `multirustproxy` as all the tools\nin the Rust toolchain: `rustc`, `cargo`, and `rustdoc`.  This script\nconsults `multirust` to decide which toolchain to invoke, and decides\nwhich tool to invoke based on the name it is called as.\n\n`multirustproxy` automatically applies `-C rpath` to all `rustc`\ninvocations so that the resulting binaries 'just work' when using\ndynamic linking, even though the toolchains live in various places.\n\nIt keeps Cargo's metadata isolated per toolchain via the `CARGO_HOME`\nenvironment variable.\n\n`multirust` saves settings and toolchains per user in `~/.multirust`.\nThe directory is initialized when using the `multirust` command to\nset the default channel, or when setting an override or updating for first time.\nThe name of this directory can be controlled with the `MULTIRUST_HOME`\nenvironment variable.\n\n# Can you trust Rust binaries?\n\nAlthough multirust verifies signatures of its downloads if GPG is\navailable, the question of whether you can 'trust' Rust depends on\nquite a few factors. Although I'm not prepared to give advice on this\nsubject, here are some of the details around how the Rust project\nbinaries are signed and verified. You can make your own judgments.\n\n* Rust binaries are produced on mostly cloud infrastructure to which\n  several people have access.\n* They are signed automatically by a master bot that has access\n  to a secret subkey of the Rust signing key.\n* They are uploaded to s3 using a secret key on that same bot.\n* The master bot is exposed to the Internet through an ssh tunnel via\n  which it communicates with buildbot slaves.\n* Rust binaries are served over HTTPS.\n* The Rust public key is distributed as part of multirust.\n* Rust is self-hosting, bootstrapped off of a chain of binary\n  snapshots that extends back for several years, which are presently\n  served over HTTPS (but have not always been), and are not\n  cryptographically signed.\n\nWhen GPG successfully verifies a signature from the Rust signing key\nit will almost certainly emit a warning saying the key is untrusted:\n\n```\ngpg: Signature made Fri 09 Jan 2015 12:07:05 AM PST using RSA key ID 7B3B09DC\ngpg: Good signature from \"Rust Language (Tag and Release Signing Key) \u003crust-key@rust-lang.org\u003e\"\ngpg: WARNING: This key is not certified with a trusted signature!\ngpg:          There is no indication that the signature belongs to the owner.\nPrimary key fingerprint: 108F 6620 5EAE B0AA A8DD  5E1C 85AB 96E6 FA1B E5FE\n     Subkey fingerprint: C134 66B7 E169 A085 1886  3216 5CB4 A934 7B3B 09DC\n```\n\nThis is because the Rust signing key isn't known to be trusted by\nothers in your 'web of trust'. It isn't strictly a problem, assuming\nthat you trust the authors of multirust and the channel through which\nyou installed it.\n\nIf you are so inclined you can import the Rust signing key, and if it\nhappens to be in the same web of trust as your own trusted keys, then\nthe warnings may go away:\n\n```\ngpg --keyserver hkp://keys.gnupg.net --recv-keys 7B3B09DC\n```\n\nAt the present time the certificate chain for the Rust signing key is\nquite meager though so it's unlikely to help.\n\n# Limitations\n\n* Installation of multirust over an existing installation of Rust or\n  vice versa will cause brokenness. Uninstall the other first.\n  `./install.sh` will detect this and error. This should be fixable in\n  the future.\n* The `rustc`, `cargo` and `rustdoc` commands should be symlinks to\n  `multirustproxy` but are actually copies, a limitation of the\n  installer.\n* Concurrent writing of `multirust`'s metadata can possibly cause\n  minor data loss in limited circumstances.\n* Paths with semicolons in their names will cause breakage when configured\n  with overrides.\n* Other unusual characters in paths may break overrides.\n* Overrides at the filesystem root probably don't work.\n\n# Future work\n\n* Check for and install updates of multirust itself.\n* Windows support.\n* Allow creation of aliases like `rustc-0.12.0` (needs cargo to obey\n  RUSTC and RUSTDOC env vars).\n* GC unused toolchains.\n* Cache installers to avoid redownloads? Maybe only useful for\n  testing.\n* override, show-override, remove-override could take an optional\n  path.\n* Install without docs? Saves lots of space.\n* Teach multirust to uninstall itself.\n* Handle temp file cleanup more consistently - always cleaned up on\n  error unless requested otherwise.\n* Use wget if curl isn't available?\n* Command to check for and show available updates explicitly.\n* Figure out what to do about command line completions for cargo,\n  etc.\n* Tests for various paths with spaces in them.\n* Make blastoff script interactive: require confirmation to start and\n  display a notice if gpg is not installed.\n* Add a way to disable signature verification.\n* There are probably ways to cause damage by trusting the user about\n  what is and isn't a 'custom' toolchain.\n* Refactor multirustproxy to use 'multirust run'.\n\n# License\n\nmultirust is licensed under the same terms as the Rust compiler, now and\nforevermore.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fmultirust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrson%2Fmultirust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrson%2Fmultirust/lists"}