From dfd0682062eec4818c39160675dac26d7c0d3c51 Mon Sep 17 00:00:00 2001 From: Marcos Alejandro Sandoval Date: Mon, 29 Sep 2025 09:42:02 -0500 Subject: [PATCH 1/5] Silence echo in `do` command within run_python_compiler.bat The emscan-deps.bat file produces invalid dynamic dependency files, suffix `.ddi`, due to the `do` command being echoed. The output of the scan step is used to create a temporary file that then is renamed into the built .ddi file. Example of emscripten build generated file: ``` D:\emscriptenDebug\out>() { "revision": 0, "rules": [ { "primary-output": "CMakeFiles\\demoApp.dir\\demoApp.cpp.o" } ], "version": 1 } ``` This file should be a validly formed JSON document, instead we have a blank line and a line produced by the `do` command preceding the JSON document This commit represents one proposed solution --- tools/maint/run_python_compiler.bat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/maint/run_python_compiler.bat b/tools/maint/run_python_compiler.bat index 7b690151414fc..2c771aee30a15 100644 --- a/tools/maint/run_python_compiler.bat +++ b/tools/maint/run_python_compiler.bat @@ -2,8 +2,8 @@ :: :: Automatically generated by `create_entry_points.py`; DO NOT EDIT. :: -:: To make modifications to this file, edit `tools/run_python_compiler.bat` and -:: then run `tools/create_entry_points.py` +:: To make modifications to this file, edit `tools/maint/run_python_compiler.bat` and +:: then run `tools/maint/create_entry_points.py` :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, :: or there will be a parsing error. @@ -26,7 +26,7 @@ set "MYDIR=%~dp0" goto FOUND_MYDIR ) -@for %%I in (%~n0.bat) do ( +@for %%I in (%~n0.bat) do @( @if exist %%~$PATH:I ( set MYDIR=%%~dp$PATH:I ) else ( From 0a6aedd9c3b68f3152456ebd1a9967a8f9013217 Mon Sep 17 00:00:00 2001 From: Marcos Alejandro Sandoval Date: Tue, 30 Sep 2025 12:46:03 -0500 Subject: [PATCH 2/5] Ran create_entry_points.py --- bootstrap.bat | 4 ++-- em++.bat | 6 +++--- emcc.bat | 6 +++--- test/runner.bat | 4 ++-- tools/maint/run_python.bat | 4 ++-- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bootstrap.bat b/bootstrap.bat index e8840745a6d33..7ec6c608da9c8 100644 --- a/bootstrap.bat +++ b/bootstrap.bat @@ -2,7 +2,7 @@ :: :: Automatically generated by `create_entry_points.py`; DO NOT EDIT. :: -:: To make modifications to this file, edit `tools/run_python.bat` and then run +:: To make modifications to this file, edit `tools/maint/run_python.bat` and then run :: `tools/maint/create_entry_points.py` :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, @@ -26,7 +26,7 @@ set "MYDIR=%~dp0" goto FOUND_MYDIR ) -@for %%I in (%~n0.bat) do ( +@for %%I in (%~n0.bat) do @( @if exist %%~$PATH:I ( set MYDIR=%%~dp$PATH:I ) else ( diff --git a/em++.bat b/em++.bat index 7b690151414fc..2c771aee30a15 100644 --- a/em++.bat +++ b/em++.bat @@ -2,8 +2,8 @@ :: :: Automatically generated by `create_entry_points.py`; DO NOT EDIT. :: -:: To make modifications to this file, edit `tools/run_python_compiler.bat` and -:: then run `tools/create_entry_points.py` +:: To make modifications to this file, edit `tools/maint/run_python_compiler.bat` and +:: then run `tools/maint/create_entry_points.py` :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, :: or there will be a parsing error. @@ -26,7 +26,7 @@ set "MYDIR=%~dp0" goto FOUND_MYDIR ) -@for %%I in (%~n0.bat) do ( +@for %%I in (%~n0.bat) do @( @if exist %%~$PATH:I ( set MYDIR=%%~dp$PATH:I ) else ( diff --git a/emcc.bat b/emcc.bat index 7b690151414fc..2c771aee30a15 100644 --- a/emcc.bat +++ b/emcc.bat @@ -2,8 +2,8 @@ :: :: Automatically generated by `create_entry_points.py`; DO NOT EDIT. :: -:: To make modifications to this file, edit `tools/run_python_compiler.bat` and -:: then run `tools/create_entry_points.py` +:: To make modifications to this file, edit `tools/maint/run_python_compiler.bat` and +:: then run `tools/maint/create_entry_points.py` :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, :: or there will be a parsing error. @@ -26,7 +26,7 @@ set "MYDIR=%~dp0" goto FOUND_MYDIR ) -@for %%I in (%~n0.bat) do ( +@for %%I in (%~n0.bat) do @( @if exist %%~$PATH:I ( set MYDIR=%%~dp$PATH:I ) else ( diff --git a/test/runner.bat b/test/runner.bat index e8840745a6d33..7ec6c608da9c8 100644 --- a/test/runner.bat +++ b/test/runner.bat @@ -2,7 +2,7 @@ :: :: Automatically generated by `create_entry_points.py`; DO NOT EDIT. :: -:: To make modifications to this file, edit `tools/run_python.bat` and then run +:: To make modifications to this file, edit `tools/maint/run_python.bat` and then run :: `tools/maint/create_entry_points.py` :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, @@ -26,7 +26,7 @@ set "MYDIR=%~dp0" goto FOUND_MYDIR ) -@for %%I in (%~n0.bat) do ( +@for %%I in (%~n0.bat) do @( @if exist %%~$PATH:I ( set MYDIR=%%~dp$PATH:I ) else ( diff --git a/tools/maint/run_python.bat b/tools/maint/run_python.bat index e8840745a6d33..7ec6c608da9c8 100644 --- a/tools/maint/run_python.bat +++ b/tools/maint/run_python.bat @@ -2,7 +2,7 @@ :: :: Automatically generated by `create_entry_points.py`; DO NOT EDIT. :: -:: To make modifications to this file, edit `tools/run_python.bat` and then run +:: To make modifications to this file, edit `tools/maint/run_python.bat` and then run :: `tools/maint/create_entry_points.py` :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, @@ -26,7 +26,7 @@ set "MYDIR=%~dp0" goto FOUND_MYDIR ) -@for %%I in (%~n0.bat) do ( +@for %%I in (%~n0.bat) do @( @if exist %%~$PATH:I ( set MYDIR=%%~dp$PATH:I ) else ( From e953bf02754a3ee5e2d19207d10701826b2366c7 Mon Sep 17 00:00:00 2001 From: Marcos Alejandro Sandoval Date: Wed, 1 Oct 2025 08:58:52 -0500 Subject: [PATCH 3/5] Enable checking Windows shell command with quotes produces no extra output --- test/test_other.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/test/test_other.py b/test/test_other.py index 5a510607b098a..71aac29aff83d 100644 --- a/test/test_other.py +++ b/test/test_other.py @@ -15102,11 +15102,7 @@ def test_shell_cmd_with_quotes(self): print('running cmd:', cmd) with env_modify({'PATH': new_path}): proc = subprocess.run(cmd, capture_output=True, text=True, shell=True, check=True) - # There is currently a bug in the windows .bat files that leads to stdout - # not being empty in this case. - # See https://github.com/emscripten-core/emscripten/pull/25416 - if not WINDOWS: - self.assertEqual(proc.stdout, '') + self.assertEqual(proc.stdout, '') self.assertEqual(proc.stderr, '') def test_browser_too_old(self): From b6c478c8bd35ed9015a5019aad7c93aad0d61e82 Mon Sep 17 00:00:00 2001 From: Marcos Alejandro Sandoval Date: Wed, 1 Oct 2025 19:05:29 -0500 Subject: [PATCH 4/5] turn off command echoing --- emcc.bat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/emcc.bat b/emcc.bat index 2c771aee30a15..518520f2f9b1f 100644 --- a/emcc.bat +++ b/emcc.bat @@ -8,6 +8,8 @@ :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, :: or there will be a parsing error. +@echo off + :: All env. vars specified in this file are to be local only to this script. @setlocal :: -E will not ignore _PYTHON_SYSCONFIGDATA_NAME an internal From 05e186266291d54c4c4844cbb15a607fdf48957a Mon Sep 17 00:00:00 2001 From: Marcos Alejandro Sandoval Date: Thu, 2 Oct 2025 11:10:53 -0500 Subject: [PATCH 5/5] undo command echo silencing as it was just a test --- emcc.bat | 2 -- 1 file changed, 2 deletions(-) diff --git a/emcc.bat b/emcc.bat index 518520f2f9b1f..2c771aee30a15 100644 --- a/emcc.bat +++ b/emcc.bat @@ -8,8 +8,6 @@ :: N.b. In Windows .bat scripts, the ':' character cannot appear inside any if () blocks, :: or there will be a parsing error. -@echo off - :: All env. vars specified in this file are to be local only to this script. @setlocal :: -E will not ignore _PYTHON_SYSCONFIGDATA_NAME an internal