You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a Docker container in which I run multiple forge scripts. What I want to achieve is: Run forge build when building the container, then run the script (without building again) when I run the container.
The text was updated successfully, but these errors were encountered:
Running forge build without --skip flag will compile all contracts in project, and then forge script will just read cached script artifact, solving your usecase.
--skip flag on forge script doesn't really work, but currently forge script on its own is already smart enough to detect and compile only targeted script contract
Thanks for your reply! Unfortunately that's not my experience, currently forge script seems to always recompile all my contracts, do you know what might be the reason?
Here's the output when I run these commands on the host machine (not in Docker):
> forge --version
forge 0.2.0 (26e6e57 2024-04-28T00:19:12.405804000Z)
> forge build
[⠊] Compiling...
[⠒] Compiling 297 files with 0.8.24
[⠆] Solc 0.8.24 finished in 17.78s
Compiler run successful!> forge script scripts/foundry/TomlTest.s.sol:TomlTest
[⠊] Compiling...
[⠘] Compiling 282 files with 0.8.24
[⠊] Solc 0.8.24 finished in 16.44s
Compiler run successful!
Traces:
...
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
19d69f2
What command(s) is the bug in?
forge script
Operating System
Linux
Describe the bug
It seems that
--skip
works withforge build
to skip compilation, but it does not work withforge script
.I tried multiple combinations (e.g.
--skip "*"
,--skip "*.sol"
,--skip "src" --skip "scripts"
).I have a Docker container in which I run multiple forge scripts. What I want to achieve is: Run
forge build
when building the container, then run the script (without building again) when I run the container.The text was updated successfully, but these errors were encountered: