Skip to content

Commit

Permalink
target.hardware: whitelist HOME on Linux
Browse files Browse the repository at this point in the history
This resovles errors when nextpnr-ice40 tries to create directories in
the rootfs.

See: YosysHQ/oss-cad-suite-build#75
  • Loading branch information
attie committed Aug 5, 2023
1 parent ba3cb99 commit 68e0919
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions software/glasgow/target/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,17 @@ def execute(self, build_dir=None, *, debug=False):
if build_dir is None:
build_dir = tempfile.mkdtemp(prefix="glasgow_")
try:
environ = self.toolchain.env_vars
if os.name == 'nt':
env_whitelist = []

if os.name == "posix":
env_whitelist.append("HOME")
elif os.name == "nt":
# PROCESSOR_ARCHITECTURE: required for YoWASP (used by wasmtime)
for var in ("PROCESSOR_ARCHITECTURE",):
environ[var] = os.environ[var]
env_whitelist.append("PROCESSOR_ARCHITECTURE")

environ = self.toolchain.env_vars
environ.update({ k:v for k,v in os.environ.items() if k in env_whitelist })

products = self.lower.execute_local(build_dir, env=environ)
bitstream = products.get("top.bin")
except:
Expand Down

0 comments on commit 68e0919

Please sign in to comment.