-
Notifications
You must be signed in to change notification settings - Fork 12
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
chore: fork Foundry Forge #466
Conversation
|
# Setting RUSTFLAGS env for clippy makes it not include custom rules | ||
RUSTFLAGS=-Dwarnings cargo check --workspace --all-targets ${ALL_FEATURES} | ||
cargo clippy --all --all-targets ${ALL_FEATURES} -- -D warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed the separate cargo check
as Clippy is running it anyway and it was triggering recompilation for some reason.
@@ -28,7 +28,6 @@ rustflags = [ | |||
"-Wclippy::float_cmp_const", | |||
"-Wclippy::fn_params_excessive_bools", | |||
"-Wclippy::from_iter_instead_of_collect", | |||
"-Wclippy::if-not-else", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed this lint as Foundry code has a pattern of checking for error conditions first with if !invariant { error } else { ... }
. I think this is a reasonable pattern that we shouldn't prevent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just allow the pattern in the foundry crates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're planning to heavily modify the foundry crates, and it's not great if there are different coding standards for different parts of the code base + I don't think the pattern is actually harmful.
@@ -29,9 +29,6 @@ pids | |||
# Directory for instrumented libs generated by jscoverage/JSCover | |||
lib-cov | |||
|
|||
# Coverage directory used by tools like istanbul | |||
coverage |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this as it excluded the coverage
directory in the Foundry code and we don't use JS code coverage
It's hard for me to evaluate the side-effects of all of the changes to the workspace's |
Thanks for your review! The main thing to look out for is not to break |
@@ -14,7 +14,6 @@ workspace.code-workspace | |||
# ignoring the node_modules part, as it'd ignore every node_modules, and we have some for testing | |||
|
|||
# Logs | |||
logs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed this as it excluded the logs
directory in Foundry test data. We can re-add it in subdirectories if it becomes necessary
.github/workflows/edr-ci.yml
Outdated
- name: Cargo hack for EDR crates | ||
run: | | ||
chmod +x ./github/scripts/cargo-hack-edr.sh | ||
./github/scripts/cargo-hack-edr.sh | ||
shell: bash |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cargo-hack
, the tool that makes sure that all feature combinations compile is failing for the Foundry crates. Since we aren't planning to publish them, this is ok, so I changed the CI to only run cargo-hack
for EDR crates.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: #466 (comment)
I added the following changes to fix CI failures:
The PR is now ready for final review. |
I think this has effects beyond publishing. In my normal workflow I always test syntax with Is that the case here? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left one new question based on updates
Right, I addressed this in 75b1443 by splitting up the |
Thanks! |
Adds a fork of Foundry's Forge as a library to the EDR workspace to serve as a basis of the Solidity tests features. As discussed, this is a clean fork, applying patches from upstream is not a prio. The forked commit is: https://github.com/foundry-rs/foundry/commits/0a5b22f07
Forge depends on a lot of crates within Foundry. These are included in this fork. The test suites for all these crates are included as well. Foundry Solidity build tools are necessary to run these tests, so these are also included.
At the linked commit, the Foundry repo has 123275 lines of Rust code, this fork has 56243 lines of Rust code. I've only changed the included Foundry code to pass our lints and disable flaky tests. I suspect that we can further remove a significant part of these 56k lines in the future.
The Foundry repo uses workspace dependencies so I added these to our root Cargo.toml. Unifying these dependencies with EDR crates is a follow up task. The Foundry repo had a lot of customized compilation flags in their root Cargo.toml, I ported these to our root manifest as well to speed up compilation.