Open Pzixel opened 6 years ago
Finally I'm not the only one on the whole rusternet with the Problem of copying associated files to binary output dir.
p.s. sorry for off-topic, but I lost whole day in hope that this problems must already been solved.
I would really like this as well
Upvote. I need to include image files, data files, etc. with my application and would like to do so in a clean and standard way.
This would allow us to take a step forward for the development of GUI apps in which resources are used most often.
I nice clean solution to add an icon/resource to our binaries would be great!
for wasm projects people use trunk to pack and run their app https://trunkrs.dev/ but yea for small projects with resources would be nice to have some standard way of doing it.
I guess everyone implements in a build.rs file
A more general solution is #545.
My original thought was about more declarative approach. OTOH maybe crates.io can fill this by providing libraries with required DSL to make it more convenient to use than managing everything by hand.
This is similar to #2729, however, it's a bit different.
The main problem I currently have is that I cannot place configs near my executable. It's common practice in many languages and IDE's that you have some file that gets copied to output directory. For example, let's look at
csproj
configuration for C# project:It literaly says "copy this file to output directory (wherever it is) if file in project is newer". It's common, it's convinient.
Currently in Rust i have following
build.rs
script:It actually does work, but it's not really convinient and we'd like ot have more declarative description.
We'd probably like to specify in
cargo.toml
as:or even
And be sure that when cargo build an application, resource files gets its place near executable (or at some relative path).
This feature should be limited to executables, so it doesn't work for libraries so we don't care about requiring copying these files transitively.