Skip to content

fix(fjall): use patched version of fjall with deadlock fix#930

Merged
scarmuega merged 1 commit intomainfrom
fix/fjall-manual-patch
Mar 5, 2026
Merged

fix(fjall): use patched version of fjall with deadlock fix#930
scarmuega merged 1 commit intomainfrom
fix/fjall-manual-patch

Conversation

@scarmuega
Copy link
Member

@scarmuega scarmuega commented Mar 5, 2026

Summary by CodeRabbit

  • Chores
    • Modified build configuration to utilize a patched version of a core dependency sourced from a specific development branch rather than the standard release channel for the project.
    • Updated the internal dependency version from 3.0.2 to 3.0.3 in configuration files.
    • Made build system adjustments to accommodate the new dependency sources and versions across the entire system.

@coderabbitai
Copy link

coderabbitai bot commented Mar 5, 2026

📝 Walkthrough

Walkthrough

The pull request updates the fjall crate dependency from version 3.0.2 to 3.0.3 in crates/fjall/Cargo.toml and adds a patch configuration in the root Cargo.toml to point fjall to a specific git branch for recovery purposes.

Changes

Cohort / File(s) Summary
Dependency Patch Configuration
Cargo.toml
Added [patch.crates-io] entry redirecting fjall to git source at branch recovery/change-flush-queueing for development/recovery purposes.
Fjall Version Bump
crates/fjall/Cargo.toml
Updated fjall dependency version from 3.0.2 to 3.0.3.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Possibly related PRs

Poem

🐰 A patch and a bump, the fjall takes flight,
To a recovery branch on a moonlit night,
Version three-oh-three hops into place,
With git branches guiding us through the race! 🌿

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: patching the fjall dependency with a specific git branch containing a deadlock fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/fjall-manual-patch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@Cargo.toml`:
- Around line 232-233: The patch for the fjall crate in the Cargo.toml uses a
mutable branch ("recovery/change-flush-queueing"); change it to pin the patch to
an immutable commit by replacing the branch key with rev = "<commit-sha>" (use
the exact commit SHA you want) under the [patch.crates-io] entry for fjall so
the patch refers to a fixed commit rather than a moving branch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 28c1bb27-3e3c-4900-83e2-8001f20337ba

📥 Commits

Reviewing files that changed from the base of the PR and between 0edc11e and f468c7a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (2)
  • Cargo.toml
  • crates/fjall/Cargo.toml

Comment on lines +232 to +233
[patch.crates-io]
fjall = { git = "https://github.com/fjall-rs/fjall.git", branch = "recovery/change-flush-queueing" }
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "Resolving current head of target branch:"
git ls-remote https://github.com/fjall-rs/fjall.git refs/heads/recovery/change-flush-queueing

lockfile="$(fd '^Cargo.lock$' | head -n1)"
if [ -n "${lockfile:-}" ]; then
  echo
  echo "Current fjall lock entry:"
  rg -n 'name = "fjall"|source = "git\+https://github\.com/fjall-rs/fjall\.git' "$lockfile" -A4 -B2
fi

Repository: txpipe/dolos

Length of output: 492


🌐 Web query:

Cargo.toml patch.crates-io mutable branch non-reproducible builds best practices

💡 Result:

Problem with mutable branch in [patch.crates-io]

If you patch a crates.io dependency to a git branch (e.g. branch = "main"), the meaning of that dependency can change whenever the branch tip moves. Cargo will lock the exact commit in Cargo.lock at the time of resolution, and it will only change when you update the lockfile (for example via cargo update, deleting Cargo.lock, etc.). (doc.rust-lang.org)
So builds become non-reproducible whenever you don’t reliably use the same lockfile (or you intentionally/accidentally update it).

Best practices (reproducible + least surprise)

  1. Prefer pinning the patch to an immutable commit (rev)
    Use a full commit SHA for the patch target:

    [patch.crates-io]
    somecrate = { git = "https://github.com/org/somecrate", rev = "…full_sha…" }

    Cargo explicitly supports choosing commits via rev/tag/branch, and using rev avoids “moving target” issues. (doc.rust-lang.org)

  2. If you must use a branch (short-lived), treat Cargo.lock as mandatory
    Commit Cargo.lock (especially for binaries/apps) and have CI enforce it. Cargo’s own guidance: “When in doubt, check Cargo.lock into version control.” (doc.rust-lang.org)

  3. Enforce lockfile determinism in CI

    • Use cargo build --locked to fail if the lockfile would change.
    • Use cargo build --frozen to additionally prevent network access (good for hermetic CI). (venea.net)
  4. Keep patches local-only when appropriate
    Cargo allows putting [patch] into .cargo/config.toml or passing it via --config, which is useful for temporary/local patches you don’t want to commit to the repo. (doc.rust-lang.org)

  5. Avoid relying on [patch] in published libraries
    [patch] is only read from the workspace root; it’s primarily a consumer-side override mechanism, not something downstream users of your published library will automatically inherit. (doc.rust-lang.org)

Practical rule of thumb

  • Long-lived / shared builds: pin with rev (best), commit Cargo.lock, and build with --locked (and often --frozen) in CI. (doc.rust-lang.org)
  • Short-lived experimentation: branch patch is fine, but expect the lockfile to be the real source of reproducibility. (doc.rust-lang.org)

Citations:


Pin patched fjall to an immutable commit (rev) instead of a branch.

Using a mutable branch in [patch.crates-io] makes the patch target a moving reference, which can silently change behavior when the branch advances. Although Cargo.lock currently locks the exact commit, pinning to rev in Cargo.toml is the best practice—it makes intent explicit and doesn't rely on lockfile enforcement.

Proposed fix
 [patch.crates-io]
-fjall = { git = "https://github.com/fjall-rs/fjall.git", branch = "recovery/change-flush-queueing" }
+fjall = { git = "https://github.com/fjall-rs/fjall.git", rev = "2443c7bcf6f53920efef836518d76e865974c4ca" }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
[patch.crates-io]
fjall = { git = "https://github.com/fjall-rs/fjall.git", branch = "recovery/change-flush-queueing" }
[patch.crates-io]
fjall = { git = "https://github.com/fjall-rs/fjall.git", rev = "2443c7bcf6f53920efef836518d76e865974c4ca" }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Cargo.toml` around lines 232 - 233, The patch for the fjall crate in the
Cargo.toml uses a mutable branch ("recovery/change-flush-queueing"); change it
to pin the patch to an immutable commit by replacing the branch key with rev =
"<commit-sha>" (use the exact commit SHA you want) under the [patch.crates-io]
entry for fjall so the patch refers to a fixed commit rather than a moving
branch.

@scarmuega scarmuega merged commit f13e2c3 into main Mar 5, 2026
12 checks passed
@scarmuega scarmuega deleted the fix/fjall-manual-patch branch March 5, 2026 10:42
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.

1 participant