mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-21 21:02:16 -05:00
`make rootfs` unsquashed rootfs.squashfs out of the stock package into
work/rootfs, and a thin container bind-mounted it with PROG_DUMP supplying
/usr/prog from the factory image. Every caller set PRINTER_IMAGE anyway --
both workflows wrote it into test.env BEFORE running `make rootfs`, so CI
unpacked a 93MB package, unsquashed a rootfs and downloaded a 182MB factory
image on every push and read none of it. build-printer-image.sh never used
work/rootfs either: Dockerfile.full does its own extraction from the same
public firmware and needs no stock package at all.
So the fallback went, and PROG_DUMP with it -- it was only ever read when the
replica was built locally, and both implementations already passed it empty
otherwise. Gone: the target, extract-rootfs.py, gates.extract_rootfs and its
two tar helpers, the thin printer/Dockerfile, the `prebuilt` flag threaded
through both Replica implementations, and Replica.start's want_output, whose
only message was that the local build was about to be slow.
PRINTER_IMAGE is pinned to 1.9.7-1.2.9-20260810 rather than :latest. It is
now the entire substrate the brick-safety gates run on and the only input
nothing checksums, so a floating tag would let it change under a green suite
-- the drift the sha256 pins in both workflows exist to prevent.
THREE THINGS THAT COULD NOT HAVE PASSED, found while doing it:
* Neither workflow built the feed. bin/patch.sh has refused to start
without one since a1b4ea6, 45 commits after ci.yml was last touched.
Both ran unpack/patch/pack straight into that guard.
* `make release` ran bin/build.sh on $(RUN), which has no docker socket,
while patch.sh assembles the payload inside the replica. `build` has
used RUNBUILD all along; `release` was left behind. It also built no
feed. It now builds one, once, outside the per-model loop -- nothing in
it is model-specific.
* ci.yml's shellcheck gate named pkgs/*/payload/init.d/S* and
pkgs/*/prog/*.sh, neither of which exists any more; shellcheck exits 2
on a path it cannot open. It is a `find` with an asserted count now,
because the opposite failure is worse: a glob that quietly matches
nothing checks nothing and still reports green.
Both workflows now go through `make` instead of hand-rolling `docker run`.
Hand-rolling meant CI exercised entry points no human uses, which is exactly
why the `release` runner bug could sit there unseen; it also ran as root and
left a work/ that the later `make release` could not write to.
ci.yml's test job builds the feed before the static lane. A good part of that
lane asks what is inside an .ipk and those questions do not fail without one
-- they return, and the lane reports a pass having never opened a package.
build-packages.sh needs no stock firmware, which is what makes that possible.
Docs, and the packages skill, which still documented pkg_buildopkg and
work/.opkg-host as how the payload is assembled -- the host opkg went in
dcd037c and the printer's own installs the feed now -- and still claimed
qa/static holds an ABI gate over every ELF in every package. It does not:
qa/replica/test_abi.py is the only one, and qa/static asserts a seventh does
not grow back.
Verified: qa/static is 122 passed / 110 errors here, identical to master --
every error is `vendor/opkg-utils is missing` in a checkout that has not run
`make vendor`. mkdocs build --strict passes. The new shellcheck gate was run
as written. The workflows themselves were not executed.
tools/replica/printer/*.sh live inside the published image, so those edits
take effect on the next `make printer-image`; behaviour is unchanged either
way, because nothing sets PROG_DUMP any more.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TrhjKabxDihvVjNQGGT4MK
50 lines
1.8 KiB
Python
50 lines
1.8 KiB
Python
"""Running one gate on its own, from the command line.
|
|
|
|
`make boot-screen-sim` lands here -- it is the only caller left. The qa suite
|
|
does not:
|
|
pytest
|
|
imports the gate functions and calls them, so nothing between a gate and the
|
|
thing counting results has to agree on a text format.
|
|
|
|
Which is why the "SKIP:" printed below is now only a message to a person. It
|
|
used to be a protocol -- run-tests.sh decided a gate had been skipped by
|
|
grepping its child's stdout for that string, so a launcher that printed it
|
|
after already failing was counted as cleanly skipped. Nothing parses it any
|
|
more. If you find yourself writing a grep for it, that is the bug coming back.
|
|
"""
|
|
import os
|
|
import sys
|
|
import traceback
|
|
|
|
from . import Fail, Skip
|
|
|
|
|
|
def main(fn):
|
|
"""Run fn(), map its outcome to an exit code, and say what happened.
|
|
|
|
A skip exits 0: not being able to run a gate on this machine is a normal
|
|
state for a laptop without docker or without the proprietary firmware.
|
|
REQUIRE_PRINTER_SIM=1 makes it an error instead, which is what a release
|
|
wants -- a package that shipped without the replica gates running has not
|
|
been tested for the thing that matters.
|
|
"""
|
|
try:
|
|
fn()
|
|
except Skip as exc:
|
|
if os.environ.get("REQUIRE_PRINTER_SIM") == "1":
|
|
sys.stderr.write(" FAIL: %s (REQUIRE_PRINTER_SIM=1)\n" % exc)
|
|
return 1
|
|
sys.stdout.write(" SKIP: %s\n" % exc)
|
|
return 0
|
|
except Fail as exc:
|
|
sys.stderr.write(" FAIL: %s\n" % exc)
|
|
return 1
|
|
except Exception:
|
|
# A broken harness, not a failed test. The traceback is the point:
|
|
# guessing from a one-line message is how a working launcher gets
|
|
# rewritten by mistake.
|
|
sys.stderr.write(" FAIL: the harness itself broke\n")
|
|
traceback.print_exc()
|
|
return 1
|
|
return 0
|