axodotdev / cargo-dist

📦 shippable application packaging
https://axodotdev.github.io/cargo-dist/
Apache License 2.0
1.5k stars 71 forks source link

Target-specific include #1208

Open cdanger opened 3 months ago

cdanger commented 3 months ago

Is it possible to configure cargo dist to include certain files in the windows archive but not in the Linux archive when both Windows and Linux targets are built?

As far as I can see, if I use the include field, it will apply to both archives. How can I make it archive/target specific?

ashleygwilliams commented 1 month ago

Apologies for the massive delay, this is a feature we plan to implement once we've shipped our config refactor (referenced on this tracker and in project boards as "config 1.0") - but unfortunately for now it's not possible.

Out of curiosity- what sort of artifacts are you hoping to include?

cdanger commented 1 month ago

In the case of Windows built, I have to include a few DLLs (dynamic link libraries), which are not needed for Linux.

Gankra commented 1 month ago

Depending on your usecase you might be able to include an entire directory, and just vary the contents of the directory by platform -- but this would indeed include the directory and not put the DLLs next to your binaries, if that's what you need.

cdanger commented 1 month ago

I need to put them in a separate directory, not next to the binaries. So do you mean I should use like a build.rs to populate the directory with the right content during the build, depending on the target? before I call cargo-dist.