Fix patch logic to include workspace root Cargo.toml#1646
Merged
leighmcculloch merged 2 commits intomainfrom Dec 16, 2025
Merged
Fix patch logic to include workspace root Cargo.toml#1646leighmcculloch merged 2 commits intomainfrom
leighmcculloch merged 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the GitHub workflow that tests soroban-examples to ensure that both local and workspace root Cargo.toml files are patched with local SDK dependencies. The previous implementation only patched files found by find, which missed the workspace root Cargo.toml when it was outside the search path.
Key changes:
- Explicitly includes the workspace root Cargo.toml by using
cargo metadatato determine its location - Uses deduplication via
sort -uto avoid patching the same file twice - Maintains backward compatibility by continuing to patch all local Cargo.toml files found via
find
Comments suppressed due to low confidence (1)
.github/workflows/test-with-soroban-examples.yml:90
- The variable
$fileshould be quoted to handle file paths that might contain spaces or special characters. Without quotes, paths with spaces will be split into multiple arguments, causing the script to fail.
echo Patching "$file" ...
dir=$(dirname "$file")
for crate in $crates; do
rel_path=$(realpath --relative-to="$dir" ${{ github.workspace }}/rs-soroban-sdk/$crate)
sed -i 's|'"$crate"' = "\([^"]*\)"|'"$crate"' = { path = "'"$rel_path"'" }|g' "$file"
sisuresh
approved these changes
Dec 16, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Update the soroban examples test workflow to patch both local Cargo.toml files and the workspace root Cargo.toml.
Why
The previous logic only patched local Cargo.toml files found by find, missing the workspace root Cargo.toml which may be located outside the search path.
Related: