Skip to content

ENH: capture and report build errors when rebuilding editable wheels#859

Open
dnicolodi wants to merge 1 commit into
mesonbuild:mainfrom
dnicolodi:editable-verbose-on-error
Open

ENH: capture and report build errors when rebuilding editable wheels#859
dnicolodi wants to merge 1 commit into
mesonbuild:mainfrom
dnicolodi:editable-verbose-on-error

Conversation

@dnicolodi

@dnicolodi dnicolodi commented Jun 28, 2026

Copy link
Copy Markdown
Member

When editable-verbose is not enabled, redirect the build output to a file. When the build fails, parse this file to look for the build error and append it to the ImportError exception message.

Fixes #820.

Replaces #750.

Comment thread mesonpy/_editable.py
Comment thread mesonpy/_editable.py Outdated
@dnicolodi dnicolodi force-pushed the editable-verbose-on-error branch from f5f1066 to 899cb5c Compare June 29, 2026 18:18
@rgommers rgommers added the enhancement New feature or request label Jul 2, 2026

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I like the idea, and the implementation is nice and concise. A few comments around robustness (encoding, ninja errors, etc.)

Comment thread mesonpy/_editable.py Outdated
Comment thread mesonpy/_editable.py
for line in log:
if line.startswith('FAILED: '):
break
error = log.read()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The first line that the break triggers on won't get printed here, right? Would be nice to capture that line as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Leaving it out was a conscious decision. That line reads:

FAILED: [code={exitcode}] {target_name}

and I don't think it adds much information: the exit code is not relevant in the vast majority of the cases, and the target name is more often than not completely opaque to the user.

However, if you insist, I can include this line.

Comment thread mesonpy/_editable.py Outdated
@dnicolodi dnicolodi force-pushed the editable-verbose-on-error branch 4 times, most recently from fa08e0d to b41af25 Compare July 2, 2026 20:56
When editable-verbose is not enabled, redirect the build output to a
file. When the build fails, parse this file to look for the build
error and append it to the ImportError exception message.

Fixes mesonbuild#820.
@dnicolodi dnicolodi force-pushed the editable-verbose-on-error branch from b41af25 to c8de736 Compare July 2, 2026 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recompilation in an editable install hides all compiler output

4 participants