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

check versions on packages early and explicitly #1365

Open
ashleygwilliams opened this issue Aug 23, 2024 · 1 comment
Open

check versions on packages early and explicitly #1365

ashleygwilliams opened this issue Aug 23, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@ashleygwilliams
Copy link
Member

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.

@ashleygwilliams ashleygwilliams changed the title cargo dist init errors on fields it wrote itself cargo dist init warns on fields it wrote itself then panics Aug 23, 2024
@Gankra Gankra added the bug Something isn't working label Aug 26, 2024
@Gankra
Copy link
Contributor

Gankra commented Aug 26, 2024

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.

@Gankra Gankra changed the title cargo dist init warns on fields it wrote itself then panics check versions on packages early and explicitly Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants