Skip to content

Conversation

@lucasbalieiro
Copy link
Collaborator

as follow-up of #2026

to unblock #2029

This avoids "patch was not used in the crate graph" warnings when the version of a patched dependency changes and the lockfile still pins the old version.

@lucasbalieiro lucasbalieiro force-pushed the update-cargo-after-patch branch 4 times, most recently from 36e1dd6 to ed92602 Compare December 16, 2025 19:15
# Override dependencies with local paths
[patch.crates-io]
stratum-core = {path = "../../../stratum-core"}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These lines were removed because a preceding sed command deletes content up to the first blank line.
The extra blank line triggered incorrect behavior in local sessions.
CI did not catch this because each CI run fetches sv2-apps from a clean state.

@lucasbalieiro lucasbalieiro marked this pull request as ready for review December 16, 2025 19:22
EOF

# we are inside the INTEGRATION_TESTS_DIR at this point
cargo update -p stratum-core
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to run cargo update?

we should add a comment explaining the motivations

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ammended a comment expanding the explanation of the PR description

diff --git a/scripts/run-integration-tests.sh b/scripts/run-integration-tests.sh
index 10362dacfb..f14aac4c28 100755
--- a/scripts/run-integration-tests.sh
+++ b/scripts/run-integration-tests.sh
@@ -122,15 +122,21 @@ fi
 
 # Add the patch section at the end of the file
 cat >> Cargo.toml << 'EOF'
-
 # Override dependencies with local paths
 [patch.crates-io] 
 stratum-core = {path = "../../../stratum-core"}
-
 [patch."https://github.com/stratum-mining/stratum"]
 stratum-core = {path = "../../../stratum-core"}
 EOF
 
+# Force a refresh of Cargo.lock so the patched stratum-core is not ignored after
+# a crate version change. When stratum-core's version changes, the lockfile may still
+# pin an older version, causing Cargo to ignore the patch entirely
+# ("patch was not used in the crate graph"). Running `cargo update -p stratum-core`
+# updates the lockfile to match the patched crate, ensuring the local override
+# actually takes effect.
+cargo update -p stratum-core
+
 echo "✅ Updated Cargo.toml to use local dependencies"
 echo "🏃 Running integration tests..."
 

This avoids "patch was not used in the crate graph" warnings when the version
of a patched dependency changes and the lockfile still pins the old version.
@lucasbalieiro lucasbalieiro force-pushed the update-cargo-after-patch branch from ed92602 to 1c30fd3 Compare December 16, 2025 19:46
@plebhash plebhash merged commit 4813c77 into stratum-mining:main Dec 16, 2025
14 checks passed
@lucasbalieiro lucasbalieiro deleted the update-cargo-after-patch branch December 16, 2025 21: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.

2 participants