Please sign in to access this page
so, immich is this magnificent backup service you can host on ye compoote. Because of its great amount of dependencies, upstream recommends sealing it off in a docker glasshouse. But that's preposterous! For at least on my Arch BTW installation, running docker breaks my Waydroid Internet!
Thus for this and other reasons to dislike the proprietary blåhaj, we AUR idiots pulled it out of container safehaven to run on bare metal—interfacing with our actual machine's libraries!
Such is an existing package I adopted to keep up with new updates. Before I joined Summer of Making, I had in June updated the package from 1.133 to 1.135 and introduced a migration off-ramp from a deprecated library for users to run immich with: pgvecto.rs with vectorchord.
No followers yet
Once you ship this you can't edit the description of the project, but you'll be able to add more devlogs and re-ship it as you add new features!
Abandoned: Sparse checkout!
so sparse all my handiwork just fell through the cracks
It turns out Arch makepkg just doesn't support my attempted sparsery. It performs a lot of extra steps on git sources, which is really nice in most cases preventing unnecessary downloading, but in THIS CASE it just plain does its stubborn steps of a full clone over my DLAGENTS flag, the will of the sparse!
So anyways, we now download the same release tarball that the unified immich pkgbase downloads. I hope AUR helpers are smart enough to reuse this file from cache. Though it adds a ton of build time to machines that just want to host the ML service...
In theory, I should be able to get around this by specifying the source git repo with the https:// protocol instead and pacman won't override the DLAGENT I set for THIS protocol, will ya????
I guess I'll actually have to put in the work! Watch out, Pacman. Your days of chomping over sparse yellow pellets and driving innocent civilians through mazes are numbered.
By popular demand (a user's confusion), and because it has very separate build steps as a python package anyways (which includes the time to build python 3.12 from source!), I'm turning that part of the package into its own package.
I've written a basic PKGBUILD. What's left to do is to 1. implement a partial clone through git sparse checkout of just the ml source directory 2. adequately test the package in what we SuperiorArchBTW-ians call a clean chroot, which simulates a clean install, since I'm unsure if I included the right dependencies.
Also, I've now bumped the package to 1.144.1. 1.144.0 doesn't exist! And you know why v1.144.0 has been made a sacrificial object to the Release God, in upstream's words? Yours truly!
I tried making a contribution to immich when I was doing the machine-learning split: upstream bump workflow hadn't been updating the pyproject.toml's version ever since they migrated their toolchain to uv! So I fixed that in https://github.com/immich-app/immich/pull/22372, but I didn't actually fix it because I used the wrong GitHub Actions variable name. Darn. This is why you do adequate testing, people. Now will you finally salute me for using Arch?
Dedicate yourself to a cause and they shall make offerings for you... Such is the divine wisdom and gospel of the makers!
In the latest update, upstream bumped sharp again. Normally a libvips version requirement update is all that's needed, but for some reason sharp refuses to run with the previous version of OpenEXR now? Let's see if we can find this documented anywhere...
Some people like to run the server on a canned potato and separate out the machine learning on their beefy Alanware 2000 PC, using their router to bridge them. Sure! immich-machine-learning is now packaged separately.
I'd have to notify the users that I had just separated out popular functionality including smart search, duplicate detection, and facial recognition; the obvious solution is to add a post-upgrade message Along the way, I discovered that a version-check gate wasn't working...
if [ "$(printf '%s\n' "$1" "1.142.0" | sort -V | tail -n1)" = "1.142.0" ]; then
echo -e "\033[1;33mIMPORTANT\033[0m\033[1m: immich-machine-learning is now packaged separately. It is required for features such as smart search, duplicate detection, and facial recognition."
echo -e "\tInstall and enable immich-machine-learning to continue using these features."
fi
... because I was comparing 1.142.0 to the version upgraded to ($1), instead of from ($2). Oh well. Good thing ArchBTW™'s peak Pacman system automatically prints out new optional dependencies anyways.
Also, immich updated their sharp to 0.34.3 a while ago. That nearly always means the transitive libvips version requirement is bumped, too... Luckily we can easily find the version required from https://github.com/lovell/sharp/blob/v0.34.4/package.json#L196 .
Meanwhile, the immich maintainers responded to my --type-check is required comment bedfuddled:
[9:06 PM]Min: also:
> > nest build --type-check
>
> Info "typeCheck" will not have any effect when "builder" is not "swc".
[9:13 PM]ey, ey,: yeah the builder is in fact swc
[9:13 PM]ey, ey,: at least on my machine
[9:14 PM]Min: it shoudn't be
[9:14 PM]ey, ey,: did you run pnpm fetch first as the dockerfile specifies
[9:14 PM]Min: you don't need to do pnpm fetch
[9:14 PM]Min: thats just to precache the deps in the docker image
[9:15 PM]Min: will try, just b/c curious
[9:16 PM]Min: oh, heh - you are correct.... fetch seems to bust it, weirdly
[10:05 PM]Min: [...] SWC in server is unlikely to happen for a while. I had an experimental PR for that (still open maybe) the problem is that SWC does now allow nest/swagger to generate the .json that is used by open-api-gen to create the dart/typrscript sdks
As of 18 April 2077, analysts have still yet to migrate immich off of or onto SWC. More news at 11.
The problem was simple:
index 3d28e96..c8da1cc 100644
--- a/backup.service.ts.patch
+++ b/backup.service.ts.patch
@@ -4,7 +4,7 @@
try {
await new Promise<void>((resolve, reject) => {
const pgdump = this.processRepository.spawn(
-- `/usr/lib/postgresql/${databaseMajorVersion}/bin/pg_dumpall`,
+- `/usr/lib/postgresql/${databaseMajorVersion}/bin/pg_dumpall`,
Backup works now!
Somebody commented on my AUR package saying that the database backup didn't work. They're right!
They were so nice to even make the patch themselves! They found that the problem was immich hardcoding the path to a postgres binary on Debian, but this is Arch.
Problem is, the patch currently is not applying...
v1.139.0andv1.139.1have made the ultimate sacrifice for switching fromnpmtopnpmin our release pipeline
holy chungus did they switch.
The AUR package's installation instructions have always been based on the upstream Dockerfile-s; mainly, https://github.com/immich-app/immich/blob/main/server/Dockerfile.
With my awesome eyesight, I immediately found the MR that introduced the changes, and copied them (and some ensuing fix commits) into my build() function. That should work!
It didn't. Luckily, makepkg automatically creates its working directory under that of the PKGBUILD file, so I went into the depths of the giant monorepo to investigate why I kept getting the error The@nestjs/swaggerplugin is not compatible with Nest CLI. Neitherafter()norbefore()norafterDeclarations()function have been provided. from nest CLI. What NOBODY ever told me was how ChatGPT is actually useful. It instantly hallucinated the correct answer: to patch the plugin name as @nestjs/swagger/plugin instead.
Angel: But that doesn't make any sense! The official docs say to use @nestjs/swagger! They say you need to write and debug a correct-config generator! This is evil! This is wrong!
Devil: It works.
All's well, time to verify the package build and commit. The package doesn't build. You see a message indicating the absence of a node_modules folder.
You gasp in horror. You use ChatGPT again. ChatGPT hates you. Its instructions don't work and ask you to take matters into your own hands. You destroy your computer. The solid-state drive lies mysteriously undisturbed. With a robe and wizard hat, you transform it into a magical shelf of printed Linux manuals. You can't find the entry for pnpm.1. Laughing manically, you execute your plan all along: you beg a bewildered Uncle Frank to buy your loathsome sheathes of paper out of pity. He does. With your newfound wealth, you buy a new Framework Desktop. Resurrecting your data by inserting your solid-state drive, you correctly invoke pnpm install --help to realize how an pnpm install --offline can link its store to the current folder. You do it, and you did it.
And this concludes our melodrama. Thank you, everyone. Enjoy your new computer.
The PKGBUILD has always provided build instructions for two packages at once: the slow-to-build immich server itself and the official, lightweight CLI. It does this by always building both and then choosing one out of two split package() functions for how to turn the built files into a package. With the massive rewriting that the new build method requires, this is the perfect time to include a split build() function in the rewrite!
—an idiot, half an hour before realizing split packages cannot split the build() function. oh well. Users who install immich-cli would probably want to install immich-server too in any case, since immich-cli requires a server. Those with unorthodox installations who don't want a server are probably skilled enough to comment out the immich-server steps anyways.
Yeah, for some reason I wanted to do more.
For the longest time, the Python machine-learning package was installed under /opt, despite only being half-a-gigabyte. That folder is for Large self-contained packages; modular binaries should go under /usr/lib, and move the things to /usr/lib I did. Please kindly ignore my hiccup in forgetting to push my changes to the accompanying systemd service file.
Perhaps we need to invent some drinking game to get me off my meandering productivity. Jack fo all trades, master of none. Not even typing.
is LYING. Today while writing this I finally re-read the docs links and realized that I wasn't looking at a monorepo. Yes, immich itself is a monorepo, but the server folder is not! So for all intents and purposes related to nest.js, it is not a monorepo, and the non-monorepo suggestion to just add an argument work!
cd server
SHARP_IGNORE_GLOBAL_LIBVIPS=true pnpm exec nest build --type-check
Conclusion? Blind faith in anyone named Angel.
So it turned out I was supposed to make devlogs as I go.
Woah. Huh.
Hopefully a masterdoc recap is fine... yea? ?? ????????
I'll omit the version bumps, of course.
⁂
I utilized the little-known feature of including a changelog! Since the vectorchord migration, another breaking change popped up, so I decided it was best to centralize everything in a small markdown file people will surely read between updates.
right, AUR helpers? right?
Anyways, this feature is accessible through pacman -Qc {package name}, where all available changelogs will be listed if you don't specify a package name. I don't think any other package managers have this feature!
Honestly, the only other packages I have that use this are GloriousEggroll's ProtonGE distribution and stfl, so I have quite low confidence... but whatever RTFM ya snooze ya looze
Besides enabling an option to strip symbols from binaries... which only stripped 1.4MB... I also fixed back a missing file. I don't know how it was appearing before, but now makepkg complained about the absence of build-lock.json. Thus, examining the wisdom of the ancient, I borrowed code from the immich server's container edition's dockerfile, and the package now ships.
Kind of like the work on larksuite-bin, I had to make a licensing info update here, too. The project had changed its license to AGPL 3.0 in 2024, and in any case, the claimed MIT license would have required custom packaging code, whose absence drew my attention.
⁂
With August, I decided to clean up some cruft within the package. I removed some old patches to Python dependency versions. A link to the origin of a nginx config file had stopped working. RFC 0052 had passed, encouraging package maintainers to add REUSE licensing info to their packages, and so I did. I even made a merge request to the Arch REUSE tool adding .gitignore files by default, which has its own story. And even though I manually type the names of the files I want git to commit, I added makepkg excrement to the .gitignore. Insurance can't be cheaper than typing a few lines ah taxt liek taht nowadays.
While working on this, immich made a new hotfix release! Sneaky.
⁂
A mysterious bug appeared! Randomly, some users find all your Cee-S-S disappear!! 👻😨 (COPS CALLED)
A commenter finds that copying over old files from before the cleanup but pasting in the PKGBUILD (the actual build instructions) fixes everything! Yet, the warrior maintainer is unable to diagnose it because they cannot reproduce the issue... until it creeps up after a routine version bump WEEKS later at the WORST time...
Being I go on a trip to Miami and forget everything. In the blazing summer. Why
After I get back, I finally remember I have work to do and start comparing files that work and files that don't. Meld luckily has a folder comparison feature, with which I isolate the issue to... the lines I added to the .gitignore‽
diff --git a/.gitignore b/.gitignore
index f66fce115885..dcec8d84cd74 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,3 +4,7 @@ admin1CodesASCII.txt
admin2Codes.txt
cities500.zip
base-images/
+src/
+pkg/
+*.pkg.tar.zst
+LICENSES/
Another user independently diagnoses this as well. We patch the .gitignore and everything goes back to normal.
Conclusion? Insurance is not cheap.
⁂
Speaking of health, in the next update I also move the official script immich-healthcheck to the usual executable location /usr/bin.
It's pretty useless. It just pings an API endpoint.
For free. Life is nice.