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

feat(forge): add solc subcommand and utilities #7909

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jpgonzalezra
Copy link

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.

  • Ex. with solmate project
$ forge solc vr 

Screenshot 2024-05-11 at 18 40 24

Copy link
Member

@mattsse mattsse left a 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

Copy link
Member

@klkvr klkvr left a 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

@mds1
Copy link
Collaborator

mds1 commented May 13, 2024

Support for the --skip flag that forge build has would be really nice to allow filtering out directories from the results. When I test this, the output is dominated by e.g. lib/ and test/ files that obscure the src/ files of interest (not a blocker for this PR, can be done in a follow up)

@jpgonzalezra
Copy link
Author

jpgonzalezra commented May 13, 2024

Thanks for the comments, I can add support for the --skip flag in this PR or another one.
And maybe we can add --silent to only print the version, something link:

one version:

  • 0.8.15

More than one:

  • 0.8.15
  • 0.8.25

What do you think guys?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants