-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Silence echo in do
command within run_python_compiler.bat
#25416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Silence echo in do
command within run_python_compiler.bat
#25416
Conversation
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
Thanks for the patch, this looks good. Would you be able to create a new unit test in The Windows .bat file stuff is so notoriously brittle due to Microsoft's refusal to maintain and develop it further, so every failure we get from there would definitely warrant to have a test case that will ensure that any refactors to those files will not be able to break any of the known uses. |
:: 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` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also run this script so that emcc.bat
and em++.bat
are regenerated based on it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The emscan-deps.bat
file is actually created from the run_python.bat
file, not the run_python_compiler.bat
file so can you update that too?
If this command echos to stdout does that mean that this is getting echoed for ever If so, I wonder why more windows users have not noticed this? Perhaps the block in question is normally skipped? If so, can we write a test for this that causes the block not to be skipped? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we do already have test that is supposed to catch this. See test_no_extra_output from #20916.
I guess we need to extend that test case so that the block in question here is not skipped. It looks like that maybe mean calling emcc
or em++
in a certain specific way that makes "%~f0" not work. See microsoft/terminal#15212
60de077
to
dfd0682
Compare
I ran the create_entry_points.py script to generate the rest of the files. Working on creating a test to surface this bug. Running the failing command manually, with small edits, produces a valid As to why Windows users seemingly haven't run into issues before, this This issue seems to come from running the scan deps build step with Ninja as it's the only way the erroneous lines are added to the output Command being run manually, TLDR: unwrapped the
vs command run by Ninja:
|
Any thoughts on how to reproduce via test? Seems like we have to trigger the whole build in order to get Ninja to run. |
I'm looking into the test now.. hopefully I can upload this PR with the test failing and you can then fix it your PR: #25435 Or you can just use that as inspriation for a test here. Specifically I don't think you need be running scandeps at all to repro, should be doable with emcc itself. |
Should that be "this do block is not always run"? |
Edit: Yes. This should read, "this do block is not always run" |
But isn't here a |
I'm having trouble reproducing in the form of at test. Can you see what I might be missing here: #25435? Are you able to reproduce locally by running |
Ah.. I verified it with In any case it looks like the test in #25435? can verify this fix. |
See microsoft/terminal#15212 This test exposes a bug, which is fixed in #25416
Ok, my change has landed so you should be able to simply modify |
@sbc100 Made the requested changes. Thanks for the help getting me familiar with Emscripten's tests! |
Looks like there must be another missing @ since the test is still echoing the CWD ( |
Locally, I can't reproduce whatever is happening in the CircleCI build. |
This might be a silly question, but does it look like the |
This just means that llvm and binaryen are coming from tot emsdk. The emscripten directory where all these bat files live is always coming from the git checkout of the PR branch. |
This is a proposed solution to: Issue 25378
The emscan-deps.bat file produces invalid dynamic dependency files, suffix
.ddi
, due to thedo
command being echoed. The output of the scan step is used to create a temporary file that is then renamed into the built .ddi file.Additionally, this merge has a small documentation improvement.
Example of emscripten build generated file:
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 documentThis commit represents one proposed solution
Thank you for providing this awesome tool!