This is an archive of the discontinued LLVM Phabricator instance.

[extract_symbols.py] Fix line-splitting of tool output.
ClosedPublic

Authored by simon_tatham on Jan 11 2022, 8:27 AM.

Details

Summary

Two functions in the is_32bit_windows family were retrieving the
output of a tool via subprocess.check_output, and then iterating
over it using for line in output. But in Python, that gets you the
output one character at a time, not a line at a time. So the
regexes that looked for a platform name were never matching.

(This is a mistake that Python makes uniquely easy, because iterating
over a file and over a string have different default behaviour, and
because the element type of a string is still a string so you don't
even get a type mismatch error to warn you about it!)

Diff Detail

Event Timeline

simon_tatham requested review of this revision.Jan 11 2022, 8:27 AM
simon_tatham created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptJan 11 2022, 8:27 AM
michaelplatings accepted this revision.Jan 11 2022, 10:34 AM
michaelplatings added a subscriber: michaelplatings.

LGTM.

Tangent: extract_symbols.py is sorely in need of automated tests.

This revision is now accepted and ready to land.Jan 11 2022, 10:34 AM
This revision was landed with ongoing or failed builds.Jan 12 2022, 1:08 AM
This revision was automatically updated to reflect the committed changes.