cargo-dist
cargo-dist copied to clipboard
check versions on packages early and explicitly
ag_dubs@Ashleys-MBP-2 workerd % vi dist.toml
ag_dubs@Ashleys-MBP-2 workerd % cargo dist init
let's setup your cargo-dist config...
? looks like you deleted the cargo-dist-version key, add it back?
this is the version of cargo-dist your releases should use
✔ looks like you deleted the cargo-dist-version key, add it back?
this is the version of cargo-dist your releases should use
(you're currently running 0.21.1) · yes
✔ what platforms do you want to build for?
(select with arrow keys and space, submit with enter) · Apple Silicon macOS (aarch64-apple-darwin), Intel macOS (x86_64-apple-darwin), x64 Linux (x86_64-unknown-linux-gnu), x64 Windows (x86_64-pc-windows-msvc)
✔ enable Github CI and Releases? · yes
✔ what installers do you want to build?
(select with arrow keys and space, submit with enter) · shell, powershell, npm
✔ you've enabled npm support, please enter the @scope you want to use
this is the "namespace" the package will be published under
(leave blank to publish globally) · @cloudflare
✔ npm packages will be published under @cloudflare
? the npm installer requires binaries to be distributed as .tar.gz, is that ok?
otherwise we would distribute your binaries as .zip on windows, .tar.xz everywhere else
✔ the npm installer requires binaries to be distributed as .tar.gz, is that ok?
otherwise we would distribute your binaries as .zip on windows, .tar.xz everywhere else
(this is a hopefully temporary limitation of the npm installer's implementation) · yes
✔ Would you like to include an updater program with your binaries? · no
✔ added [dist] to your root dist.toml
✔ cargo-dist is setup!
running 'cargo dist generate' to apply any changes
WARN package.metadata.dist.cargo-dist-version is set, but this is only accepted in workspace.metadata (value is being ignored): /Users/ag_dubs/axo/workerd/dist.toml
WARN package.metadata.dist.ci is set, but this is only accepted in workspace.metadata (value is being ignored): /Users/ag_dubs/axo/workerd/dist.toml
× cargo dist panicked.
├─▶ at cargo-dist/src/announce.rs:655:45
╰─▶ called `Option::unwrap()` on a `None` value
help: set the `RUST_BACKTRACE=1` environment variable to display a backtrace.
Ah I believe that final panic ends up actually being a "package didn't have a version" issue -- we're being too loose on packages having versions too early (because in JS land you don't have to set a version, at least in development. and this will maybe be an exciting blowup if we support JS workspaces).
I think we should just for now make the version check early and strict, so people get the error early, and so there's never a concern of these later checks dying.