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

SOLC_VERSION defined in workflow environment with incorrect value may cause confusing error #19

Closed
elopez opened this issue Jul 3, 2022 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@elopez
Copy link
Member

elopez commented Jul 3, 2022

If SOLC_VERSION is somehow defined in the environment, this causes solc-select inside of the action to observe it. In particular, this might cause a confusing Slither error if the value is incorrect, because solc will print an error saying it's not correctly installed:

SOLC_VERSION=foo solc
Version 'foo' not installed (set by SOLC_VERSION). Run `solc-select install foo`.
Traceback (most recent call last):
  File "/opt/slither/lib/python3.9/site-packages/crytic_compile/platform/solc.py", line 544, in _run_solc
    ret: Dict = json.loads(stdout)
  File "/usr/local/lib/python3.9/json/__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.9/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.9/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:

See #18

@elopez elopez added the enhancement New feature or request label Jul 3, 2022
elopez added a commit that referenced this issue Jul 28, 2022
Users may set SOLC_VERSION in the workflow and cause hard-to-diagnose
problems in the action (see #19). To avoid that
from happening, unset SOLC_VERSION early on. If the user desires
to change the solc version, they can always use the `solc-version`
action option.
elopez added a commit that referenced this issue Jul 29, 2022
Users may set SOLC_VERSION in the workflow and cause hard-to-diagnose
problems in the action (see #19). To avoid that
from happening, unset SOLC_VERSION early on. If the user desires
to change the solc version, they can always use the `solc-version`
action option.
@elopez elopez added this to the v0.2 milestone Sep 5, 2022
@elopez elopez closed this as completed Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant