For example, my package, didyoumean builds a binary called dym with this addition to the Cargo.toml file:
[[bin]]name="dym"path="src/main.rs"
The script fails when running strip as the binary name is not as the script expects. The issue is with line 246 of main.rs: binary.push(&package.name); which assumes that package.name is the same as the produced binary.
I don't know enough about Cargo.toml parsing so I'm not sure how to parse a new field exactly and to change the binary path optionally if that field exists, however I would be glad to work on it if someone could point me in the right direction.
Originally created by @hisbaan on GitHub (Apr 18, 2022).
Original GitHub issue: https://github.com/fosskers/cargo-aur/issues/12
For example, my package, `didyoumean` builds a binary called `dym` with this addition to the `Cargo.toml` file:
```toml
[[bin]]
name = "dym"
path = "src/main.rs"
```
The script fails when running `strip` as the binary name is not as the script expects. The issue is with line 246 of main.rs: `binary.push(&package.name);` which assumes that `package.name` is the same as the produced binary.
I don't know enough about `Cargo.toml` parsing so I'm not sure how to parse a new field exactly and to change the binary path optionally if that field exists, however I would be glad to work on it if someone could point me in the right direction.
GiteaMirror
changed title from Add support for differing binary names to [GH-ISSUE #12] Add support for differing binary names2026-04-11 05:42:29 -05:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @hisbaan on GitHub (Apr 18, 2022).
Original GitHub issue: https://github.com/fosskers/cargo-aur/issues/12
For example, my package,
didyoumeanbuilds a binary calleddymwith this addition to theCargo.tomlfile:The script fails when running
stripas the binary name is not as the script expects. The issue is with line 246 of main.rs:binary.push(&package.name);which assumes thatpackage.nameis the same as the produced binary.I don't know enough about
Cargo.tomlparsing so I'm not sure how to parse a new field exactly and to change the binary path optionally if that field exists, however I would be glad to work on it if someone could point me in the right direction.@fosskers commented on GitHub (Apr 18, 2022):
This would be an easy fix for me, let me take care of it. Thanks for bringing this to my attention.
@hisbaan commented on GitHub (Apr 18, 2022):
Awesome! Thank you so much :) It's a relatively niche configuration I suppose
@fosskers commented on GitHub (Apr 19, 2022):
I've put up a PR that implements this.
Add support for differing binary namesto [GH-ISSUE #12] Add support for differing binary names