Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
rust
package:rustc
andcargo
, among other standard Rust binariesrust.cargoBuild()
lets you build a crate, including caching dependency downloads and validating the lockfile is up to dateRather than build from source, the current version of the
rust
package installs Rust by downloading a manifest file (the same one used by Rustup) and calling theinstall.sh
file for each desired component. This ends up using the official Rust binaries.To parse the manifest, I had to make two other changes:
typer.record()
function for parsing objects based on key/value typesmol_toml
package. The Rustup manifests are TOML, so to parse them, I vendored thesmall-toml
NPM package as thesmol_toml
Brioche package (I made a few manual changes to silence warnings and to match the formatting conventions for.bri
files)As part of caching dependencies properly, I internally pulled in a precompiled binary for
cargo-chef
, namely to create a "skeleton crate" so dependencies can be cached based only on theCargo.toml
andCargo.lock
files (instead of all of the source code, which would effectively be uncached). I also tried to use this to cache builds of dependencies, but I was thwarted because each build runs in a different$HOME
, and Cargo fingerprints the cache based on the source path. Caching dependencies will take some more work