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

Ensure that if a bare version number is on main it's what's published to crates.io #179

Open
anp opened this issue Aug 9, 2020 · 1 comment
Labels
ofl All build systems are awful

Comments

@anp
Copy link
Owner

anp commented Aug 9, 2020

The dry-run publish step on CI needs to check if the version of the crate in the PR is on crates.io. If it is, the scripts should download the tarball, package a local crate tarball, and assert they're the same.

If they're not the same, fail CI with a recommendation to run cargo ofl versions locally.

@anp anp added the ofl All build systems are awful label Oct 25, 2020
@anp
Copy link
Owner Author

anp commented Oct 25, 2020

Roadblock: the checksums in the cargo index include .cargo_vcs_info.json, which itself includes the git commit when the package was made (handy!).

If we still want to do checksum verification (probably?) then I see two paths to making the checksum reproducible in later builds:

  1. download the crate tarball, unpack it, and validate cargo package output file-by-file
  2. reproduce the already-published checksums with locally-known metadata

I'm inclined towards (2) because it relies on less network activity. Now that ofl tags commits on publish, (2) should be possible without too much more work.

Approach:

  1. run cargo package
  2. find files in CARGO_TARGET_DIR/package/NAME-VERSION/**
  3. find the git tag at which the version in question was published
  4. modify the .cargo_vcs_info.json file to point at the SHA1 of the git tag
  5. manually re-tar the files to get a "backdated" NAME-VERSION.crate file
  6. checksum the backdated file

anp added a commit that referenced this issue Oct 25, 2020
[ofl] Ensure all changes are published or marked pre-publish.

Closes #179.
@anp anp added this to the moxie-dom 0.3.0 milestone Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ofl All build systems are awful
Projects
None yet
Development

No branches or pull requests

1 participant