Skip to content

Conversation

@mhsmith
Copy link
Member

@mhsmith mhsmith commented Dec 18, 2025

Fixes for several issues found while building NumPy and related packages:

  • Gradle automatically decompresses assets whose filenames end with ".gz", which broke some packages' tests.

    • Worked around by escaping these filenames.
  • The stdout/stderr logging couldn't distinguish between log messages which were triggered by a newline, and those triggered by a manual call to flush. This particularly affected pytest's "one dot per test" progress indicator, which was printing every dot on a separate line.

    • I didn't end up needing the "trailing space" idea I mentioned the other day, because it turns out the newline information was already in the log, it just wasn't visible via the logcat tool in --format tag mode. Fixed by switching to --binary mode.
    • The logcat tool on API level 33 buffers its output incorrectly in --binary mode, causing lines to be delayed or lost. Fixed by reducing the tesbed to API level 32.

@mhsmith
Copy link
Member Author

mhsmith commented Feb 2, 2026

!buildbot android

@bedevere-bot

This comment was marked as outdated.

@mhsmith
Copy link
Member Author

mhsmith commented Feb 2, 2026

!buildbot aarch64 android

@bedevere-bot

This comment was marked as outdated.

@mhsmith
Copy link
Member Author

mhsmith commented Feb 2, 2026

!buildbot android

@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @mhsmith for commit 29ec458 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F142912%2Fmerge

The command will test the builders whose names match following regular expression: android

The builders matched are:

  • aarch64 Android PR
  • AMD64 Android PR

@mhsmith mhsmith marked this pull request as ready for review February 2, 2026 21:59
@mhsmith mhsmith requested a review from freakboy3742 as a code owner February 2, 2026 21:59
@mhsmith
Copy link
Member Author

mhsmith commented Feb 2, 2026

@freakboy3742: I didn't manage to complete the emulator RAM size fix today, so let's merge this PR without it. So far RAM size has only been a blocker for Pandas, and that's unlikely to be ready to release within the next two months anyway, given how many other things have to be released first.

GitHub Actions is broken at the moment; please rerun CI once that's resolved.

Copy link
Contributor

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

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

The buildbot and CI runs suggest this change works; but I want to make sure I follow how these changes avoid the "pytest progress" issue.

I can see this moves to a "raw binary" mode of reading the ADB log, which means we get the raw messages being posted rather than the logged output.

That then means that we're reading "raw" log output at the level of individual messages, rather than log output that is buffered by newline/flush elements; so when we're streaming log output, we have visibility on the newlines that have been printed to stdout/err, rather than that content being part of the buffering process.

The "leading space" trick is needed to preserve newlines that would otherwise been trimmed from the log by an internal logcat mechanism. AFAICT, this does mean that successive writes of hello and \nworld would result in a space at the end of the "hello" as printed to the screen - but that's visually inert unless you're really unlucky and trigger size of screen line wrapping, so it's worth living with.

It also means that anyone monitoring the "text mode" ADB stream will still get "one dot per line" output for pytest suites etc (e.g., Briefcase's Android runner logs); but the same "binary mode" logger could be used there as well.

Have I understood what is going on here?

Assuming I have - on a meta level, I think this is a big enough change that it needs a ticket and NEWS entry - if only to provide tracking for the backports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants