-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow multiple compiler configs (#170)
This adds `CompilerSettings::Restrictions` associated type which allows configuring constraints for compilation settings. Those constraints can be checked against a settings object and merged. Ideally given a set of constraints we'd be able to automatically resolve configurations given only basic (default) config, though I think we can do this in follow-up. Current implementation requires user to provide us with concrete profiles such that for each defined constraint at least one of the profiles matches it. This should be enough for most of the usecases for now. Profile to use is resolved in `Graph` similarly to version resolution. The way this could look in foundry.toml is: ```toml [profile.default] # by default no via-ir and evm version is paris for everything evm_version = "paris" via_ir = false # add cancun profile and via_ir profiles additional_compiler_profiles = [{ evm_version = "cancun" }, {via_ir = true} ] # enforce compiling some contracts with cancun, and some with via-ir # if those contracts are imported by some items in the project, constraints will apply as well compilation_constraints = [{path = "./**/*.cancun.sol", min_evm_version = "cancun" }, {path = "SomeComplexFile.sol", via_ir = true }] ``` When writing artifacts, a profile name is added to artifact file name if the same contract was compiled with multiple artifacts.
- Loading branch information
Showing
21 changed files
with
842 additions
and
309 deletions.
There are no files selected for viewing
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
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
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
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
Oops, something went wrong.