You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect path resolution in emcc.bat/em++.bat #19207
One such case, in which emcc is called with quotes is when building boost for emscripten using the b2 tool.
Possible Solution
Since the path to emsdk is available in the EMSDK environment variable, it can be used to replace "%~dp0\%~n0.py" with "%EMSDK%\upstream\emscripten\%~n0.py
Add a Hello.cpp file that prints the "Hello World" message
Create and run a build.bat batch file that runs the command emcc Hello.cpp
Create and run a build_with_quotes.bat batch file that runs the command "emcc" Hello.cpp (with quotes around the emcc command)
Observations
The build succeeds in Step 2
Step 3 fails with the following message: <path-to-emsdk>\python\3.9.2-nuget_64bit\python.exe can't open file '<path-to-build_with_quotes.bat>\emcc.py': [Errno 2] No such file or directory
OS Details
Windows 10 Pro, Version - 21H2, OS Build - 19044.2486
Activity
juj commentedon Apr 19, 2023
Trying to reproduce, with
t.batbut at least on my Windows 10, I am unable to coax out a difference:
I also tried to follow the repro at https://stackoverflow.com/a/26851883 , but was not able to reproduce the issue. The post is 10 years old, so possibly the issue has been since fixed in Windows.
Would you have isolated repro steps that reproduces the issue for you? Which Windows OS version are you on?
arpit18 commentedon Apr 20, 2023
The isolated repro steps are as follows (also available @ https://github.com/arpit18/emscripten-issue-19207) :
Hello.cppfile that prints the "Hello World" messagebuild.batbatch file that runs the commandemcc Hello.cppbuild_with_quotes.batbatch file that runs the command"emcc" Hello.cpp(with quotes around theemcccommand)Observations
<path-to-emsdk>\python\3.9.2-nuget_64bit\python.exe can't open file '<path-to-build_with_quotes.bat>\emcc.py': [Errno 2] No such file or directoryOS Details
Windows 10 Pro, Version - 21H2, OS Build - 19044.2486
juj commentedon Apr 20, 2023
Thanks, I am now able to reproduce. Posted a minimal bug report to upstream Windows Terminal at microsoft/terminal#15212
juj commentedon Apr 20, 2023
Fix in above PR #19212.
sbc100 commentedon Feb 21, 2026
Fixes (mostly) with #19212.
Add native windows launcher to replace the current `.bat` files. NFC (#…