feat: make auto-install the default for solc-select use (closes #197)#282
Open
cats2101 wants to merge 1 commit into
Open
feat: make auto-install the default for solc-select use (closes #197)#282cats2101 wants to merge 1 commit into
solc-select use (closes #197)#282cats2101 wants to merge 1 commit into
Conversation
Closes crytic#197. `solc-select use <version>` now downloads the requested version if it is not already installed. The previous opt-in `--always-install` flag is kept as a no-op (with a deprecation warning) so existing scripts keep working, and a new `--offline` flag opts out of downloading and restores the prior fail-if-missing behavior. Internally, `SolcService.switch_global_version` renames the `always_install` parameter to `auto_install` and flips its default from False to True.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #197.
Summary
solc-select use <version>now downloads the requested version if it is not already installed locally — matching the maintainer's suggestion in #197 ("make--always-installthe default ... and add a new clarg called--offlinewhich would make it not install by default").Behavior changes
solc-select use 0.8.19— auto-installs0.8.19if missing, then switches.solc-select use 0.8.19 --offline— preserves the previous behavior; halts withVersion '0.8.19' is not installed.if the version is not on disk.solc-select use 0.8.19 --always-install— still works (no-op) and prints a single deprecation warning to stderr. Kept hidden from--helpso it doesn't crowd the documented surface, but accepted so existing CI scripts (slither, etc.) don't break.Internally,
SolcService.switch_global_versionrenames thealways_installkeyword toauto_installand flips its default fromFalsetoTrue.Test plan
pytest tests/unit/— 169 passed (was 165; 4 new CLI tests added intests/unit/test_main.py).ruff checkclean.ruff format --checkclean.solc-select use 0.8.35auto-installs and switches.solc-select use 0.4.99 --offlineexits non-zero with a clear error.solc-select use 0.8.35 --always-installprints the deprecation warning to stderr and proceeds.