-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat: add skip
key to foundry.toml
#8061
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
klkvr
added a commit
to foundry-rs/compilers
that referenced
this pull request
Jun 5, 2024
better approach for foundry-rs/foundry#8061 We already keep all compilation settings on `Project` (paths, compier settings, compiler itself), so this PR moves `sparse_output` to `Project` as well to allow us to just configure it in `Config::project` instead of adding it to compiler on every invocation in multiple places. Also this PR gets rid of separate `SparseOutputFileFilter<D>` trait and makes `sparse_output` filter just a `FileFilter` again. Instead, we now have `ParsedSource::compilation_dependencies` which determines which of the source imports must be compiled along with it. Simplified some sparse output related logic along with changes. Due to `Box<dyn FileFilter>` on `Project` this PR adds `dyn-clone` to keep `Clone` impl and `derivative` to avoid manually implementing `Debug`
klkvr
force-pushed
the
klkvr/skip-in-config
branch
from
June 5, 2024 18:59
4563c05
to
578ea5a
Compare
mattsse
approved these changes
Jun 6, 2024
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.
makes sense, having skip support in foundry.toml is nice
crates/config/src/filter.rs
Outdated
/// Matches file only if the filter does not apply. | ||
/// | ||
/// This returns the inverse of `file.name.contains(pattern) || matcher.is_match(file)`. | ||
fn is_match_exclude(matcher: &GlobMatcher, path: &Path) -> bool { |
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.
can this be moved in impl GlobMatcher ?
2 tasks
pcaversaccio
added a commit
to pcaversaccio/snekmate
that referenced
this pull request
Jun 9, 2024
### 🕓 Changelog The Foundry PR foundry-rs/foundry#8061 added the `skip` key to `foundry.toml`, which can be used to configure skipping compilation of non-compilable files. We use this new feature to only compile 🐍 snekmate mock contracts. In addition, the Foundry PR foundry-rs/foundry#8086 added a Vyper configuration section `vyper` to `foundry.toml` which allows to configure the attributes `optimize` and `path`. We set the `optimize` mode to the compiler default value `gas`. --------- Signed-off-by: Pascal Marco Caversaccio <pascal.caversaccio@hotmail.ch>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
In Vyper 0.4 some of the .vy files should be excluded from compiler input because they are not valid compilation targets. While we don't perform code analysis to detect those files automatically, the proposed workaround is to exclude them manually by specifying such files in foundry.toml.
For example, to compile snekmate, you'd have to add something like
skip = ["**/*[!mock].vy"]
.Solution
Move
skip
toCoreBuildArgs
and respect configuration when constructing filter inforge test
andforge build
.forge script
andforge create
should be fine as they only compile specific target, but will do some more testing around it, so marking as wipcc @pcaversaccio