Skip to content

Conversation

@VolodymyrBg
Copy link
Contributor

Before: Dependencies were built by shallow-merging link_references maps via extend. When both creation and deployed bytecode contained references under the same file key but with different library names, the latter overwrote the former, dropping dependencies.

After: We deep-merge the inner maps per file, unioning library names and offsets from both sources. This matches how we link and validate both bytecode objects and aligns with forge inspect ... libraries (union semantics). Prevents missing libs when a file has libraries used exclusively in constructor vs runtime.

@DaniPopes
Copy link
Member

Is there a test case we could add for this that would fail before?

@klkvr thoughts?

@VolodymyrBg
Copy link
Contributor Author

Is there a test case we could add for this that would fail before?

@klkvr thoughts?

Yes, added a test case

Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

lgtm, left a suggestion for driveby clean up

also need to commit the test files and investigate whether the linking tests are actually testing anything

klkvr
klkvr previously requested changes Sep 24, 2025
Copy link
Member

@klkvr klkvr left a comment

Choose a reason for hiding this comment

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

needs rebase and ci fixes

@VolodymyrBg VolodymyrBg force-pushed the fix/linking-deep-merge-link-references branch from 554024c to 50d62f7 Compare September 24, 2025 14:07
@VolodymyrBg
Copy link
Contributor Author

needs rebase and ci fixes

test / nextest / test unit (x86_64-pc-windows-msvc) (pull_request)
test / nextest / test unit (x86_64-pc-windows-msvc) (pull_request)Failing after 6m
test / nextest / test unit (x86_64-unknown-linux-gnu) (pull_request)
test / nextest / test unit (x86_64-unknown-linux-gnu) (pull_request)Failing after 2m

I'm sorry but i can't fix this, i can't just test it on my computer, it's not that powerful, and I think making noise here is not the best idea..

@VolodymyrBg VolodymyrBg force-pushed the fix/linking-deep-merge-link-references branch from 7625f36 to 514142f Compare September 24, 2025 19:17
@jenpaff jenpaff moved this to Ready For Review in Foundry Oct 15, 2025
Copy link
Member

@DaniPopes DaniPopes left a comment

Choose a reason for hiding this comment

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

Thanks! Updated tests. I verified that the added test fails on master and passes in this PR.

@DaniPopes DaniPopes enabled auto-merge October 21, 2025 12:20
@DaniPopes DaniPopes requested a review from klkvr October 21, 2025 12:37
@DaniPopes DaniPopes added this pull request to the merge queue Oct 21, 2025
Merged via the queue into foundry-rs:master with commit f97aeae Oct 21, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from Ready For Review to Done in Foundry Oct 21, 2025
@VolodymyrBg
Copy link
Contributor Author

Thanks! Updated tests. I verified that the added test fails on master and passes in this PR.

Wow, thank you, too. I didn't really know how to revert my incorrect rebase so i was stuck, thank you for your help

@grandizzy grandizzy moved this from Done to Completed in Foundry Oct 27, 2025
@rplusq rplusq mentioned this pull request Oct 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Completed

Development

Successfully merging this pull request may close these issues.

4 participants