crytic / solc-select

Manage and switch between Solidity compiler versions
GNU Affero General Public License v3.0
758 stars 103 forks source link

Feature request: Support for a "solc use" command like with nvm #16

Closed pcowgill closed 5 years ago

ESultanik commented 5 years ago

Would you expect the setting to be applied as a global default, or would it just persist for the current session?

pcowgill commented 5 years ago

With nvm it’s just for the current session, but definitely open to whichever is easier to implement!

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 300.0 DAI (300.0 USD @ $1.0/DAI) attached to it.

pcowgill commented 5 years ago

I submitted this issue for funding through Gitcoin Requests, and now it will pay out 300 DAI if anyone is up for working on it.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 11 months, 2 weeks from now. Please review their action plans below:

1) b-m-f has been approved to start work.

Look at nvm implementation on how the version switch in the current session is done. I am guessing an environment variable that links to the executable somwhere in ~.

Implement the use switch according to the researched switching mechanism.

Learn more on the Gitcoin Issue Details page.

b-m-f commented 5 years ago

Heyho,

Ive applied through gitcoin, but I think this will be much better to do when https://github.com/crytic/solc-select/issues/19 lands. Especially when basing the switch on $SOLC_PATH.

I would be able to test on Linux and Windows.

ivanvpan commented 5 years ago

@b-m-f I have a feeling, that regardless of whether my code for #19 gets merged switching to nvm style behavior would be a pretty significant switch and might warrant a parallel implementation whether in the same repo or separately. install_solc.sh code is useful for fetching the versions, but that's about all the shared code I foresee.

Philosophically thinking it's a problem that a lot of projects encounter and it feels like there should be a generalized framework for this. Just hook in version listing and fetching and you are good to go. I am not sure I want to be the one writing any of this in shell-script though.

PS Another example of a similar project is tfswitch for Terraform. Maybe could help to look at their mechanics.

b-m-f commented 5 years ago

I am starting work on this today and will post an update later :)

b-m-f commented 5 years ago

Hi @ESultanik ,

the PR is open at https://github.com/crytic/solc-select/pull/24/files and should work as expected. I will give it a spin on a Mac now, was developing this on Linux ( now I can also appreciate the work from @ivanvpan better ), to check if the utilities I used will work nicely (e.g. grep).

b-m-f commented 5 years ago

Tried on Mac and works after changing grep -P to grep -E

image

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 300.0 DAI (300.0 USD @ $1.0/DAI) has been submitted by:

  1. @b-m-f

@ceresstation please take a look at the submitted work:


ESultanik commented 5 years ago

@ceresstation I just merged the PR. It looks like this is complete!

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 300.0 DAI (300.0 USD @ $1.0/DAI) attached to this issue has been approved & issued to @b-m-f.

kvendingoldo commented 8 months ago

@ivanvpan btw. you can also use tenv that support Terraform as well as OpenTofu (and Terragrunt :) ) in one tool. It allow you to simplify version management and can do much more, than tfswitch.