wasmer icon indicating copy to clipboard operation
wasmer copied to clipboard

wasiswiftc compilation fails - swiftenv which swiftc returned non-zero exit code 1

Open tqwewe opened this issue 3 years ago • 0 comments

Describe the bug

I've installed swift, and wasienv, and attempting to follow the tutorial for compiling swift to wasi, I get an error:

❯ wasiswiftc example.swift -o example.wasm
Traceback (most recent call last):
  File "/home/ari/.wasienv/bin/wasiswiftc", line 8, in <module>
    sys.exit(wasiswiftc())
  File "/home/ari/.local/lib/python3.8/site-packages/wasienv/commands.py", line 54, in wasiswiftc
    return execute(wasiswiftc_run)
  File "/home/ari/.local/lib/python3.8/site-packages/wasienv/tools.py", line 196, in execute
    sys.exit(f(args))
  File "/home/ari/.local/lib/python3.8/site-packages/wasienv/wasiswiftc.py", line 16, in run
    SWIFTWASIBIN = run_process([SWIFTENV_BIN, "which", "swiftc"], get_output=True).strip()
  File "/home/ari/.local/lib/python3.8/site-packages/wasienv/tools.py", line 83, in run_process
    ret = run(cmd, check=check, input=input, *args, **kwargs)
  File "/usr/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/ari/.local/lib/python3.8/site-packages/wasienv-storage/swift/swiftenv/bin/swiftenv', 'which', 'swiftc']' returned non-zero exit status 1.

wasmer 2.2.1 | rustc 1.60.0 (7737e0b5c 2022-04-04) | x86_64

Steps to reproduce

  1. Install wasmer & wasienv from the docs
  2. Install swift with wasienv: wasienv install-swift
  3. Create the example.swift file from the swift to wasi docs
  4. Attempt to compile the swift file to wasm: wasiswiftc example.swift -o example.wasm
  5. Compilation fails due to error

Expected behavior

It should compile to wasm.

Actual behavior

The command fails. See error above.

tqwewe avatar May 09 '22 07:05 tqwewe