Skip to content

fix(forge): keep other profiles' cached artifacts - #18461

Open
stevencartavia wants to merge 2 commits into
masterfrom
steven/keep-profile-artifacts
Open

stevencartavia wants to merge 2 commits into
masterfrom
steven/keep-profile-artifacts

Conversation

@stevencartavia

Copy link
Copy Markdown
Member

Symbolic runs delete cached artifacts that lack storage layouts so they get recompiled. Cached artifacts are scoped by source and solc version but not by compiler profile, so a filtered run with additional compiler profiles could delete another profile's artifact that it never rewrites, leaving the cache pointing at a missing file and making every later build recompile. This only deletes stale artifacts whose source, version, and profile the run actually compiles.

Symbolic runs delete cached artifacts without storage layouts so they
are recompiled. Cached artifacts are scoped by source and solc version,
not by compiler profile, so a filtered run could delete another
profile's artifact that it never rewrites. The cache then kept pointing
at the missing file and every later build recompiled.

Only delete stale artifacts whose source, version, and profile this run
compiles.

@mattsse mattsse 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.

The filtered compilation retry can cause a false pass in symbolic tests.

Comment thread crates/forge/src/cmd/test/mod.rs Resolved
When filtered roots hit solc error 2449, the compiler retries with all
source and test roots, which can select another solc version. Resolving
the repair scope from the filtered roots then kept that compilation's
stale artifacts, so a symbolic test could pass on artifacts without
storage layouts.

Resolve the scope from the roots of the compilation that produced the
output and recompile those roots until no stale artifact is left.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-forge Command: forge Cmd-forge-test Command: forge test T-bug Type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants