mirror of
https://github.com/Klipper4FlashForge/firmware.git
synced 2026-10-21 12:52:16 -05:00
Four sections went. Three of them were checks: _sqlite3 by name, which pkgs/3rdparty/python/build.sh already made; libsodium's symlink, which pkgs/3rdparty/libsodium/build.sh already made; and an ABI walk of the whole payload, which bin/build-packages.sh makes over every PKG_ROOT on the way into every .ipk -- from the packaging loop rather than a build.sh, so cached trees are re-read too. The fourth was not a check. config.env's BUSYBOX_BIN was copied into the payload here, which made it the one file no package owned: an allowance in the "every file is owned" test, an ABI gate of its own because the payload-wide one ran before the copy, and a file no `opkg remove` could take away. It is pkgs/3rdparty/busybox now, PKG_WHEN-gated on BUSYBOX_BIN, and it needed a third source verb -- pkg_prebuilt, beside pkg_unpack and pkg_intree -- because a recipe names its source exactly once and this one's source is a path someone typed. Once it was a package, nothing in the payload came from outside the feed, which is what made the payload-wide ABI gate redundant rather than merely duplicated. The "at least twelve extension modules in site-packages" count was the one check with nowhere to go and no duplicate. It is pkg_pynative in the seven python-* recipes that ship a .so: an aggregate could say that a native package had fallen back to a pure-python wheel but never which one, and each of those recipes can say it about itself. What that costs is written into the section it left: a gate inside build.sh does not run on a cache hit, and no python recipe sets PKG_STAMP_EXTRA. That is pkg_stamp's problem, not an argument for a second copy of every check here. Measured: `make packages` builds anvil-busybox_1.31.1-1_mipsel_xburst2.ipk, `make build` assembles a 32-package payload whose bin/busybox is listed in anvil-busybox.list, and qa-static is 265 passed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011gKRUCqj18TVF1Vz1oMpmC
25 lines
811 B
Bash
Executable File
25 lines
811 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# lmdb -- built for the printer's CPython, into its site-packages.
|
|
set -euo pipefail
|
|
. ./bin/common.sh
|
|
. pkgs/lib.sh
|
|
|
|
pkg_begin python-lmdb || exit 0
|
|
pkg_toolchain
|
|
pkg_deps
|
|
pkg_buildpython
|
|
pkg_pytarget
|
|
pkg_unpack "$(pypkg_tgz lmdb)"
|
|
|
|
# LMDB_FORCE_CPYTHON=1 IS LOAD-BEARING. lmdb's setup.py has two backends: a
|
|
# real CPython extension and a cffi one that ships mdb.c and COMPILES IT AT
|
|
# IMPORT TIME. Left to itself here it picks cffi and produces a py3-none-any
|
|
# wheel with mdb.c inside -- i.e. a Moonraker that tries to invoke a compiler
|
|
# on a printer that has none. Do not "fix" this with LMDB_FORCE_CFFI=0:
|
|
# setup.py tests the variable for PRESENCE, so the string "0" selects cffi.
|
|
pkg_pywheel lmdb LMDB_FORCE_CPYTHON=1
|
|
|
|
pkg_ship "lib/python$PY_MM/site-packages"
|
|
pkg_pynative
|
|
pkg_end
|