[GH-ISSUE #12] Add support for differing binary names #4

Closed
opened 2026-03-01 09:06:40 -06:00 by GiteaMirror · 3 comments
Owner

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:

[[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.
Author
Owner

@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.

@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.
Author
Owner

@hisbaan commented on GitHub (Apr 18, 2022):

Awesome! Thank you so much :) It's a relatively niche configuration I suppose

@hisbaan commented on GitHub (Apr 18, 2022): Awesome! Thank you so much :) It's a relatively niche configuration I suppose
Author
Owner

@fosskers commented on GitHub (Apr 19, 2022):

I've put up a PR that implements this.

@fosskers commented on GitHub (Apr 19, 2022): I've put up a PR that implements this.
GiteaMirror changed title from Add support for differing binary names to [GH-ISSUE #12] Add support for differing binary names 2026-04-11 05:42:29 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cargo-aur#4