wekan/FerretDB now releases ferretdb-sqlite-<arch> beside ferretdb-<arch>: the
same FerretDB with only the SQLite handler, about 5 MB smaller, and SQLite is
all a WeKan bundle, image, snap or .spk runs. releases/ferretdb-asset.sh is the
one place that chooses: the newest release that has ferretdb-sqlite-<arch>,
and, until one does, the full ferretdb-<arch> of the newest release, which
has the SQLite handler too. It says in the log which one it took and why,
downloads it, verifies it against its .sha256sum, and returns FERRET_ASSET,
FERRET_TAG, FERRET_URL and FERRET_SHA for the provenance table (also through
$GITHUB_ENV, cached per job so the check and embed steps agree).
Every FerretDB download goes through it: the amd64, arm64, win64, win-arm64,
win32, mac-arm64, mac-x64 and extra-architecture jobs of release-all.yml (the
Docker images, snap, AppImage, Flatpak, single-file and macOS/Windows
packages are made from those bundles), repack-bundle-for-arch.sh for
release-all-missing.yml, bsd.yml, check-arch-binaries.sh,
build-release-bundle.sh and test-download-urls.sh. require-binaries.sh checks
the resume-login floor against the release the helper chose. The provenance
rows record that release and URL instead of /latest/.
No release workflow builds FerretDB: sandstorm-src/build-deps.sh takes the
prebuilt ferretdb-sqlite-amd64 by default (FERRETDB_SOURCE=download), and
sandstorm.yml and release-all.yml's build-sandstorm no longer set
FERRETDB_SOURCE=build; building from source stays a local option. The default
docker-compose.yml downloads ferretdb-sqlite-<arch> (FERRETDB_BINARY, falling
back to ferretdb-<arch> for a release without it); the PostgreSQL, MySQL,
MariaDB and SAP HANA compose files keep the full binary.
tests/ferretdbSqliteAsset.test.cjs drives the helper against a fake GitHub
(newest, older and no release with the SQLite-only binary, .exe names, a
pinned tag, FERRETDB_VARIANT=full, checksum match and mismatch, a missing
platform, bad names) and checks that every download site uses it, that no
workflow builds FerretDB and that only the SQLite compose file takes the
SQLite-only binary. The tests that pinned the old URLs follow the helper.
Thanks to xet7 !
fetch-mongo-tools.sh, the local build-release-bundle.sh and the
check-arch-binaries.sh preflight fell back to the eight separate
<tool>-<platform> binaries when a release had no mongo-tools-<platform>.
wekan/mongo-tools-patches now publishes only the one program, so every
bundle, image and snap gets that or no tools, and says so. The Windows and
macOS jobs also remove the inherited amd64 mongo-tools with the launchers.
tests/fetchMongoTools.test.cjs serves a release that has only the per-tool
binaries and checks that none is installed or even requested, and fails on
any script or workflow that builds a per-tool download address.
Thanks to xet7 !
The eight tools were eight Go programs, each with its own copy of the Go
runtime, the MongoDB driver and the tools' shared packages: about 105 MB
in every bundle, image and snap. wekan/mongo-tools-patches now also
publishes mongo-tools-<platform>, all eight in one program of about 15 MB.
releases/fetch-mongo-tools.sh puts it in a bundle with a launcher per
tool - a three-line shell script on Linux and macOS, a .cmd on Windows -
so mongodump keeps working from $SNAP/bin, the bundle and PATH. Launchers
rather than symlinks, because a symlink has to survive zip -r, Docker
COPY, snapcraft and every user's unzip. Until the newest
mongo-tools-patches release has mongo-tools-<platform>, it fetches the
eight per-tool assets as before. It first removes the tools a repacked
bundle inherited from amd64, so a platform without tools ships none
rather than the wrong CPU's.
Every bundle job in release-all.yml, repack-bundle-for-arch.sh and
build-release-bundle.sh use it; the snaps move mongo-tools into bin/
with its launchers; the telemetry audit scans mongo-tools as a tool; the
Windows single EXE unpacks the .cmd launchers; the preflight and the URL
check accept the one program.
tests/fetchMongoTools.test.cjs serves the release from a local HTTP
server and checks the launchers run the program with their arguments,
the Windows .cmd files, the per-tool fallback, and (negative) that
inherited amd64 tools are removed, that a checksum mismatch is refused,
and that no workflow or snap recipe downloads the tools itself.
releaseBinaryFreshness now finds the newest-release URL in the helper;
workflowFailureDiagnostics required an ::error:: beside each new exit.
Thanks to xet7 !
Every job that builds a release file now attaches it to the GitHub Release
as its own last step, right after the build and its checks pass, through
releases/github-release-upload.sh (retried, bounded, verified by name and
size). Nothing waits for the other builds any more:
- build-amd64 creates the release (releases/ensure-github-release.sh) and
attaches its zip; build-arm64 attaches its own. The release job no
longer downloads and uploads them; it writes the notes and checks both
base bundles and their .sha256sum are on the release.
- The win64, win-arm64, win32, mac-arm64, mac-x64, extra-arch, Sandstorm
and snap jobs use the shared uploader.
- AppImage.yml, mac.yml and Flatpak.yml attach from each matrix build job
instead of a final publish job; windows.yml attaches from its build job
and its publish job is gone. release-all-missing.yml's extra-arches
attach uses the shared uploader.
A cancelled run keeps what finished: every attach step runs on always()
plus its build step's success, and the final jobs (release notes, what is
still missing, the AppImage/Mac/Flatpak summaries and the Flatpak
repository) run on always() while still requiring the release to exist.
The uploader no longer needs GNU timeout, so it also runs on the macOS
runners and in Windows Git Bash.
Thanks to xet7 !
Print development and release log paths at completion on shell and Windows builds. Match the release workflow by making Meteor's server package manifest writable before updating node-gyp and installing dependencies.
Add completion/failure and read-only-manifest regressions. Development compilation and release startup smoke check pass on Linux arm64; 13 targeted test entries pass. Native Windows execution is unavailable.
Thanks to xet7.
bcrypt and argon2 (Meteor's accounts-password) each ship one
prebuilds/<platform>-<arch>/ directory per platform they support: 21 native
binaries in every WeKan bundle, of which exactly one is ever opened. Their
loader is node-gyp-build, and its resolve() reads a single directory:
var tuples = readdirSync(path.join(dir, 'prebuilds')).map(parseTuple)
var tuple = tuples.filter(matchTuple(platform, arch)).sort(compareTuples)[0]
with platform and arch from os.platform() and os.arch(). This is the same
argument bundle-trim.mjs already makes about uWebSockets.js, so it is the same
code path: --trim-prebuilds keeps the directories node-gyp-build would match
and drops the rest. The tuple parsing here IS node-gyp-build's, multi-arch
names ("darwin-x64+arm64") included, and both libc flavours of the target are
kept because glibc versus musl is decided at runtime.
Three things make it safe rather than merely smaller, and all three are pinned
by tests:
- It is off by default and REFUSES to run without an explicit --platform and
--arch. The defaults are linux/x64, and a Windows or macOS bundle trimmed
with those would lose the only addon it can load, which is precisely the
fault the single EXE was just fixed for.
- build-amd64 does NOT pass it. Every other bundle WeKan ships is that bundle
repacked, so trimming there would take the prebuilds away from
architectures that have not been built yet. Each final per-platform job
passes its own target instead.
- Every decision is made before anything is deleted, so a package whose
prebuilds cannot be reasoned about is left whole rather than half-trimmed.
Running it on a real bundle found bare-fs, bare-path and bare-url, which
ship prebuilds/ of .bare files for the Bare runtime - a different loader
with different rules. Those are left untouched, and say so.
On the mac-arm64 bundle: 19 of the 21 removed, the two for darwin-arm64 kept.
For the single Windows EXE that takes the files it has to unpack from 33 down
to about fifteen.
Two tests were counting a script named in a YAML comment as a script the job
runs, which the new comments in build-amd64 tripped. Both now drop comment
lines before looking, which is what they meant in the first place.
Thanks to xet7 !
One entry cannot mean both, and after the previous commit "Build WeKan" meant
the expensive one: it downloaded a Node.js, a FerretDB and eight MongoDB tools,
trimmed 389 MiB and smoke-booted the result. That is the right answer to "would
a release start", and the wrong one to "give me a bundle to poke at".
So the entry is now two, and they say which is which:
Build WeKan release bundle what the Release All workflow builds for
this platform, minus the .zip
Build WeKan development bundle plain `meteor build .build --directory` -
exactly what "Build WeKan" did before
The development one also says what it is NOT, when it finishes: a bundle from
there still has the legacy client, the source maps and uWebSockets.js, and no
Node.js, FerretDB or launcher of its own, so it cannot answer whether a release
starts. Somebody who builds it and then wonders why ./start-wekan.sh is missing
should not have to find that out by looking.
build.bat gains :builddev beside :build, with the clean-and-build half they
share moved into :buildcommon - the same reason the git actions there call
build.sh rather than reimplementing it: two copies of the steps is how that file
drifted before.
The test path is unchanged and still takes the plain build, which is what it
wants: it runs the bundle under its own node and its own mongod.
Thanks to xet7 !
"Build WeKan" ran `meteor build .build --directory` and stopped there, and that
bundle is not the one a release publishes. A release adds the server's npm
modules, three prunes, the sockjs / legacy-client / source-map trim, a verified
Node.js, FerretDB, the eight MongoDB Database Tools and a launcher - and three
releases running broke in exactly that difference:
v10.96 boot.js read a source map the trim had deleted and left NAMED
v10.97 the prune's graph could not see module.link(), so the bundle shipped
without nodemailer-openpgp, which packages/email.js links on its
first tick
v10.98 meteor-spk rebuilt the bundle, throwing away 405 MiB of trimming
None of it was reproducible here, because here there was only `meteor build`.
Answering "does the bundle a release would publish start at all" took a
release, a workflow run and a download.
releases/build-release-bundle.sh runs the workflow's OWN steps, in its order,
with its arguments, for whichever platform it is run on - amd64, arm64, the two
macOS arches and the three Windows ones. Not a second implementation of the
release: the same scripts, so a fix to one is a fix to both. What it does NOT do
is zip, checksum or record provenance, because those describe a published
artifact and this one is a directory to start:
cd .build/bundle && ./start-wekan.sh
That launcher is start-wekan.sh because that is what a release ships; a start.sh
added here would be the first way this bundle differed from one.
Verified by running it, on Linux arm64: 850M bundle, trim -349 MiB, prune
-40.0 MiB, smoke boot passed, Node.js v24.19.0 verified against nodejs.org's
SHASUMS256.txt, FerretDB and the eight tools downloaded per-arch, 686M with all
of it embedded. Then started: FerretDB on SQLite, WeKan serving HTTP 200 fifteen
seconds later. The only gap it reported is qemu-aarch64, because
qemu-user-static is not installed on this machine - a warning, not a failure,
and the reason it is a warning is that only #6458's emulation path needs it.
Downloads are cached under .tools/bundle-binaries/<platform>/ so an afternoon of
rebuilds does not re-fetch 150 MB each time, and every cache HIT re-checks the
published SHA256 rather than trusting the file for having been there before.
build.bat calls the same script through bash, for the reason it already gives
for the git actions: a batch copy of the steps is how that file drifted before.
The test path is deliberately unchanged. It runs the bundle under its own node
and its own mongod, so downloading a hundred megabytes of binaries it will not
use is the wrong trade - tests/releaseBundleMatchesWorkflow.test.cjs asserts
that exactly one caller asks for the release bundle. It also finds the release
scripts the workflow runs rather than listing them, so a step added there and
not here fails the suite instead of quietly putting the difference back.
Thanks to xet7 !