Skip to content

src: avoid aborting on filesystem errors in node --run - #67270

Merged
nodejs-github-bot merged 2 commits into
nodejs:mainfrom
jazelly:fix-67269
Nov 15, 2026
Merged

nodejs-github-bot merged 2 commits into
nodejs:mainfrom
jazelly:fix-67269

Conversation

@jazelly

@jazelly jazelly commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

node --run crashed the process when it runs in a directory deleted.

This PR fixes it by utilizing the error_code from fs methods.

Fixes: #67269

`node --run` called the throwing overloads of
`std::filesystem::is_directory()` and `std::filesystem::current_path()`.
An unreadable `node_modules` directory or a removed working directory
made them throw, and the uncaught exception aborted the process.

Use the `std::error_code` overloads instead. A `node_modules/.bin` that
cannot be inspected is skipped, and a missing working directory is
reported as a regular error.

Signed-off-by: jazelly <xzha4350@gmail.com>
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. labels Nov 5, 2026
@jazelly
jazelly marked this pull request as ready for review November 5, 2026 11:02
@codecov

codecov Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.69%. Comparing base (9365fff) to head (e99672e).
⚠️ Report is 131 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #67270      +/-   ##
==========================================
- Coverage   92.99%   90.69%   -2.31%     
==========================================
  Files         428      797     +369     
  Lines      195754   279594   +83840     
  Branches    30292    53780   +23488     
==========================================
+ Hits       182049   253577   +71528     
- Misses      13378    16312    +2934     
- Partials      327     9705    +9378     
Files with missing lines Coverage Δ
src/node_task_runner.cc 90.15% <100.00%> (ø)

... and 505 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jasnell
jasnell requested a review from anonrig November 5, 2026 23:04
@jazelly jazelly added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 6, 2026
@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 6, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@jazelly jazelly added the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 6, 2026
@jazelly

jazelly commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

Fixed CI by skipping some of the platform. PTAL @anonrig @jasnell

@github-actions github-actions Bot removed the request-ci Add this label to start a Jenkins CI on a PR. Only starts once the PR has an approving review. label Nov 14, 2026
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@jazelly jazelly added commit-queue PRs queued for automated landing through the Commit Queue. commit-queue-squash PRs the Commit Queue should land as one squashed commit. labels Nov 15, 2026
@nodejs-github-bot
nodejs-github-bot merged commit c07db8c into nodejs:main Nov 15, 2026
68 checks passed
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

Landed in c07db8c

@nodejs-github-bot nodejs-github-bot removed the commit-queue PRs queued for automated landing through the Commit Queue. label Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. commit-queue-squash PRs the Commit Queue should land as one squashed commit. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

node --run aborts on filesystem errors

5 participants