-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Always recompiling contracts when running tests in Docker #2493
Comments
Weirdly, it seems like running the commands "from the outside" of the container works better This does not recompile the contracts. But since the container is recreated everytime, it needs to reinstall the solidity versions everytime so it's also slow to run |
isn't that expected that if you create and rm a docker container that everything is wiped if no volumes are mounted? you could point forge to a the solc version you'd like to use and mount that volume? |
A volume is mounted and the cache directory is present inside the container. |
forge uses https://github.com/roynalnaruto/svm-rs to manage solc versions, if none is given, it will install the missing solc default dir is |
Thanks! So I can mount a volume for the svm dir to avoid reinstalling it. But unfortunately it doesn't change the recompilation issue |
this only happens in docker? or regardless? |
yes, only in docker it seems. I can't figure out why, that's why I opened this issue |
Perhaps it is a permission issue wrt the mounted directory? Does it write to both |
yes all seems to be good. If I remove all the cache folders, they are correctly recreated and written to (both in the docker and on my filesystem). So it doesn't seem like this is the issue.
|
Btw, I noticed that sometimes contracts are not recompiled (I can't tell why, or when), but even if not recompiled everything is extremely slow in the docker while really smooth on my local system.
It's weird, maybe I'm doing something wrong? |
One last test I just ran: I ran a new I'm not sure, it's just an idea |
I've also ran into this issue. In our docker environment it's not creating the cache directory even when I run In my local environment it's working just fine. |
perhaps this is a path issue,
|
forge --version
So I'm running Context is this PR: https://github.com/ethereum-optimism/optimism/pull/5100/files
|
can you please also share the docker command? |
The command is the one that's getting run. This is in circle CI. One thing I just noticed: |
Yea, sorry, |
the hash "885cb69240a935d632d79c317109709ecfa91a80626ff3989d68f67f5b1dd12d" is 'hevm cheat code' hashed |
Hi @teddav / @trianglesphere, is this issue still active? |
No idea @zerosnacks ... that was 2 years ago 😅 |
I haven't been looking into this either. Feel free to close. |
Component
Forge
Have you ensured that all of these are up to date?
What version of Foundry are you on?
forge 0.2.0 (3c49efe 2022-07-14T05:00:56.289692121Z)
What command(s) is the bug in?
forge test
Operating System
macOS (Apple Silicon)
Describe the bug
I'm running foundry inside the docker image provided
ghcr.io/foundry-rs/foundry
.Here are the commands I'm running:
$ docker run -it --rm -v $(pwd):/app -w /app ghcr.io/foundry-rs/foundry sh
$ forge test -vvvv
The first time it installs the correct solc version and compiles everything. But then everytime I run
forge test
, it keeps recompiling all the contracts and tests are also a bit slow to run.Just in case, here is my foundry.toml
Other than that, everything seems to work correctly.
The text was updated successfully, but these errors were encountered: