Skip to content
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

Misc fixes #13017

Merged
merged 4 commits into from
Apr 15, 2024
Merged

Misc fixes #13017

merged 4 commits into from
Apr 15, 2024

Conversation

eli-schwartz
Copy link
Member

  • micro-optimize iteration of evaluated set
  • compilers: fix crash when compiler check returns None output
  • allow any alternative python freeze tool to work with meson
  • tests: fix missing dependency causing flaky build failure

Fixes #12979

@eli-schwartz eli-schwartz requested a review from jpakkane as a code owner March 29, 2024 03:53
if o:
mlog.debug(f'stdout:\n{o.strip()}\n-----------')
if e:
mlog.debug(f'stderr:\n{e.strip()}\n-----------')
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it matters, but this is a slight behavior change: before there would be no debug message for stdout or stderr being only whitespace. Now the stdout: and stderr: headers are printed anyway.

Copy link
Member Author

Choose a reason for hiding this comment

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

Now that I think about it, I believe that was actually my original reason for writing the original version the way I did. Drat.

Copy link
Contributor

@tristan957 tristan957 left a comment

Choose a reason for hiding this comment

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

Everything but the commit that was called out earlier looks good to me! Cherry-pick as you wish

It is generally accepted practice to convert dict.keys() to a list
before iterating over it and e.g. deleting values, as keys returns a
live-action view. In this case, we use the difference of *two* dict
keys, which returns a regular non-view set and doesn't need protecting.

Iteration order doesn't matter (the set already randomizes it anyway).
Avoid the cost of converting to a list.
Popen_safe_logged has a small inefficiency. It evaluates the stripped
version of stdout/stderr before checking if it exists, for logging
purposes. This would sometimes crash, if it was None instead of ''.

Fixes mesonbuild#12979
Any code that needs to know mesonlib.python_command currently assumes
the PyInstaller bundle reference is added to the sys module, which means
that it assumes the only freeze tool used is PyInstaller. Really, all we
need to check is sys.frozen as it's never normally set, but always set
for a freeze. We don't care if it was PyInstaller specifically, and we
don't need its bundle directory.

See mesonbuild#13007
We have two copies of other.h, one of which is generated. If we don't
include the include/ directory then building fails unless the
custom_target which copies it over, happens to run early enough. On
parallel builds this may fall on its face.
Copy link
Contributor

@tristan957 tristan957 left a comment

Choose a reason for hiding this comment

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

Thanks for cleaning it up!

@eli-schwartz eli-schwartz merged commit 1baabbc into mesonbuild:master Apr 15, 2024
33 checks passed
@eli-schwartz eli-schwartz deleted the misc-fixes branch April 15, 2024 23:21
@eli-schwartz eli-schwartz added this to the 1.4.1 milestone May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unhandled python exception when installing numpy with pypy on Windows
3 participants