-
Notifications
You must be signed in to change notification settings - Fork 76
Print meson output in case of error during editable rebuild #750
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?
Conversation
The traceback reported in the PR description is not the one that is emitted upon rebuild failure of an editable package, the patch comes without a test, the patch has obviously not been tested to verify that it does what it is being claimed it does, and the CI failure has not been addressed. I'm very tempted to simply close this. |
I'm pretty sure that I got this error while there was a problem with the meson files and I've used a preliminary version of this patch to figure out what the problem was.
Seems like there are no tests that cover this exception, otherwise I would have changed them to the new output.
Done now. |
I'm sure that this patch does not work. In all possible code paths, the
meson-python/tests/test_editable.py Lines 317 to 346 in 352ded1
|
Indeed. I did a very quick check. Default build (no verbose otuput turned on) with
With this PR:
After uninstall,
@tobiasdiez were you looking for |
I've now found the time to properly check-out the code and run the tests. The manylinux tests fail - apparently because the wrong code in the meson file is not triggering an exception?! For me the tests pass locally. Any idea what's wrong? |
This now does show the traceback in non-verbose mode, which is an improvement, however it is swallowing the output in verbose mode (
Output under
Likely related to the "did not raise" error in CI. |
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.
I am not convinced that the functionality you are adding is useful: if you want to see the compilation errors, simply enable verbose editable mode. Anyhow, the patch is still broken. Please take some time to understand what the existing code does before trying to modify it.
stderr=subprocess.STDOUT, | ||
env=env, | ||
check=True, | ||
) |
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.
This now hides output that was directed to standard output before.
stdout=subprocess.PIPE, | ||
stderr=subprocess.STDOUT, | ||
check=True, | ||
) |
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 compilation output can be very long. Buffering it all in memory does not seems a very good idea to me.
|
||
|
||
@pytest.mark.parametrize('verbose', [False, True], ids=('', 'verbose')) | ||
def test_editable_meson_file_rebuild_error(package_purelib_and_platlib, tmp_path, verbose): |
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.
Why are you adding this test? Why do you expect that a failure in running meson produces a different outcome that a failure in running a compilation tool?
It is useful, I have had this need several times before. Just an "editable build failed" message isn't very helpful, locally it requires an extra full rebuild after toggling the verbosity setting (which is both slow and non-obvious to the average user), and in CI it's even worse to deal with this. Assuming that this PR is updated to not negatively affect anything else (like how verbose mode behaves), we should merge it. |
In case there is an error during the call of meson build, it currently only prints
in the console. This is not very helpful to diagonize the problem. With this PR, the full output of meson is printed.