Skip to content

Commit Cargo.lock to 0.2.x branch - #258

Merged
apoelstra merged 1 commit into
rust-bitcoin:0.2.xfrom
Kixunil:0.2.x-add-cargo-lock
Sep 1, 2026
Merged

Commit Cargo.lock to 0.2.x branch#258
apoelstra merged 1 commit into
rust-bitcoin:0.2.xfrom
Kixunil:0.2.x-add-cargo-lock

Conversation

@Kixunil

@Kixunil Kixunil commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

Per the new Rust recommendation it is now recommended for libraries to commit their Cargo.lock too. This can prevent nasty surprises in CI builds - like we already experience because of all versions of core2 being yanked.

To fix this, this commit adds Cargo.lock and removes it from .gitignore.

For future reference, this is how you can force download of a yanked crate:

crate_name=core2
crate_version=0.3.2
wget "https://static.crates.io/crates/${crate_name}/${crate_name}-${crate_version}.crate"
sha256sum "$crate_name"

Now you know the hash, so manually add an entry to Cargo.lock just like the others that already are there. - Don't forget to add the package to dependencies aside from [[package]] section. Just a warning, don't make a typo; I wasted a bunch of minutes because cargo didn't say "sourve" was an invalid key and just complained about yanking. (I was about to ask a clanker and got the word underlined after copying so that made me notice. :D)

Per the new Rust recommendation it is now recommended for libraries to
commit their `Cargo.lock` too. This can prevent nasty surprises in CI
builds - like we already experience because of all versions of `core2`
being yanked.

To fix this, this commit adds Cargo.lock and removes it from `.gitignore`.
Additionally, this adds the `rust-version` field to ensure cargo won't
turn version 3 manifest into version 4. (That's the reason that change is
in this commit with `Cargo.lock`, not the only motivation behind it.)
@Kixunil
Kixunil force-pushed the 0.2.x-add-cargo-lock branch from ebd972c to 02feaaf Compare August 28, 2026 20:34
@apoelstra

Copy link
Copy Markdown
Member

Perfect, thanks!

Normally I'd say we want to rename this to Cargo-recent.lock or something like that to match our other crates, but in this case maybe Cargo.lock is right because you simply cannot build the crate unless Cargo.lock is already present.

@tcharding if you get a chance can you take this lockfile and integrate it into a "fix CI" PR? Or I can give it a shot, but I may be slow.

apoelstra added a commit that referenced this pull request Sep 1, 2026
28d2d46 Bump version to 0.2.3 (Tobin C. Harding)
c0acdde Use byte string for asci table (Tobin C. Harding)
d12548c CI: Fix pinning (Tobin C. Harding)
02feaaf Commit `Cargo.lock` (Martin Habovstiak)

Pull request description:

  Use Kix's work in #258. Tthen use claude to fix the pinning. The use `clippy` to fix the linting. I just got out of the way.
  
  Oh, and bump the version so we can cut a release from this PR.


ACKs for top commit:
  apoelstra:
    ACK 28d2d46; successfully ran local tests
  Kixunil:
    ACK 28d2d46


Tree-SHA512: e0f196993a46e308301bcd4ecefc7ccb9b62777e402000607c5f75df06c0b3b02fa8e499d83684421499cdfff6e89c9dde4bbe83d90db20d89a752e67e451259
@apoelstra
apoelstra merged commit 02feaaf into rust-bitcoin:0.2.x Sep 1, 2026
6 of 11 checks passed
@Kixunil
Kixunil deleted the 0.2.x-add-cargo-lock branch September 1, 2026 17:35
@Kixunil

Kixunil commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator Author

@apoelstra I went for a minimal fix to get CI to work and was thinking of doing the switching as a potential followup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants