crate-ci / meta

For discussing and proposing ways to improve the Rust CI ecosystem.
8 stars 0 forks source link

Tarballing is hard to add to projects #1

Open epage opened 6 years ago

epage commented 6 years ago

I'm starting to work on https://github.com/crate-ci/example-bin but finding teaching this annoying.

From the shell scripts, we have no idea what the crate name is, the bin name, or the target. The last is the most invasive for people get working.

Proposal

stager

Create a crate for staging files for tarballs or package managers

cargo-tarball

The source is a Cargo.toml like:

[[metadata.tarball.my_bin]]
bin=true
rustflags="-C lto"

[metadata.tarball.my_bin.content]
"{{ target_dir}}/my_bin.bash" = "completions"
"*.md" = "docs"
epage commented 6 years ago

Started stager

Other relevant crate work

kornelski commented 6 years ago

I make a tarball and a zip with Mac and Windows binaries + Linux packages together:

This is important for me, because I can have a single "Download" link on a static website and it works for everyone.

So I'm afraid that's a bit too much to explain to Cargo using TOML syntax, and in general I can't imagine one run of cargo being able to compile and package for 3 platforms at once (and I still haven't managed to even set up cross-compilation).

I do like how npm allows running arbitrary scripts with npm run script-name where script-name is defined in package.json, so I can stuff my build steps there.

epage commented 6 years ago

I make a tarball and a zip with Mac and Windows binaries + Linux packages together: This is important for me, because I can have a single "Download" link on a static website and it works for everyone.

I'm assuming this approach is a minority case and from that, I think I'm going to say its outside of the scope of being handled by this issue.