kornelski / cargo-deb

Make Debian packages directly from Rust/Cargo projects
https://lib.rs/cargo-deb
MIT License
423 stars 50 forks source link

FR: Support for multiarch shared library paths #144

Open jinnatar opened 2 weeks ago

jinnatar commented 2 weeks ago

Why

The software I'm looking to switch over to cargo-deb (https://github.com/kanidm/kanidm) already has an existing deb pipeline, which is cumbersome. However it currently drops dynamic libraries into locations defined by the multiarch triplet, for example:

Especially the latter seems to be a required path as that's the one where a modern Debian install with multiarch will look for PAM modules without extra trickery.

The problem

Proposed solution(s)

kingosticks commented 2 weeks ago

I have what I think is a similar problem, where my asset needs to be installed in a location based on the the arch triple. My solution so far has been to use a variable with a string interpolation pre-processing step. Hacky but it works.

I'm actually using the result of pkg-config to find the directory rather than attempt to hard-code it. I don't know if the proposed solutions would provide quite the same flexibility as my hack allows, but they'd probably suffice for me.

kingosticks commented 2 weeks ago

Oh, apologies, I forgot someone (not me!) already posted this as https://github.com/kornelski/cargo-deb/issues/35

jinnatar commented 2 weeks ago

Thanks for finding that, I'd missed it while searching. What seems to have changed since then is that multiarch is in real world use, outside of cross-compile. But for now I'll try your hack, seems perhaps easier on other devs than variants.

Edit: The annoying part about post-processing in the multiarch path is that it's annoying to resolve a package name to it's Cargo.toml. So I guess I'll stick with variants and hoping no one runs without a variant and gets a broken deb.

kornelski commented 1 week ago

I think it makes sense, and could be supported.