>> +(define* (configure #:rest empty) >> + "Replace Cargo.toml [dependencies] section with guix inputs." >> + ;;TODO > > So what would this do? Do we end up using bundled dependencies if we > don’t do that?
If we don't do that cargo tries to download them from crates.io, and since it's running in a container, would fail. >> +(define* (build #:rest empty) >> + "Build a given Cargo package." >> + (zero? (system* "cargo" "build" "--release"))) > > It may be useful to make "--release" configurable, like the #:build-type > of ‘cmake-build-system’. > Why do we need to install the source code? > > If it’s really needed for the functioning of the package, I’d suggest > moving it to OUT/share/rust-source/PACKAGE-VERSION or something like > this, no? Rust doesn't have a fixed ABI yet, so cargo builds everything from source. There is precedent in other distros (I think debian) and languages (go). >> + (install-file "Cargo.toml" rsrc) >> + ;; Will fail if crate doesn't contain an executable >> + (system* "cargo" "install" "--root" bin) > > I suppose many crates provides a library and no executable, so it’d be > nice to find what needs to be done here. Thoughts? if we replace all dependencies with local ones, this isn't an issue.