Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: applying icons to binary targets #2475

Closed
ebkalderon opened this issue Mar 13, 2016 · 7 comments
Closed

Feature request: applying icons to binary targets #2475

ebkalderon opened this issue Mar 13, 2016 · 7 comments
Labels
A-new-subcommand Area: new subcommand

Comments

@ebkalderon
Copy link

I would like to see support for applying icons to binary targets. Perhaps this could be added as an extra configuration switch under [[bin]]. If set, binaries targeting Windows would have the given icon file applied through a resource file, while Linux binaries could have a *.desktop file generated that could be placed in /usr/share/applications. I am not familiar enough with OS X to comment on how application icons are assigned to binaries.

I know that this feature is supported by CMake but is largely handled by the platform's available toolchain. Cargo can only interact with rustc AFAIK, so I presume we are limited by the capabilities of the compiler. How feasible would this be?

@alexcrichton
Copy link
Member

This would probably be best suited as some form of post-build-system after Cargo. You're right in that Cargo largely just talks to rustc itself, and this sounds like it may not interact much with the compiler?

@ebkalderon
Copy link
Author

@alexcrichton That is correct. For example, in Windows we would talk to MSVC instead of rustc. If not integrated into Cargo directly, then perhaps this functionality could be implemented as an installable subcommand for Cargo, much like cargo-fmt? I would like this functionality to be a part of the build system somehow, especially if we want our cross-platform story to improve.

@alexcrichton
Copy link
Member

I think this could be easily integrated as a subcommand, yeah!

@alexcrichton alexcrichton added the A-new-subcommand Area: new subcommand label Mar 14, 2016
@ebkalderon
Copy link
Author

I unfortunately don't have much knowledge about how Cargo works internally, so I don't know how useful I can be with implementation. However, I can certainly help with testing, especially on Linux.

Here are two reference links detailing how the *.desktop entry spec works on Unix-like systems:

@GabrielMajeri
Copy link
Contributor

The simplest way to add an icon seems to be through a resource file, and this could be handled through embed_resource. I'm not sure if this should be handled by Cargo with an icon field in Cargo.toml, or the end user.

As for the desktop entry, there seems to be a freedesktop_desktop_entry crate. Again, this could be handled either by Cargo (generated from Cargo.toml metadata) or by the end user.

@alexcrichton should these features be added to Cargo or kept external?

@alexcrichton
Copy link
Member

If it's possible to do this via an external crate then that is best.

@epage
Copy link
Contributor

epage commented Oct 23, 2023

As the discussion is focused on this being implemented via third-party support, whether an external subcommand or #545, I'm going to close as there isn't anything actionable for cargo itself. If there is a reason for us to re-evaluate this, let us know!

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-new-subcommand Area: new subcommand
Projects
None yet
Development

No branches or pull requests

4 participants