-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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(forge): add compiler
subcommand
#7909
Conversation
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.
this seems fine,
wdyt @klkvr
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.
looks good to me
Support for the |
Thanks for the comments, I can add support for the --skip flag in this PR or another one. one version:
More than one:
What do you think guys? |
Hi @jpgonzalezra thanks for the PR! Would be great to get this ready to be merged I support adding the
And higher levels of verbosity as proposed by you:
|
@zerosnacks Awesome, I'll fix the conflicts so we can merge. If we want to add anything else, I'll do it in a separate PR. What do you think? |
Great, we can do this as follow ups - not a blocker for me for this PR |
@zerosnacks I need to make some changes to the PR because there have been significant updates in the compilers repository. See this commit: foundry-rs/compilers@c78e2ea. I believe I need to use the "detect_version" function. I'll work on that. 💪 |
Thanks @jpgonzalezra! Let me know if you run into any problems |
@jpgonzalezra friendly bump here. Do you still have the bandwidth to complete this? |
Would it make sense to generalize this to |
forge compiler --list
)
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.
@zerosnacks could we add a basic test for it?
Pending next release of https://github.com/foundry-rs/compilers as it required minor changes upstream to test multi-compiler mode, specifically Vyper. Command name updated to Updated PR with compiler updates, added JSON compatibility, added verbose / non-verbose mode and added skip flag. Apart from this blocker, ready for review |
forge compiler --list
)compiler
subcommand
cc @grandizzy would you mind doing a final review before merging? |
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.
Like the max supported version by compiler? |
Added a follow-up ticket here: #9125 |
* feat(forge): add solc subcommand and utilities * style: improve formatting in solc.rs file * fix: merge * add json compatible output * add basic tests * add basic tests * clean up * finish tests * add skip flag * add vyper for unit tests * move tests, pin compiler version, use forgetest! * update CI test location for target Python / Vyper * update foundry-compilers crate * Update crates/forge/bin/cmd/compiler.rs Co-authored-by: DaniPopes <[email protected]> * `compiler` command is sync, remove conditions on CI for Vyper / Python installs * is_jsonlines -> is_json --------- Co-authored-by: zerosnacks <[email protected]> Co-authored-by: zerosnacks <[email protected]> Co-authored-by: DaniPopes <[email protected]>
Closes: #7656
Motivation
The "issue 7654" it is proposed to add a new command, forge detect-solc (in this PR "forge solc vr" or "forge solc version-resolving"), which returns the detected version of the Solidity compiler based on the project configuration. This command aims to help users identify compatible versions of the Solidity compiler for different folders in large projects by providing insights into the version resolution algorithm used.
Solution
Added a solc command with the subcommand version-resolving, which retrieves the resolved versions of the Solidity compiler (solc) within the project using the SolcVersionManager from the foundry_compilers library.