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 command to check solc autodetected version #7656

Open
izcoser opened this issue Apr 14, 2024 · 5 comments · May be fixed by #7909
Open

feat(forge): add command to check solc autodetected version #7656

izcoser opened this issue Apr 14, 2024 · 5 comments · May be fixed by #7909
Labels
C-forge Command: forge good first issue Good for newcomers T-feature Type: feature

Comments

@izcoser
Copy link

izcoser commented Apr 14, 2024

Component

Forge

Describe the feature you would like

Foundry has a config which is auto detect solc version. It defaults to true and when you type forge build, it detects the appropriate newest allowed version and uses that.

I propose you add a "forge detect-sol" command which spits out the detected version.

Additional context

No response

@izcoser izcoser added the T-feature Type: feature label Apr 14, 2024
@mattsse mattsse added the good first issue Good for newcomers label Apr 14, 2024
@kamuik16
Copy link
Contributor

kamuik16 commented Apr 14, 2024

hey @mattsse! I would like to try this and have done the setup, but I need help with how to get the solc version if I have the root or path of the project you want to check for?

@izcoser
Copy link
Author

izcoser commented Apr 14, 2024

@kamuik16 Just to clarify, this feature is already built in, just not exposed as a command. So ideally you'd just find where this happens in the code.

I have no Rust experience and would take a while to learn this project's structure, which is why I didn't come up with a PR straight away.

@kamuik16
Copy link
Contributor

kamuik16 commented Apr 14, 2024

@kamuik16 Just to clarify, this feature is already built in, just not exposed as a command. So ideally you'd just find where this happens in the code.

I have no Rust experience and would take a while to learn this project's structure, which is why I didn't come up with a PR straight away.

I was asking for some refs or what to use, the project is pretty large.

@mattsse
Copy link
Member

mattsse commented Apr 14, 2024

it's likely we need some helpers for this type

https://github.com/foundry-rs/compilers/blob/ce808f4a81d953b571b5dd823a74fdc3260c1441/src/resolver/mod.rs#L462-L468

the way this is used during the compilation step is:

https://github.com/foundry-rs/compilers/blob/ce808f4a81d953b571b5dd823a74fdc3260c1441/src/compile/project.rs#L138-L147

but for this command we'd need to do this ourselves: resolve the project's graph, then the versions and print them

@zerosnacks zerosnacks added the C-forge Command: forge label Jul 15, 2024
@zerosnacks zerosnacks changed the title Add command to check solc autodetected version feat(forge): add command to check solc autodetected version Jul 15, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@Piyushsahu99
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I have experience with JavaScript and Python, along with a solid understanding of Solidity. My background in open-source projects equips me to effectively implement features and contribute to documentation. I can leverage my skills to enhance the Foundry toolset, ensuring clear communication and functionality for developers.

How I plan on tackling this issue

I would start by reviewing the existing Foundry codebase to understand how the solc version detection is implemented. Then, I would create a new command, forge detect-sol, that retrieves and displays the detected solc version. After implementing the feature, I would write tests to ensure its functionality and verify that it works seamlessly with the existing command structure.

@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-forge Command: forge good first issue Good for newcomers T-feature Type: feature
Projects
Status: In Progress
6 participants