DeterminateSystems / riff

Riff automatically provides external dependencies for Rust projects, with support for other languages coming soon.
https://riff.sh
Mozilla Public License 2.0
486 stars 13 forks source link

registry: no default inputs for Rust #171

Open cole-h opened 2 years ago

cole-h commented 2 years ago

We require users to have installed cargo (typically done via rustup), which includes rustc, cargo, and rustfmt by default.


Fixes https://github.com/DeterminateSystems/riff/issues/147. Maybe fixes https://github.com/DeterminateSystems/riff/issues/126.


In order to test this PR, there are a few things you need to do (as a result of our remote registry):

  1. Check out and build Riff from this branch (nix build will suffice, but you could also bootstrap with Riff itself and riff run cargo build), or download one of the pre-compiled binaries from buildkite or GitHub Actions (aarch64-linux binaries available on request but they are not currently automated)
  2. Remove the cached registry by running rm ~/.cache/riff/registry.json
  3. Run cargo metadata to ensure cargo doesn't need to download any dependencies (because the next command will run all cargo commands in offline mode)
  4. Run Riff with the --offline flag, e.g.: riff shell --offline and verify that rustc, cargo, and rustfmt do not show up in the list of dependencies Riff added to the shell

Note that, if at any point you use Riff without the --offline flag, you will need to repeat step 1 and remove the cached registry.

cole-h commented 2 years ago

Drafted because it's come up that this isn't the ideal solution (because rustup may download binaries with different glibc versions, which may lead to weird breakage down the line).

figsoda commented 1 year ago

I opened https://github.com/DeterminateSystems/riff/pull/200 as an alternative

figsoda commented 1 year ago

after thinking about it, I think this might be a better solution since we already need cargo for cargo metadata