kornelski / cargo-deb

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

cdynlib asset not recognized after upgrading 1.39.3→1.40.3 #58

Closed pseyfert closed 1 year ago

pseyfert commented 1 year ago

I stumbled over what looks to me like a regression somewhere between cargo-deb 1.39.3 and 1.40.3

You can find a reproducer repository here.

Cargo.toml contains

…
[lib]
crate-type = ["cdylib", "rlib"]
…
[package.metadata.deb]
assets = [
    ["target/header.h", …
    ["target/release/librepro.so", …
]

i.e. cargo build --release creates (among other files) target/release/librepro.so (triggered through the crate-type) and target/header.h (from build.rs).

Up until cargo-deb 1.39.3 cargo-deb creates a .deb file with content

drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/
drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/share/
drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/share/doc/
drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/share/doc/repro/
-rw-r--r-- 0/0             165 2022-11-28 17:23 usr/share/doc/repro/copyright
drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/include/
drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/include/sev/
drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/include/sev/repro/
-rw-r--r-- 0/0             253 2022-11-28 17:23 usr/include/sev/repro/header.h
drwxr-xr-x 0/0               0 2022-11-28 17:23 usr/lib/
-rwxr-xr-x 0/0           14016 2022-11-28 17:23 usr/lib/librepro.so

as intended. After upgrading cargo-deb, cargo-deb fails with

error: no bin target named `librepro.so`.

trying some git bisect it seems to me like the regression got introduced in https://github.com/kornelski/cargo-deb/commit/93d50c32253a6ab22096a1230cca34e005eb759d .

Not sure where in that commit the issue is introduced but I hope the explanation above makes sense.

Any idea how to get this working again?

Thanks in advance, Paul

kornelski commented 1 year ago

Try the latest commit cargo install cargo-deb --git https://github.com/kornelski/cargo-deb

pseyfert commented 1 year ago

Works for me. Thanks.