Skip to content

Make Cargo-minimal and Cargo-recent lockfiles follow expected convention#1612

Merged
DanGould merged 6 commits into
payjoin:masterfrom
benalleng:lockfile-correctness
Jun 12, 2026
Merged

Make Cargo-minimal and Cargo-recent lockfiles follow expected convention#1612
DanGould merged 6 commits into
payjoin:masterfrom
benalleng:lockfile-correctness

Conversation

@benalleng

@benalleng benalleng commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

The Cargo-minimal and Cargo-recent lockfiles were not actually pointing to the minimal and recent semvers of the dependencies and were instead just copies of the Cargo.lock lockfile.

This is somewhat related to the release but I don't think its all that critical just something that I thought should be improved.

Relates to #940 though I'm not sure it should close it
also related is #454

Pull Request Checklist

Please confirm the following before requesting review:

@coveralls

coveralls commented Jun 6, 2026

Copy link
Copy Markdown
Collaborator

Coverage Report for CI Build 27358652152

Coverage remained the same at 85.188%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 14718
Covered Lines: 12538
Line Coverage: 85.19%
Coverage Strength: 371.0 hits per line

💛 - Coveralls

@benalleng benalleng force-pushed the lockfile-correctness branch from 13a6c1c to 31dd86b Compare June 6, 2026 18:45
@benalleng benalleng marked this pull request as draft June 6, 2026 19:04
@benalleng benalleng force-pushed the lockfile-correctness branch 11 times, most recently from 36266b3 to 3e77c6c Compare June 10, 2026 14:53
@benalleng benalleng marked this pull request as ready for review June 10, 2026 15:02
@benalleng benalleng requested a review from DanGould June 10, 2026 15:03
@benalleng

Copy link
Copy Markdown
Collaborator Author

This should avoid cargo updates from occuring on stray CI jobs preventing failures like https://github.com/payjoin/rust-payjoin/actions/runs/27285126244/job/80590095693?pr=1629 in efc5b92 from happening

@DanGould DanGould left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a welcome cleanup for a dangling issue

I ran into an issue running ./update-lock-files.sh locally where payjoin-test-utils had futures = "0.3" and payjoin-mailroom has futures = "0.3.21". cargo +nightly check -Z direct-minimal-versions pins each direct dep to
its own lowest acceptable version, picks 0.3.11 for test-utils, then hits mailroom's ≥0.3.21 floor — and since there's one futures node in the graph, the minima can't coexist → "all possible versions conflict."

error from run ```console dan@Excavator payjoin % bash ./contrib/update-lock-files.sh Updating crates.io index Updating git repository `https://github.com/chavic/uniffi-bindgen-cs.git` Updating git repository `https://github.com/Uniffi-Dart/uniffi-dart.git` error: failed to select a version for `futures`. ... required by package `payjoin-mailroom v0.1.1 (/Users/dan/f/dev/payjoin/payjoin-mailroom)` versions that meet the requirements `^0.3.21` are: 0.3.21

all possible versions conflict with previously selected packages.

previously selected package futures v0.3.11
... which satisfies dependency futures = "^0.3" of package payjoin-test-utils v0.0.1 (/Users/dan/f/dev/payjoin/payjoin-test-utils)
... which satisfies path dependency payjoin-test-utils of package payjoin v1.0.0-rc.3 (/Users/dan/f/dev/payjoin/payjoin)
... which satisfies dependency payjoin = "^1.0.0-rc.3" of package payjoin-cli v0.2.0 (/Users/dan/f/dev/payjoin/payjoin-cli)

failed to select a version for futures which could resolve this conflict

Comment thread payjoin-test-utils/Cargo.toml Outdated
bitcoin = { version = "0.32.7", features = ["base64"] }
bitcoin = { version = "0.32.9", features = ["base64"] }
corepc-node = { version = "0.10.0", features = ["download", "29_0"] }
futures = { version = "0.3", default-features = false, features = ["std"] }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bumping this fixes my update run locally

Suggested change
futures = { version = "0.3", default-features = false, features = ["std"] }
futures = { version = "0.3.21", default-features = false, features = ["std"] }

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have no idea how I didn't catch this, good find

Comment thread contrib/update-lock-files.sh Outdated
done
# Cargo-minimal.lock
# minimum direct dependency versions
rm -f Cargo.lock && cargo +nightly check --all-features -Z direct-minimal-versions

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we want --all-targets here so that we make sure tests (and examples, if we have them) also compile with these minimum deps. I don't think dev-dependencies find their minimums without this.

Suggested change
rm -f Cargo.lock && cargo +nightly check --all-features -Z direct-minimal-versions
rm -f Cargo.lock && cargo +nightly check --all-features --all-targets -Z direct-minimal-versions

@benalleng benalleng force-pushed the lockfile-correctness branch from 3e77c6c to cb10f73 Compare June 11, 2026 12:55
@benalleng benalleng requested a review from DanGould June 11, 2026 12:56
@benalleng benalleng force-pushed the lockfile-correctness branch 2 times, most recently from cb10f73 to 712dcf1 Compare June 11, 2026 14:27
@benalleng benalleng force-pushed the lockfile-correctness branch from 712dcf1 to 19d702d Compare June 11, 2026 15:37
Comment on lines -43 to -56
Lint-FFI:
runs-on: ubuntu-latest
steps:
- name: "Checkout repo"
uses: actions/checkout@v4
- name: "Use cache"
uses: Swatinem/rust-cache@v2
- name: "Install nix"
uses: DeterminateSystems/determinate-nix-action@main
- name: "Use nix cache"
uses: DeterminateSystems/magic-nix-cache-action@main
- name: "Run linting check"
run: cd payjoin-ffi && nix develop -c ./contrib/lint.sh

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know why this was separated in the first place? Chesterson's fence?

@benalleng benalleng Jun 11, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into the history for this very question. I think that we simply didn't want any failures to hit the main crate at the time as there is no other explanation was given to keep them separate. #846 included commits to actually make it pass the lint so I suspect that was partly why as there was perhaps some expectation of continued instability. @arminsabouri do you have a recollection about any additional motivation here?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the workspaces used to be separated because there was no way to compile payjoin-ffi with the old MSRV, so that'd be one potential reason. Now everything is in the top level Cargo.toml workspace it can all be compiled and linted together.

@DanGould DanGould left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My only real concern here is 'Merge lint and lint-ffi into a single CI job' being here without rationale or understanding why they were separated in the first place. Because it's linting in CI I don't think it's load bearing and am ok moving forward but I do wonder why

@DanGould DanGould merged commit 4a6bdb2 into payjoin:master Jun 12, 2026
26 checks passed
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.

3 participants