mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-21 21:02:16 -05:00
apk decides whether to upgrade from the version string alone. Three recipes
pin an upstream version -- anvil-moonraker on ${MOONRAKER_VERSION#v},
anvil-klipper on the pinned commit, anvil-helixscreen on its tag -- and each
ships a payload/ of ours beside that upstream tree. Our half changes without
the string moving, so the feed serves new bytes under the name every printer
already holds and `apk upgrade` finds nothing to do. #16 did exactly that to
moonraker.conf, the file that moves Moonraker's config to
/usr/data/anvil-data/config.
PKG_RELEASE is that string's other half, and it is the release date now:
pkg_release_stamp, monotone, with the same-day letter as a trailing digit so
20260827b sorts between 20260827 and 20260828. Nobody has to notice that a
payload changed, which is the only version of this that holds.
PKG_STAMP_EXTRA="$(pkg_payload_hash)" is not this and reads as though it were.
It hashes payload/ so the BUILD rebuilds; it says nothing to a printer. All
three recipes had it, and all three would have shipped stale.
test_recipe_layout.py makes it the rule for recipes added later: a pinned
recipe with a payload/ must take pkg_release_stamp, and the failure names the
recipe and the line to write.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
75 lines
4.0 KiB
Plaintext
75 lines
4.0 KiB
Plaintext
# anvil-klipper -- the Klipper4FlashForge fork: the whole klippy tree, and
|
|
# c_helper.so cross-compiled from the chelper sources shipped beside it.
|
|
#
|
|
# ARCHITECTURE IS THE DEFAULT, mipsel_xburst2, and that is not a formality:
|
|
# c_helper.so is the only ELF in the tree and the kernel refuses anything that
|
|
# is not o32/nan2008/mips32r2. An `all` here would let this install on a
|
|
# machine whose kernel cannot exec the one file that matters.
|
|
PKG_NAME=anvil-klipper
|
|
|
|
# THE PIN IS A COMMIT, composed as pkgs/moonraker composes its own: the
|
|
# release this fork descends from, then the short sha. The fork carries no
|
|
# version of its own, so 0.13.0~<sha> is what a package manager can order and
|
|
# a bare 40-character sha is not.
|
|
#
|
|
# `~<hash>`, NOT `+git<hash>`. The `+` spelling is the natural one, and apk
|
|
# does not have it: the grammar
|
|
# (number{.number}{letter}{_suffix}{~hash}{-r#}) has no `+`, and `~` is the
|
|
# slot made for exactly this. pkg_version_ok in pkgs/lib.sh is what keeps it
|
|
# that way -- `+git` parsed fine under the old packager for a year, which is
|
|
# why nothing noticed until the format changed.
|
|
PKG_VERSION="0.13.0~$(printf '%.8s' "$KLIPPER_VERSION")"
|
|
# THE REVISION IS THE RELEASE DATE, because the version above is a pin and does
|
|
# not move when our half of this package changes. apk upgrades on the version
|
|
# string alone, so a hand-maintained number here is one somebody has to
|
|
# remember; pkg_release_stamp is the release, and every printer on an earlier
|
|
# one sees a higher -r. qa/static/test_recipe_layout.py holds recipes with a
|
|
# payload/ to this.
|
|
PKG_RELEASE="$(pkg_release_stamp)"
|
|
PKG_EXCLUDE=".version"
|
|
|
|
# THE INTERPRETER IS A DEPENDS: etc/s6-rc/source/klipper/run execs $FF_PYTHON
|
|
# against $MODDIR/klipper/klippy, so klippy is on our CPython 3.13 and the
|
|
# tree it runs is the one THIS package installs.
|
|
#
|
|
# THE LIST IS scripts/klippy-requirements.txt MINUS WHAT IS NOT REACHABLE
|
|
# HERE. python-can is not packaged (no CAN transport on this machine) and it
|
|
# is import-guarded, so its absence costs nothing.
|
|
#
|
|
# NUMPY IS NOT IN THAT CLASS, and it is the one Depends here whose absence is
|
|
# not a missing feature but a dead printer. extras/stepper_resonance_tester.py
|
|
# opens with a bare `import numpy as np`, and klippy.py:122 walks every config
|
|
# section through a load_object that does not catch ImportError -- so with
|
|
# printer.base.cfg including FlashForge's printer.vibration.cfg
|
|
# ([stepper_resonance_tester]), a numpy-less install is a klippy that never
|
|
# reaches ready. Read the rest of this list as "klippy imports it"; read this
|
|
# one as "klippy does not start". docs/notes/44-vfa-calibration.md has the
|
|
# chain.
|
|
#
|
|
# markupsafe and setuptools are not named
|
|
# because anvil-python-jinja2 declares the first and nothing needs the second.
|
|
#
|
|
# WHAT THIS FIXES: cffi and greenlet were installed by a hardcoded list in
|
|
# bin/payload.sh, so every build had them and no `apk add anvil-klipper`
|
|
# did. pyserial and jinja2 were worse -- they arrived only as
|
|
# anvil-moonraker's Depends, so a BUILD_MOONRAKER=0 build shipped a klippy
|
|
# that imports serialhdl and dies the first time it opens an MCU.
|
|
#
|
|
# anvil-klipper-config is not optional either: printer.base.cfg is what
|
|
# printer.cfg includes and every other config hangs off it.
|
|
PKG_DEPENDS="anvil-klipper-config, anvil-python, anvil-python-cffi,
|
|
anvil-python-greenlet, anvil-python-pyserial,
|
|
anvil-python-jinja2, anvil-python-numpy"
|
|
PKG_BUILD_DEPENDS=""
|
|
|
|
# NO PKG_WHEN. The fork is the only Klipper, and nothing here is optional --
|
|
# the toolchanger extras this package carries and the ff-*.cfg that declare
|
|
# them are written against v0.13.
|
|
|
|
# KLIPPER_VERSION says nothing about payload/, which is five toolchanger
|
|
# extras -- so without this an edit to ff_toolchange.py reads as "already
|
|
# current" and the printer gets the previous release's.
|
|
PKG_STAMP_EXTRA="$(pkg_payload_hash)"
|
|
|
|
PKG_DESCRIPTION="The Klipper4FlashForge fork of Klipper (v0.13 generation), with c_helper.so cross-compiled from the chelper sources it ships with."
|