Skip to content

Language server crashes on aarch64 (arm64) #271

@mtugan

Description

@mtugan

When using an aarch64 host, one will encounter an issue such as the following:

Running '/home/user/.local/bin/woke lsp --port 43831'
[Error - 6:13:31 PM] Traceback (most recent call last):
  File "/home/user/.local/pipx/venvs/woke/lib/python3.11/site-packages/woke/lsp/server.py", line 268, in _task_done_callback
    task.result()
  File "/home/user/.local/pipx/venvs/woke/lib/python3.11/site-packages/woke/compiler/compiler.py", line 1130, in compile_unit_raw
    return await self.__solc_frontend.compile(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/pipx/venvs/woke/lib/python3.11/site-packages/woke/compiler/solc_frontend/solc_runner.py", line 55, in compile
    return await self.__run_solc(target_version, standard_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/.local/pipx/venvs/woke/lib/python3.11/site-packages/woke/compiler/solc_frontend/solc_runner.py", line 83, in __run_solc
    proc = await asyncio.create_subprocess_exec(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/subprocess.py", line 218, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1694, in subprocess_exec
    transport = await self._make_subprocess_transport(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/unix_events.py", line 207, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/usr/lib/python3.11/asyncio/unix_events.py", line 810, in _start
    self._proc = subprocess.Popen(
                 ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1917, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 8] Exec format error: '/home/user/.local/share/woke/compilers/solc-linux-amd64-v0.8.20+commit.a1b79de6/solc-linux-amd64-v0.8.20+commit.a1b79de6'

This is due to the following:

https://github.com/Ackee-Blockchain/woke/blob/045171c86fa8c6971e9c1b4544ba9b34f3fc575b/woke/svm/svm.py#L60C1-L61

At least on Linux, it would be preferable if SolcVersionManager autodetected the hosts architecture for solc version downloads.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions