Skip to content

fix(build): preserve native SQLite artifacts for Docker architectures - #10825

Open
iansherr wants to merge 4 commits into
TriliumNext:mainfrom
iansherr:agent/plugin-build
Open

fix(build): preserve native SQLite artifacts for Docker architectures#10825
iansherr wants to merge 4 commits into
TriliumNext:mainfrom
iansherr:agent/plugin-build

Conversation

@iansherr

@iansherr iansherr commented Aug 2, 2026

Copy link
Copy Markdown

Why this PR exists

Plugin testing in isolated Docker environments revealed that a server artifact built on one host could omit the native better-sqlite3 binaries required by another supported Docker architecture.

The existing build behavior was appropriate when artifacts were primarily used on the platform where they were produced. Cross-platform Docker testing introduced the requirement that the same server artifact remain deployable across supported Linux architectures and libc variants.

What changed

  • Preserves Linux x64 and ARM64 glibc binaries in the server artifact.
  • Preserves Linux x64 and ARM64 musl binaries for Alpine images.
  • Keeps the existing host-target trimming behavior for other application builds.
  • Adds explicit build-artifact verification for the four Docker-native SQLite binaries.
  • Removes the build-check dependency on the general server test setup.

Validation

  • pnpm --filter=server test-build — 4 build checks passed
  • pnpm --filter=server verify-build-artifacts — 4 native artifacts verified
  • pnpm --filter=server docker-build-debian
  • pnpm --filter=server docker-build-alpine
  • Debian container health check passed
  • Alpine container health check passed

Scope

This PR is limited to server artifact composition and verification. Plugin-manager behavior and developer-harness changes are submitted separately.

@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR makes server artifacts portable across supported Docker architectures and libc variants.

  • Retains x64 and ARM64 glibc and musl SQLite prebuilds in server distributions.
  • Verifies required native artifacts during the normal packaging workflow.
  • Adds focused artifact tests without the general server test setup.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains; both previously reported issues are fixed in the current code.

Important Files Changed

Filename Overview
apps/server/package.json The packaging workflow now verifies native SQLite artifacts before creating the server archive, resolving the prior verifier-bypass finding.
apps/server/scripts/verify-build-artifacts.mjs The verifier checks all four Docker targets and now converts its module URL to a filesystem path correctly.
apps/server/scripts/build.ts Server builds request retention of all supported Linux architecture and libc variants.
scripts/build-utils.ts SQLite trimming supports preserving both Linux architectures while retaining existing host-target behavior by default.
apps/server/spec/build-checks/artifacts.spec.ts Build checks explicitly assert that the required Docker-native SQLite binaries are present.
apps/server/vitest.build.config.mts Build-artifact tests no longer load the unrelated general server setup.

Reviews (4): Last reviewed commit: "fix(build): handle encoded verifier path..." | Re-trigger Greptile

Comment thread apps/server/package.json Outdated
Comment thread apps/server/scripts/verify-build-artifacts.mjs Outdated
@iansherr
iansherr marked this pull request as ready for review August 6, 2026 22:58
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 6, 2026
iansherr and others added 2 commits August 6, 2026 19:04
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
@iansherr
iansherr marked this pull request as draft August 6, 2026 23:15
@iansherr
iansherr marked this pull request as ready for review August 6, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant