Note: this may not be true for all systems/OS, but is true on Windows under the following conditions:
HVCC is run in a virtual environment. The virtual environment is dedicated to the Dahlia project only, and only contains HVCC and its dependent packages.
Only a single Python instance is installed on the system. The PATH contains only a single .../Python/Python<ver> and .../Python/Python<ver>/Scripts directory entry.
The system Python version is 3.12
If HVCC returns Error c2js: [WinError 193] %1 is not a valid Win32 application when running source ./dahlia.sh js, the existing documentation suggests a hotfix by opening the Python script c2js.py located in dahlia/.venv/Lib/site-packages/hvcc/generators/c2js/. Find the three instances where subprocess.check_output() is called in that script, and append shell=True as a second argument to all of those calls. Example:
# First instance, around Line 101 in HVCC v0.9
subprocess.check_output(cmd, shell=True)
# Second instance, around Line 108 in HVCC v0.9
subprocess.check_output(cmd, shell=True)
# First instance, around Line 140 in HVCC v0.9
subprocess.check_output( # WASM
cmd + [ # type: ignore
"-s", "WASM=1",
"-s", f"EXPORT_NAME='{output_name}_Module'",
"-o", wasm_js_path
], shell=True)
It may be possible to debug the issue further by adding a traceback call in an except block following the first call to subprocess.check_output(), as follows:
# First call to 'subprocess.check_output()', around Line 101 in HVCC v0.9
try:
subprocess.check_output(cmd) # run emscripten
except Exception:
print(traceback.format_exc())
return
Note: this may not be true for all systems/OS, but is true on Windows under the following conditions:
.../Python/Python<ver>
and.../Python/Python<ver>/Scripts
directory entry.If HVCC returns
Error c2js: [WinError 193] %1 is not a valid Win32 application
when runningsource ./dahlia.sh js
, the existing documentation suggests a hotfix by opening the Python scriptc2js.py
located indahlia/.venv/Lib/site-packages/hvcc/generators/c2js/
. Find the three instances wheresubprocess.check_output()
is called in that script, and appendshell=True
as a second argument to all of those calls. Example:It may be possible to debug the issue further by adding a
traceback
call in anexcept
block following the first call tosubprocess.check_output()
, as follows: