Skip to content

Failed mkc/npm commands hide their output, even with --debug #15

Closed

Description

@UnsignedArduino

When a command run through run_cmd fails, its stdout and stderr are stored in BuildError.output, but the exception message is only <command> failed (<code>) in <cwd>. Nothing logs .output, and neither redun's traceback nor main() prints it. Successful output isn't logged either, even with --debug.

Relevant code: utils/run.py, lines 12–22 and lines 52–56.

As a result, a game's compile errors and any npm ci/npm run build failure can't be diagnosed from the tool's output.

Reproduction in an isolated MKCD2APP_HOME:

  1. Install a fake mkc in the toolchain's js_tools/node_modules/.bin that prints main.ts(3,1): error TS2304: Cannot find name 'spritez'. UNIQUE_MARKER_123 to stderr and exits 1, and put a placeholder ---simulator.html in the target dir.
  2. Run mkcd2app build on a path source config, then run it again with --debug.
  3. Both exit 1 with BuildError: ['mkc', 'build', '-j'] failed (1) in .../g-binary-js-build. UNIQUE_MARKER_123 appears in neither stdout nor stderr.

Real-world case: with the real toolchain, mkcd2app target install 4.0.999 fails with only BuildError: ['mkc', 'build', '-j'] failed (1) in /tmp/tmp8a_mvs_t. That temporary directory has already been deleted, so there's nothing left to inspect.

The tests check exc.value.output (test_build_wiring.py, lines 199–201) but not what the user sees.

Related gaps in the same function: output isn't streamed, so a long npm ci shows no progress, and there's no timeout.

Expected behavior: a failed command's output (or at least its tail) is shown to the user, in the exception message or logged at error level, and the full output is available with --debug.

Found while reviewing PR #7, toolchain at ce12c48.

Activity

  1. changed the title [-][P1] Failed mkc/npm commands hide their output, even with --debug[/-] [+]Failed mkc/npm commands hide their output, even with --debug[/+] on Nov 4, 2026
  2. added
    found by claudeIssue was originally found by Claude Code. Only used for tracking.
    and removed on Nov 4, 2026
  3. UnsignedArduino commented on Nov 4, 2026

    @UnsignedArduino
    OwnerAuthor

    this and #18 repos with this:

    from mkcd2app.utils.run import run_cmd
    from pathlib import Path
    c = Path.cwd()
    run_cmd(["python", "-c", "print(\"😀\")"], c)
    run_cmd(["python", "-c", "raise Exception"], c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugSomething isn't workingfound by claudeIssue was originally found by Claude Code. Only used for tracking.p1

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions