tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Building a Rust package



------- Original Message -------
On Friday, November 25th, 2022 at 1:02 PM, Hauke Fath <hf%spg.tu-darmstadt.de@localhost> wrote:


> Hi,

Hi

> I am trying to update a rust-based package, and I don't really know my
> way around rust's newfangled build system. And there are problems.
> 
> While packaging security/vaultwarden (1.25.2), the rust part didn't pose
> any major difficulties. But the 1.26.0 release patches a rust crate,
> which the pkgsrc contraptions apparently don't deal with.

One way to do this is to patch vaulwarden/Cargo.toml to remove the patch and apply it to directly to vendor/multer-rs
(see sysutils/felix where I've done exactly this for an example if needed)

 
> After the prescribed
> 
> [hf@Gstoder] /<2>security/vaultwarden > make CARGO_ARGS="build --release
> 
> --features `make show-var VARNAME=CARGO_FEATURES`" build
> 
> (which fails unless the --features option is provided - I guess that
> could be a target in "lang/rust/cargo.mk"?) to update
> "cargo-depends.mk", the actual package build ends quickly with
> 
> [...]
> ===> Building for vaultwarden-1.26.0
> 
> error: failed to load source for dependency `multer`
> 
> Caused by:
> Unable to update
> https://github.com/BlackDex/multer-rs?rev=477d16b7fa0f361b5c2a5ba18a5b28bec6d26a8a#477d16b7
> 
> Caused by:
> can't checkout from 'https://github.com/BlackDex/multer-rs': you are
> in the offline mode (--offline)
> *** Error code 101
> 
> Stop.
> make[1]: stopped in /amd/hochstuhl/u/pkgsrc/security/vaultwarden
> *** Error code 1
> 
> 
> The package's "Cargo.toml" has a
> 
> [patch.crates-io]
> # Using a patched version of multer-rs (Used by Rocket) to fix
> attachment/send file uploads
> # Issue: https://github.com/dani-garcia/vaultwarden/issues/2644
> # Patch:
> https://github.com/BlackDex/multer-rs/commit/477d16b7fa0f361b5c2a5ba18a5b28bec6d26a8a
> multer = { git = "https://github.com/BlackDex/multer-rs";, rev =
> "477d16b7fa0f361b5c2a5ba18a5b28bec6d26a8a" }
> 
> section, and I suppose that patch is not recorded in the package's
> "cargo-depends.mk".
> 
> Which way forward?
> 
> Cheerio,
> Hauke
> 
> --
> The ASCII Ribbon Campaign Hauke Fath
> () No HTML/RTF in email Institut für Nachrichtentechnik
> /\ No Word docs in email TU Darmstadt
> Respect for open standards Ruf +49-6151-16-21344


Home | Main Index | Thread Index | Old Index