Skip to content

Commit

Permalink
Remove unused /tmp preopen.
Browse files Browse the repository at this point in the history
This causes crashes on Windows.

Fixes #27.
  • Loading branch information
whitequark committed Feb 4, 2023
1 parent ea39119 commit 3ac90d9
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pypi/yowasp_yosys/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,13 @@
import importlib_resources # py3.6- shim


# This isn't used yet but if yosys-abc becomes a separate binary then it will be.
_tempdir = tempfile.TemporaryDirectory("yosys")


def _run_wasm_app(wasm_filename, argv):
module_binary = importlib_resources.read_binary(__package__, wasm_filename)
module_digest = hashlib.sha1(module_binary).digest()

wasi_cfg = wasmtime.WasiConfig()
wasi_cfg.argv = argv
wasi_cfg.preopen_dir(str(importlib_resources.files(__package__) / "share"), "/share")
wasi_cfg.preopen_dir(_tempdir.name, "/tmp")
if os.name == "nt":
for letter in "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ":
wasi_cfg.preopen_dir(letter + ":\\", letter + ":")
Expand Down

0 comments on commit 3ac90d9

Please sign in to comment.