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

Remove hardhat-foundry and check harnesses compilation in CI #4832

Merged
merged 22 commits into from
Jan 17, 2024

Conversation

ernestognw
Copy link
Member

@ernestognw ernestognw commented Jan 12, 2024

Before merging #4781, I tried running the FV in master and it resulted in a compilation error after 25c416d

I fixed the issues and renamed variables accordingly. I'm also adding a check for it in the CI to avoid happening again.

PR Checklist

  • Tests
  • Documentation
  • Changeset entry (run npx changeset add)

Copy link

changeset-bot bot commented Jan 12, 2024

⚠️ No Changeset found

Latest commit: d8e5046

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ernestognw ernestognw requested a review from Amxx January 12, 2024 22:35
package.json Outdated Show resolved Hide resolved
@ernestognw ernestognw requested a review from Amxx January 12, 2024 23:50
@@ -115,7 +114,7 @@ module.exports = {
},
networks: {
hardhat: {
allowUnlimitedContractSize,
allowUnlimitedContractSize: !withOptimizations,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason for this rollback ? IMO, if the coverage is enabled, then optimizations should be on, but contract size should not be limitted. (coverage does increasse the size)

@Amxx
Copy link
Collaborator

Amxx commented Jan 16, 2024

I first wanted to use conflicts, but then decided against it because it caused issues with SRC.

I review you proposal, but it doesn't work. If I do FOUNDRY=true yarn test or even FOUNDRY=false yarn test, then both foundry and src are defined (first one is a boolean, second one is a string) ... which causes conflict to fail:

Les arguments foundry et src sont mutuellement exclusifs

as nice as yargs's "conflict" is, it doesn't work for us because the conflict is not in the options being defined (what conflict checks) but in the options being turned on or modified from the default value.

Copy link

socket-security bot commented Jan 17, 2024

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/@nomicfoundation/hardhat-foundry@1.1.1

View full report↗︎

@Amxx
Copy link
Collaborator

Amxx commented Jan 17, 2024

It appears that both checks/tests, and checks/tests-foundry work without the foundry hardhat package.

The package still has a usage though: it overrides the TASK_COMPILE_GET_REMAPPINGS hardhat task so the remappings.txt file is considered. This is used by the upgradeable tests.

I'm proposing we remove the hardhat-foundry, because of the complexity is adds to handling configs in hardhat.config.js ... and add a dedicated script in the hardhat folder to maintain the remappings.txt support.

hardhat.config.js Outdated Show resolved Hide resolved
@ernestognw ernestognw changed the title Check harnesses compilation in CI Remove hardhat-foundry and check harnesses compilation in CI Jan 17, 2024
@ernestognw
Copy link
Member Author

It appears that both checks/tests, and checks/tests-foundry work without the foundry hardhat package.

The package still has a usage though: it overrides the TASK_COMPILE_GET_REMAPPINGS hardhat task so the remappings.txt file is considered. This is used by the upgradeable tests.

I'm proposing we remove the hardhat-foundry, because of the complexity is adds to handling configs in hardhat.config.js ... and add a dedicated script in the hardhat folder to maintain the remappings.txt support.

After reviewing it looks good. The downside of this is that remappings are inherited from other submodules and also include some defaults. Now we shouldn't have access to those but aren't required. In any case, we can always:

  • Read remappings from forge remappings conditionally if forge is available
  • Adapt our remappings.txt

LGTM

@ernestognw ernestognw enabled auto-merge (squash) January 17, 2024 19:25
@ernestognw ernestognw requested a review from Amxx January 17, 2024 19:25
@ernestognw ernestognw merged commit b27cd83 into OpenZeppelin:master Jan 17, 2024
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants