Skip to content
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

Compiles Every Time #4439

Closed
amarpatel opened this issue Oct 4, 2023 · 3 comments
Closed

Compiles Every Time #4439

amarpatel opened this issue Oct 4, 2023 · 3 comments
Assignees
Labels
status:needs-more-info There's not enough information to start working on this issue

Comments

@amarpatel
Copy link

Version of Hardhat

2.17.4 + 2.17.1

What happened?

After compiling, when running tests, HH used to say some message like "nothing to compile". That isn't happening anymore.

I ran the following command:

npx hardhat clean && npx hardhat clean --global && rm -rf node_modules && yarn install && npx hardhat compile;
npx hardhat test;
npx hardhat test;
image

Unless --no-compile is specified, this behavior adds ~60s to each test run. It's impractical to update all the callsites to address this regression.

Minimal reproduction steps

npx hardhat clean && npx hardhat clean --global && rm -rf node_modules && yarn install && npx hardhat compile;
npx hardhat test;
npx hardhat test;

Search terms

hardhat compile every time, hardhat compile before testing

@ChristopherDedominici
Copy link
Contributor

Hi @amarpatel, I tried to repro but for me it works correctly.
Could you please provide the code example that you used so I can repro the exact scenario? Thanks.

@ChristopherDedominici ChristopherDedominici added status:needs-more-info There's not enough information to start working on this issue and removed status:triaging labels Oct 10, 2023
@amarpatel
Copy link
Author

My team is working on a private repo, so I'm not able to provide a link.

Are there any limitations that cause compiles to run on every action? (EG: memory limits, quantity of solidity files, etc.). My dev environment includes the following:

export HARDHAT_MAX_MEMORY=4096
export NODE_OPTIONS=--max_old_space_size=4096

@fvictorio
Copy link
Member

Hey @amarpatel, if you are running npx hardhat compile twice and it's compiling both times, then that's either a bug in Hardhat or something strange in your setup. The reasons why Hardhat would compile the second time are that you changed something in the files or in the solidity config, or that the cache directory was removed, or something like that.

If this is a bug, then we'll need some way to reproduce it. If you can give me or @ChristopherDedominici temporary access to your repo, we can take a look. If that's not possible, then the only thing you could do is try to create a separate reproduction repo that you can share (for example, by eliminating all the code you can while preserving the unexpected behavior).

@ChristopherDedominici ChristopherDedominici closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
@github-project-automation github-project-automation bot moved this from Backlog to Done in Hardhat Nov 6, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status:needs-more-info There's not enough information to start working on this issue
Projects
Archived in project
Development

No branches or pull requests

3 participants