[BUG] Host artifact fixtures emit ignored file-resource warnings #23

Open
opened 2026-09-12 14:28:41 +02:00 by erikinkinen · 0 comments
Owner

Summary

Five dynlink host fixtures leave JSON or TOML input streams unclosed. With
PYTHONWARNINGS=error, Python reports ignored-finalizer ResourceWarnings while
the fixture scripts still exit successfully. Their successful process status
therefore does not establish warning-free validation.

Reproduction

Use the original fixture scripts from Integration
e2b1cf5995bcf6334839cda9a013e90fa97787d5, or
b518b6ad1d2f3e7a36a5d796eaff3103c051bb84, whose five relevant scripts have identical
bytes. Select Rust 1.93.0 with the host and x86_64-unknown-none sysroots and the
LLVM tools required by these existing fixtures. Run from the Integration root:

export RUSTUP_TOOLCHAIN=1.93.0
export PYTHONWARNINGS=error
for fixture in dynlink-service-local-library dynlink-kernel-artifact \
  dynlink-shared-object-pipeline dynlink-artifact-metadata \
  dynlink-prebuilt-consumption; do
  bash "tests/$fixture.sh" || exit "$?"
done

A retained local run exercised all five affected scripts once. There were 16
ResourceWarning diagnostics across their original stream-loading expressions.
The final status was zero. This reproduction used the original test bytes with
the compiler-remap candidate under review; no clean full-image rebuild is claimed.

Expected and actual behavior

Expected: each fixture owns and closes its input streams, with no finalizer
resource diagnostics on successful completion.

Actual: forms such as json.load(open(...)) and tomllib.load(open(...)),
including comprehensions, leave the file object to finalization. Python reports
ResourceWarning: unclosed file and Exception ignored while finalizing file.
The script assertions and outer shell command nevertheless return zero. This is
observed process behavior, not a claim that an older CI run printed the warnings.

Environment and identity

  • Component: Integration, original test revisions listed above; no Cargo pin or
    production Rust changes are needed for the resource-lifetime correction.
  • Profile/artifact: host fixture compilation and metadata validation; no VM,
    firmware, packaged image, signing material or guest authority is involved.
  • Host: x86_64 Linux; Python 3.14.7; rustc 1.93.0,
    254b59607d4417e9dffbc307138ae5c86280fe4c, LLVM 21.1.8; LLVM utilities 22.1.8.
  • Route: caller-selected local tools and temporary fixture inputs, with a
    300-second hard deadline, 60-second output-stall deadline, a 16 MiB captured
    output budget and owned subprocess-group cleanup.
  • Last known warning-free revision for these readers: not established.

Evidence and prior checks

The five original scripts were byte-compared against the selected Git revision
before editing. The original zero-exit output and all 16 ResourceWarnings are
retained separately from corrected validation.

The correction uses ordinary context managers around each affected read and
retains all existing assertions. All five changed scripts then completed with
zero status and no ResourceWarning, ignored-finalizer or traceback diagnostics.
Compiler and linker stderr was retained independently: no successful compile or
link emitted a warning. The warning-denial unit test still requires its intended
compile failure; llvm-nm's message about a non-object lib.rmeta archive member
is a separately classified symbol-inventory diagnostic.

Tracking

Related ongoing build reproducibility work: Integration #22.
Implementation: WIP PR #12; component audit: Integration #11.
The resource-lifetime defect and compiler path-remapping defect have distinct
reproductions and acceptance evidence. No warning suppression or retry is part
of the proposed correction.

The reader-lifetime correction is published at Integration 27ca5c035c569b11cf44260ca7c2fb587082e17e in PR 12. All five changed host fixtures pass without ResourceWarnings or ignored-finalizer diagnostics. Original warning-bearing exit-zero results remain retained; exact-head CI is still pending.

## Summary Five dynlink host fixtures leave JSON or TOML input streams unclosed. With `PYTHONWARNINGS=error`, Python reports ignored-finalizer ResourceWarnings while the fixture scripts still exit successfully. Their successful process status therefore does not establish warning-free validation. ## Reproduction Use the original fixture scripts from Integration `e2b1cf5995bcf6334839cda9a013e90fa97787d5`, or `b518b6ad1d2f3e7a36a5d796eaff3103c051bb84`, whose five relevant scripts have identical bytes. Select Rust 1.93.0 with the host and `x86_64-unknown-none` sysroots and the LLVM tools required by these existing fixtures. Run from the Integration root: ```sh export RUSTUP_TOOLCHAIN=1.93.0 export PYTHONWARNINGS=error for fixture in dynlink-service-local-library dynlink-kernel-artifact \ dynlink-shared-object-pipeline dynlink-artifact-metadata \ dynlink-prebuilt-consumption; do bash "tests/$fixture.sh" || exit "$?" done ``` A retained local run exercised all five affected scripts once. There were 16 ResourceWarning diagnostics across their original stream-loading expressions. The final status was zero. This reproduction used the original test bytes with the compiler-remap candidate under review; no clean full-image rebuild is claimed. ## Expected and actual behavior Expected: each fixture owns and closes its input streams, with no finalizer resource diagnostics on successful completion. Actual: forms such as `json.load(open(...))` and `tomllib.load(open(...))`, including comprehensions, leave the file object to finalization. Python reports `ResourceWarning: unclosed file` and `Exception ignored while finalizing file`. The script assertions and outer shell command nevertheless return zero. This is observed process behavior, not a claim that an older CI run printed the warnings. ## Environment and identity - Component: Integration, original test revisions listed above; no Cargo pin or production Rust changes are needed for the resource-lifetime correction. - Profile/artifact: host fixture compilation and metadata validation; no VM, firmware, packaged image, signing material or guest authority is involved. - Host: x86_64 Linux; Python 3.14.7; rustc 1.93.0, `254b59607d4417e9dffbc307138ae5c86280fe4c`, LLVM 21.1.8; LLVM utilities 22.1.8. - Route: caller-selected local tools and temporary fixture inputs, with a 300-second hard deadline, 60-second output-stall deadline, a 16 MiB captured output budget and owned subprocess-group cleanup. - Last known warning-free revision for these readers: not established. ## Evidence and prior checks The five original scripts were byte-compared against the selected Git revision before editing. The original zero-exit output and all 16 ResourceWarnings are retained separately from corrected validation. The correction uses ordinary context managers around each affected read and retains all existing assertions. All five changed scripts then completed with zero status and no ResourceWarning, ignored-finalizer or traceback diagnostics. Compiler and linker stderr was retained independently: no successful compile or link emitted a warning. The warning-denial unit test still requires its intended compile failure; `llvm-nm`'s message about a non-object `lib.rmeta` archive member is a separately classified symbol-inventory diagnostic. ## Tracking Related ongoing build reproducibility work: [Integration #22](https://git.erikinkinen.fi/erix/integration/issues/22). Implementation: [WIP PR #12](https://git.erikinkinen.fi/erix/integration/pulls/12); component audit: [Integration #11](https://git.erikinkinen.fi/erix/integration/issues/11). The resource-lifetime defect and compiler path-remapping defect have distinct reproductions and acceptance evidence. No warning suppression or retry is part of the proposed correction. The reader-lifetime correction is published at Integration `27ca5c035c569b11cf44260ca7c2fb587082e17e` in [PR 12](https://git.erikinkinen.fi/erix/integration/pulls/12). All five changed host fixtures pass without ResourceWarnings or ignored-finalizer diagnostics. Original warning-bearing exit-zero results remain retained; exact-head CI is still pending.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
erix/integration#23
No description provided.