Skip to content

Fix tools/emcoverage.py - #27869

Merged
sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:fix-emcoverage
Oct 5, 2026
Merged

sbc100 merged 1 commit into
emscripten-core:mainfrom
sbc100:fix-emcoverage

Conversation

@sbc100

@sbc100 sbc100 commented Oct 5, 2026 •

Copy link
Copy Markdown
Collaborator
  1. In tools/emcoverage.py, strip -E passed by compiler entry point scripts, and resolve commands to root .py files.
  2. In tools/config.py, normalize EMSDK_PYTHON with os.path.abspath() instead of sys.executable, which prevented child processes from executing under custom wrappers.
  3. In tools/emcoverage.py, pass ignore_errors=True to rmtree during reset.

@sbc100 sbc100 changed the title Fix tools/emcoverage.py and EMSDK_PYTHON normalization Fix tools/emcoverage.py Oct 5, 2026
@sbc100
sbc100 requested review from dschuff and kripken October 5, 2026 01:14
Comment thread tools/config.py
# Python interpreter as the parent.
if os.environ.get('EMSDK_PYTHON'):
os.environ['EMSDK_PYTHON'] = sys.executable
os.environ['EMSDK_PYTHON'] = os.path.abspath(os.environ['EMSDK_PYTHON'])

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment looks stale. Please explain why we need to abspath here.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment is still mostly correct. I updated it to be more clear. Does it make sense now?

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm otherwise

Resolve the minimal set of issues that prevented `tools/emcoverage.py`
from collecting coverage:

1. In `tools/emcoverage.py`, strip `-E` passed by compiler entry point
   scripts, and resolve commands to root `.py` files.
2. In `tools/config.py`, normalize `EMSDK_PYTHON` with `os.path.abspath()`
   instead of `sys.executable`, which prevented child processes from
   executing under custom wrappers.
3. In `tools/emcoverage.py`, pass `ignore_errors=True` to `rmtree` during
   reset.
@sbc100
sbc100 merged commit c5b9b37 into emscripten-core:main Oct 5, 2026
46 of 47 checks passed
@sbc100
sbc100 deleted the fix-emcoverage branch October 5, 2026 22:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants