# The only thing that runs on your machine is Docker itself. # # Every make target executes inside this image: the build scripts, the tests # and the install simulations. The docker CLI is included so the simulation # targets can start sibling containers through the mounted socket, and # qemu-user-static so the printer's real MIPS userland can be executed. # # A HOST C compiler is here as well, which looks redundant beside two # cross-toolchains: cross-building CPython needs a build-python of exactly the # same version to freeze modules and byte-compile the stdlib, and that one # needs the host's own gcc. pkg-config and perl are for the same section -- # CPython's configure probes libffi through pkg-config, and OpenSSL's # Configure is a perl program. # # zlib1g-dev is for THE HOST HALF of that build: the build-python needs a # working zlib module, or ensurepip cannot unpack pip's bundled .whl. CPython # records the module as missing and carries on, so the symptom lands three # steps later as "No module named pip". The TARGET's zlib is unrelated. # # `patch` is for one package: lmdb's setup.py shells out to /usr/bin/patch BY # ABSOLUTE PATH to patch the bundled liblmdb, and raises "Applying patch # failed" when it is absent -- with nothing to say that a small utility is # what is missing. lmdb is Moonraker's database at the pinned commit. # # libssl-dev IS DEBIAN'S, DELIBERATELY, AND IS THE ONE EXCEPTION TO # versions.env. tools/apk-host/build.sh builds a NATIVE apk to write the feed, # and apk's crypto backend is OpenSSL. That binary is a BUILD TOOL that never # leaves this container; the pin-and-hash rule governs what reaches the # printer, and the printer's apk is cross-compiled against the openssl OUR # feed built. Same call already made for gcc. # # ninja-build IS DEBIAN'S ON THE SAME TERMS, and MESON IS NOT -- the split is # the point. numpy builds with meson-python, so both are needed; but meson is # a Python module our build-python imports, and bookworm's 1.0.1 is below the # >=1.2.99 numpy's meson.build demands, so it is pinned in versions.env with # the rest of PYPKG_HOST_LIST. ninja is a program meson merely execs, no pin of # ours would change what it emits, and nothing it produces reaches a printer # except through the cross compiler that is pinned. # # IT IS NEEDED EARLIER THAN NUMPY, which is the part that surprises: meson-python # is self-hosting (backend-path = ['.']), so pkg_buildpython runs meson and # ninja just to install the backend itself. FROM debian:bookworm-slim ENV DEBIAN_FRONTEND=noninteractive RUN echo 'Acquire::Retries "3";' > /etc/apt/apt.conf.d/80-retries \ && apt-get update && apt-get install -y --no-install-recommends \ bash coreutils tar xz-utils gzip bzip2 openssl unzip curl ca-certificates \ python3 python3-jinja2 python3-pytest python3-pyflakes \ python3-pytest-xdist \ binutils file findutils grep sed gawk make git diffutils patch procps \ squashfs-tools qemu-user-static docker.io shellcheck \ gcc g++ libc6-dev zlib1g-dev pkg-config perl \ libssl-dev ninja-build \ && rm -rf /var/lib/apt/lists/* WORKDIR /src CMD ["bash"]