Repository navigation
fix(browser): refuse a harness install that cannot build pillow - #32251
Conversation
UX Review (Opus 5.5) — ⏭️ skippedRevision |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks. The check runs only on Linux with glibc older than 2.27, a refusal can be undone by a revert, and a full toolchain still installs as before. Notes
[DESIGN-REVIEWED] 53867a5 Description read[DESCRIPTION-READ] 2ec28fd4700b666d305104351d8f967a4ab9e5f554f6a523700cdae42d4af0cb That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS The change targets a reported defect (#32241), shows evidence from a real AL2 host, and only refuses where pip would already fail. Nothing blocks. Not checked: that pillow 12.3.0's Notes
What this change shipsInventory (6 items) — 5 justifiedIntent: on an old-glibc Linux host, a failed Browser Harness install names the missing build tools and the command that installs them. FIX.
[FIRST-PRINCIPLES-REVIEWED] 53867a5 Description read[DESCRIPTION-READ] 02a94ff7aa096a57f88d23164a789f1be53dd6626447a9a26fe30a77673c2376 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/browser_harness/install.py:331 -- Preflight rejects reinstalls that can reuse a cached Pillow wheel
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 — LOW. The required conditions: a Linux host with glibc older than 2.27 ( False positive or not applicable? A repository writer can comment: |
On a Linux host with a glibc older than 2.27 (Amazon Linux 2: 2.26), the locked pillow==12.3.0, which browser-harness pins exactly, has no wheel, so pip builds its sdist. Without a C compiler, Python.h, zlib.h or jpeglib.h that build fails, and the install error keeps only pip's tail, "Failed to build pillow", which names no cause. Check for them first, from the filesystem, and refuse at the preparing stage, before the marker or the venv is touched, naming what is missing and the yum or apt-get command that installs it. A venv that already holds the locked pillow is not checked. Closes #32241
d557fc7 to
53867a5
Compare
|
Rebased: main moved in test/test_security_gate_liveness.py budget and the platform ignore list since this head went red (e30915e -> d27a5fd); CI re-running. Also in this head (53867a5):
|
|
KiroCrewCaptain
left a comment
There was a problem hiding this comment.
Approved for the on-call. Review lanes pass on 53867a5, no conflict, no open change request.
On a Linux host with a glibc older than 2.27 (Amazon Linux 2: 2.26), the locked pillow==12.3.0, which browser-harness pins exactly, has no wheel, so pip builds its sdist. Without a C compiler, Python.h, zlib.h or jpeglib.h that build fails, and the install error keeps only pip's tail, "Failed to build pillow", which names no cause. Check for them first, from the filesystem, and refuse at the preparing stage, before the marker or the venv is touched, naming what is missing and the yum or apt-get command that installs it. A venv that already holds the locked pillow is not checked. Closes #32241 (cherry picked from commit d3aff60)
On a Linux host with a glibc older than 2.27 (Amazon Linux 2: 2.26), the locked pillow==12.3.0, which browser-harness pins exactly, has no wheel, so pip builds its sdist. Without a C compiler, Python.h, zlib.h or jpeglib.h that build fails, and the install error keeps only pip's tail, "Failed to build pillow", which names no cause. Check for them first, from the filesystem, and refuse at the preparing stage, before the marker or the venv is touched, naming what is missing and the yum or apt-get command that installs it. A venv that already holds the locked pillow is not checked. Closes #32241 (cherry picked from commit d3aff60)
Problem / Motivation
Goal: On a Linux host too old for the locked pillow's wheels, such as Amazon Linux 2, installing Browser Harness says what is missing and how to install it, instead of failing with no cause.
The Harness install fails at
installing_harnesson Amazon Linux 2 hosts that lack a compiler or the image headers, and the error ends atFailed to build pillow.browser-harness==0.1.13pinspillow==12.3.0exactly, and 12.3.0 publishes Linux wheels for glibc 2.27+ only, so on glibc 2.26 pip compiles the sdist. The install error keeps the tail of pip's output, and the compiler's real message is cut off before it.Why it matters
On such a host the browser stays "not set up on this host" and the only clue is a pip log that names no cause, so the person cannot tell that one
yum installfixes it. Re-pinning pillow is not an option whilebrowser-harnesspins it exactly.Not a goal
What changed (motivation → approach → change)
Before pip runs on a glibc older than 2.27, the install checks for what pillow's build needs and, if anything is missing, refuses at once with the list and the command that installs it:
browser_harness/build_deps.py(new)$CC, the interpreter'sCC, orcc/gcc), the gateway interpreter'sPython.h, andzlib.h/jpeglib.hwherever pillow 12.3.0'ssetup.pylooks for them. With a custom pkg-config search path the headers are left to pip, since the check does not run pkg-config. Names theyumorapt-getpackages for what is missing.browser_harness/install.pypreparing, before the marker is removed or the venv cleared, so a refused reinstall leaves a working install in place. A venv that already holds the locked pillow and is not being rebuilt is not checked: pip has nothing to build.docs/system-specs/modules/browser.mdBackwards compatibility
Compatible: on a host the locked wheels cover nothing changes. On a glibc older than 2.27 the only new outcome is a refusal where pip would have failed anyway, since its build needs exactly what the check looks for.
Removes nothing: a host with the build tools installs as before; the check only names a failure that already happened.
Tests
test/test_browser_harness_build_deps.py(new) pins the check: Amazon Linux 2 with nothing installed lists the compiler,Python.h,zlib.handjpeglib.h; gcc and zlib without libjpeg lacks onlyjpeglib.h; a full toolchain passes; glibc 2.27, 2.28, 2.34 and 3.0, macOS, Windows and musl are never checked, and off Linux the host is not even probed; headers count wherever pillow'ssetup.pyreads them (C_INCLUDE_PATH,CPATH,INCLUDE, a glued-IinCFLAGS/CPPFLAGS/LDFLAGS,ZLIB_ROOT/JPEG_ROOT) and a spaced-I, which pillow ignores, does not; a custom pkg-config path leaves the headers to pip;$CCand the interpreter'sCCcount as the compiler; the refusal names the cause and only the packages for what is missing, usesapt-getwhere there is noyum, offers no package forPython.h; and the floor follows the pillow the lock pins, so a lock bump re-reads its wheel tags.test/test_browser_harness_install.pyadds three install-level tests: a refusal happens before any spawn, a refused rebuild leaves the existing install readable as installed, and a venv that already holds the locked pillow is not checked. An autouse fixture pins the check off so the file does not depend on the host's glibc.$CCchecks, the header check and each of its search sources, the pkg-config escape, ignoring an installed pillow, not raising) each turn these tests red. The two files ran 20/20 at-n0; the-n 4and shuffled runs are left to CI.Proof: not provable -- other: the fix adds build_deps.py, which both test files import, so reverting the production hunks fails at collection; the thirteen mutants above are the substitute
Manual verification
On a DevSpace from the
devspaces-al2image (Amazon Linux 2, glibc 2.26, normal user) that hasgccandzlib.hbut notjpeglib.h, each tree installed and run throughinstall_sync(home):installing_harness; the error ends atFailed to build pillowpreparingwith the message aboveCPATHtest()connects in 0.7 s and opens example.comRelated Issues
Closes #32241
Sibling sweep
Swept: git grep -n -E "require-hashes|requirements.lock" -- 'src/.py'; git ls-files 'src/**/requirements.lock' 'src/**/requirements*.txt'
Sibling: src/kiro_crew/apps/builtins/aws_control/crew/runtime/container/requirements.txt -- not affected -- installed while building that app's own container image, never into a host venv on the operator's glibc
Pattern harvest
Rule candidate: review-prompt
Pattern: an exact pin inherited from a dependency silently raises the minimum glibc, and a failed source build is reported by its log tail, which names no cause
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)