Add swayimg, unbuilt, and record the GitHub two-endpoint finding
swayimg costs exactly ONE new library and that one is LuaJIT. Every other dependency -- libxkbcommon, fontconfig, freetype, wayland, wayland-protocols, libpng -- already existed because foot needed them, and all nine wayland-protocols XML files it names are present in the 1.45 packaged here. The Wayland half of this channel is reusable rather than foot-shaped, which is the same thing core/grim demonstrated.
NOT BUILT. Publishing is required to build a new package, and publishing is blocked by the channel evaluation CPU budget (t-cc5d27). The definition is committed so the work is not lost and so the provenance reasoning is recorded where it belongs.
Two findings at the site:
luajitis mandatory and it is LuaJIT, not Lua: meson.build:38, under a comment reading# mandatory dependencies, no required: kwarg, no option. An earlier estimate of this package's cost readdependency(get_option('liblua'))from upstream MASTER and concluded plain Lua would do. Read the version you are packaging, not the branch.
- THE HASH IS A PROPERTY OF THE ENDPOINT, NOT OF THE TAG. The first build refused on a source hash mismatch -- my error, one URL hashed and another pinned -- but the two differ because GitHub serves the same tag as two different artifacts: api.github.com/.../tarball/TAG roots the tree at
artemsen-swayimg-682fecf/, codeload.../tar.gz/TAG atswayimg-5.5/. Identical content once the prefix is stripped, verified by extracting both and diffing; different bytes; and each endpoint individually stable, so this is not regeneration. There is simply no canonical byte stream for a tag that ships no release artifact. That is the argument against synthetic archives stated more precisely than "they can change".
Both this and core/luajit carry the same scoped-exception note: they are a discovery exercise whose product is knowledge about the packaging model, not a published dependency, and NEITHER SHOULD BE PUBLISHED OR SIGNED ON THIS PROVENANCE without revisiting the question.
channel.sgl | 6 ++++--
src/core/packages/viewer.sgl | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 160 insertions(+), 2 deletions(-)channel.sglmodified
(core packages wayland) (core packages input) (core packages capture) (core packages luajit)) (core packages luajit) (core packages viewer))(channel stream: "core-stable" (channel-binding name: "core/vim" value: vim) (channel-binding name: "core/emacs" value: emacs) (channel-binding name: "core/python" value: python) (channel-binding name: "core/luajit" value: luajit))) (channel-binding name: "core/luajit" value: luajit) (channel-binding name: "core/swayimg" value: swayimg)))src/core/packages/viewer.sgladded
;;; Image viewing.;;;;;; PROVENANCE: THE SAME SCOPED EXCEPTION AS `core/luajit`, AND FOR THE SAME;;; REASON. swayimg publishes NO release assets -- only GitHub's;;; auto-generated source archive, which is what every distribution pins. A;;; synthetic archive whose bytes can be regenerated does not belong on the;;; critical path of a chain intended to SHIP.;;;;;; This is not that. `core/swayimg` and `core/luajit` exist as a DISCOVERY;;; EXERCISE whose product is knowledge about what this packaging model can;;; host -- where the blind spots are -- rather than a published dependency.;;; Two auto-generated archives are acceptable for that purpose and would not;;; be acceptable for a shipped chain. NEITHER PACKAGE SHOULD BE PUBLISHED OR;;; SIGNED ON THIS PROVENANCE WITHOUT REVISITING THE QUESTION.;;;;;; AND A CONCRETE DEMONSTRATION OF WHY, MET WHILE WRITING THIS PACKAGE.;;; The first build refused:;;;;;; REFUSING source sha256 mismatch; expected 64ae8713... actual f84fec72...;;;;;; That was my error -- I hashed one URL and pinned another -- but the reason;;; the two hashes differ is the point. GitHub serves the SAME TAG from two;;; endpoints and they are not the same artifact:;;;;;; api.github.com/repos/OWNER/REPO/tarball/TAG -> artemsen-swayimg-682fecf/;;; codeload.github.com/OWNER/REPO/tar.gz/TAG -> swayimg-5.5/;;;;;; Identical CONTENT once the prefix is stripped -- verified by extracting;;; both and diffing -- but a different embedded top-level directory name, so;;; different bytes and different hashes. Each endpoint is individually;;; stable (the api one was fetched twice and matched), so this is not;;; regeneration. It is that THERE IS NO SINGLE CANONICAL BYTE STREAM for a;;; tag that ships no release artifact.;;;;;; A real dist tarball has one answer to "what are the bytes". This has two,;;; and nothing upstream declares which is meant. That is the argument;;; against synthetic archives stated more precisely than "they can change".;;;;;; WHAT IT COST, which is the interesting number: ONE new library, and that;;; one is LuaJIT. Every other dependency swayimg has -- libxkbcommon,;;; fontconfig, freetype, wayland, wayland-protocols, libpng -- already existed;;; because foot needed them. The Wayland half of this channel turns out to be;;; reusable rather than foot-shaped, which is the same thing `core/grim`;;; demonstrated and is worth more than either program.(define-library (core packages viewer) (import (sigil core) (core build-environments) (core packages compression) (core packages xml) (core packages ffi) (core packages graphics) (core packages fonts) (core packages wayland) (core packages input) (core packages luajit) (core packages build-tools) (core packages python) (sigil env package) (sigil build external)) (export swayimg) (begin ;; LUAJIT IS NOT OPTIONAL, and it is LuaJIT rather than Lua. ;; meson.build:38 is `dependency('luajit')` under a comment reading ;; `# mandatory dependencies`, with no `required:` kwarg and no ;; corresponding entry in meson.options. An earlier estimate of this ;; package's cost read `dependency(get_option('liblua'))` from upstream ;; MASTER and concluded plain Lua would do; the RELEASE hardcodes luajit. ;; Read the version you are packaging, not the branch. ;; ;; expat, zlib, libffi and freetype are declared although swayimg names ;; none of them: they are reached through the `Requires:` and ;; `Requires.private:` chains of fontconfig.pc, freetype2.pc, libpng.pc and ;; wayland-client.pc, and this channel composes PKG_CONFIG_PATH from DIRECT ;; dependencies only. The union was printed from the store before writing ;; this line rather than discovered one build failure at a time. ;; [[topics/core-channel-pkgconfig-is-not-transitive]] (define swayimg (package name: "swayimg" version: "5.5" source: (external-source location: "https://codeload.github.com/artemsen/swayimg/tar.gz/v5.5" sha256: "f84fec722cd0b4cfd86d0a8a820b15a95bbdb1d2cfcded7f67446a7a0c1d1c09") buildenv: core-buildenv dependencies: (list libxkbcommon fontconfig freetype wayland wayland-protocols libpng luajit expat zlib libffi) build-inputs: (list meson samurai python) phases: (list (external-phase kind: 'run args: (list "sh" "-c" (string-append "set -eu\n" "meson setup build" " --prefix=${out}" " --buildtype=plain" " --default-library=static" ;; fontconfig.pc carries `Requires.private: expat`, ;; and swayimg links an executable, so the static ;; pkg-config query is required or the link fails ;; on XML_* symbols. Same lesson as foot. " -Dprefer_static=true" ;; PNG only. Every other decoder is a feature ;; option defaulting to `auto`, which would make ;; the output depend on what happened to be ;; visible -- the thing this channel exists to ;; prevent. Turning them off explicitly is what ;; makes the result a function of the declared ;; inputs. " -Dpng=enabled" " -Dexr=disabled -Dgif=disabled -Dheif=disabled" " -Davif=disabled -Djpeg=disabled -Djp2=disabled" " -Djxl=disabled -Dsvg=disabled -Dtiff=disabled" " -Dsixel=disabled -Draw=disabled -Dwebp=disabled" " -Dexif=disabled" ;; Wayland yes, DRM no: the DRM backend wants ;; libdrm and a console, and the acceptance case ;; is a Wayland compositor. " -Dwayland=enabled -Ddrm=disabled" ;; Completions want bash-completion and zsh; the ;; man page wants scdoc. None is packaged and ;; none is read by anything here. " -Dbash=disabled -Dzsh=disabled" " -Dman=false -Ddoc=false -Ddesktop=false" " -Dluameta=false" ;; The version option exists because swayimg ;; otherwise derives it from `git`, which is not ;; in the seed and would leave it at 0.0.0. " -Dversion=5.5\n" "echo SWAYIMG-CONFIGURED\n"))) (external-phase kind: 'run args: (list "sh" "-c" (string-append "set -eu\n" "meson compile -C build\n" "echo SWAYIMG-COMPILED\n"))) (external-phase kind: 'run args: (list "sh" "-c" (string-append "set -eu\n" "d=\"$(dirname \"$PWD\")/install-root\"\n" "DESTDIR=\"$d\" meson install -C build --no-rebuild\n" "test -x \"$d${out}/bin/swayimg\"\n" ;; ASSERT PNG SUPPORT IS ACTUALLY IN, not merely ;; requested. `-Dpng=enabled` makes meson FAIL if ;; libpng is missing, so this is belt-and-braces ;; rather than the only guard -- but a viewer that ;; installs and cannot decode the one format it ;; was built for is exactly the silent ;; feature-loss this channel keeps finding, and ;; the binary is the only thing that can answer it. "\"$d${out}/bin/swayimg\" --version\n" "echo SWAYIMG-INSTALLED\n"))))))))