feat(config): enable dynamic test linking by default
Component
Forge
Describe the feature you would like
- turn
dynamic_test_linkingintroduced in https://github.com/foundry-rs/foundry/pull/10010 on by default - review all places where
ProjectCompiler::newis called and where it should respect the config (e.g. script broadcast will fail with config on as it needs the proper constructor instead thevm.deployCode) - test combinations of
forge testandforge script/ otherforgecommands and make sure cache is not invalidated - Re https://github.com/foundry-rs/foundry/pull/10333#issuecomment-2814837098 make sure internal fn decoding works for preprocessed tests too (and reconsider https://github.com/foundry-rs/foundry/pull/10333#issuecomment-2815910868)
Additional context
No response
Can I pick this up? I would like to work on it.
I got feedback from @emo-eth at Frontiers that dynamic test linking does not always work yet and if he is able to get a reproducible he will open a ticket
We therefore need to be hesitant enabling by default cc @grandizzy
@zerosnacks I have a (kinda janky) e2e Gambit mutation test runner - when I wrote it, I had to explicitly disable dynamic test linking in a separate profile for Gambit to get the test suite to pick up changes; the tests suites would all pass since it wouldn't re-compile the mutated source contracts (the runner just copies the entire dir including cache to a temp folder lol)
But on latest stable, it seems to be working correctly!
Will play around with it and let you know if that changes