Skip to content

feat: make auto-install the default for solc-select use (closes #197)#282

Open
cats2101 wants to merge 1 commit into
crytic:devfrom
cats2101:feat/197-always-install-default
Open

feat: make auto-install the default for solc-select use (closes #197)#282
cats2101 wants to merge 1 commit into
crytic:devfrom
cats2101:feat/197-always-install-default

Conversation

@cats2101
Copy link
Copy Markdown

@cats2101 cats2101 commented May 3, 2026

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-install the default ... and add a new clarg called --offline which would make it not install by default").

Behavior changes

  • solc-select use 0.8.19 — auto-installs 0.8.19 if missing, then switches.
  • solc-select use 0.8.19 --offline — preserves the previous behavior; halts with Version '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 --help so it doesn't crowd the documented surface, but accepted so existing CI scripts (slither, etc.) don't break.

Internally, SolcService.switch_global_version renames the always_install keyword to auto_install and flips its default from False to True.

Test plan

  • pytest tests/unit/ — 169 passed (was 165; 4 new CLI tests added in tests/unit/test_main.py).
  • ruff check clean.
  • ruff format --check clean.
  • Smoke: solc-select use 0.8.35 auto-installs and switches.
  • Smoke: solc-select use 0.4.99 --offline exits non-zero with a clear error.
  • Smoke: solc-select use 0.8.35 --always-install prints the deprecation warning to stderr and proceeds.

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.
@cats2101 cats2101 requested a review from elopez as a code owner May 3, 2026 00:07
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.

Consider making --always-install the default

1 participant