-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
fix python traceback when gtkdoc needs an exe_wrapper but doesn't have one #9841
Conversation
Reported in IRC by Helmut Grohne. Untested, because I don't have the necessary environment. Maybe we should raise a MesonException here instead? |
Codecov Report
@@ Coverage Diff @@
## master #9841 +/- ##
==========================================
- Coverage 66.51% 66.51% -0.01%
==========================================
Files 402 402
Lines 85698 85700 +2
Branches 18920 18920
==========================================
+ Hits 57000 57001 +1
- Misses 24294 24295 +1
Partials 4404 4404
Continue to review full report at Codecov.
|
Confirmation from IRC that this patch causes the build to complete successfully, gtkdoc and all? Interesting. |
t_args.append('--run=' + ' '.join(state.environment.get_exe_wrapper().get_command())) | ||
# if not need_exe_wrapper, we get an EmptyExternalProgram. If none provided, we get NoneType | ||
exe_wrapper = state.environment.get_exe_wrapper() | ||
if not isinstance(exe_wrapper, (NoneType, EmptyExternalProgram)): |
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.
Couldn't this be if exe_wrapper and exe_wrapper.found():
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.
No it cannot, because an EmptyExternalProgram will exist (not NoneType) and is found, it just evaluates to self.command = []
.
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.
What the heck is an EmptyExternalProgram
and why do we have it? sigh
a5c479c
to
b59045a
Compare
…e one In commit c88bfdb we added support for an exe_wrapper to gtkdoc, which checked twice whether the environment says it is needed, and didn't check at all whether one was provided. The result: File "/usr/lib/python3/dist-packages/mesonbuild/modules/gnome.py", line 1354, in gtkdoc t_args.append('--run=' + ' '.join(state.environment.get_exe_wrapper().get_command())) AttributeError: 'NoneType' object has no attribute 'get_command' Instead, check whether we have a valid exe_wrapper (if we don't need one, then even when one is defined in the cross file, we get an EmptyExternalProgram) and if we do, use it. If we don't have one, but need one, then we revert back to the behavior before commit c88bfdb, which probably means "executing the doc target causes the command to error out with "Exec format error".
b59045a
to
266e8ac
Compare
In commit c88bfdb we added support for an exe_wrapper to gtkdoc, which checked twice whether the environment says it is needed, and didn't check at all whether one was provided.
The result:
Instead, check whether we have a valid exe_wrapper (if we don't need one, then even when one is defined in the cross file, we get an EmptyExternalProgram) and if we do, use it.
If we don't have one, but need one, then we revert back to the behavior before commit c88bfdb, which probably means "executing the doc target causes the command to error out with "Exec format error".