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

[Bug-Candidate]: solc() function seems to construct a wrong solc path on Mac ARM (m1 pro) #211

Closed
shuo-young opened this issue Mar 24, 2024 · 2 comments

Comments

@shuo-young
Copy link

Describe the issue:

The solc-select v1.0.x seems to have a path concatenation problem on Mac ARM (m1 pro in my case). When I see the solc() function, I figure out it is a problem of the path which uses joinpath of two solc-{version}.
The problem is solved when I just change the code to path = ARTIFACTS_DIR.joinpath(f"solc-{version}").

I think #131 (comment) has the same problem I encountered. But this bug did not occur when I used v0.2.1 previously.

Code example to reproduce the issue:

Bug yields using join path of f"solc-{version}".

def solc() -> None:
    res = current_version()
    if res:
        (version, _) = res
        path = ARTIFACTS_DIR.joinpath(f"solc-{version}", f"solc-{version}")
        halt_old_architecture(path)
        halt_incompatible_system()
        try:
            subprocess.run(
                [str(path)] + sys.argv[1:],
                check=True,
            )
        except subprocess.CalledProcessError as e:
            sys.exit(e.returncode)
    else:
        sys.exit(1)

The error exists in halt_old_architecture(path).

Traceback (most recent call last):
  File "/Users/shall/anaconda3/bin/solc", line 8, in <module>
    sys.exit(solc())
  File "/Users/shall/anaconda3/lib/python3.8/site-packages/solc_select/__main__.py", line 91, in solc
    halt_old_architecture(path)
  File "/Users/shall/anaconda3/lib/python3.8/site-packages/solc_select/solc_select.py", line 30, in halt_old_architecture
    raise argparse.ArgumentTypeError(
argparse.ArgumentTypeError: solc-select is out of date. Please run `solc-select upgrade`

However, when I just use:

path = ARTIFACTS_DIR.joinpath(f"solc-{version}")

It works fine.

Version:

1.0.3

Relevant log output:

No response

@elopez
Copy link
Member

elopez commented Mar 24, 2024

Hi @shuo-young! v0.2.1 had a different way of storing the binaries. The newer releases use a new folder layout to store the compilers, and a mechanism to migrate over to the new format was added via solc-select upgrade. It sounds like you upgraded your solc-select installation to v1.0.3 but have not yet run solc-select upgrade to upgrade to the new on-disk format, could you try that and see if it helps?

@shuo-young
Copy link
Author

Hi @shuo-young! v0.2.1 had a different way of storing the binaries. The newer releases use a new folder layout to store the compilers, and a mechanism to migrate over to the new format was added via solc-select upgrade. It sounds like you upgraded your solc-select installation to v1.0.3 but have not yet run solc-select upgrade to upgrade to the new on-disk format, could you try that and see if it helps?

Thanks for your reply and I figured it out.

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

No branches or pull requests

2 participants