Repository navigation
feat(linux): ship Debian packages for older glibc #2570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zerob13
wants to merge
5
commits into
dev
Choose a base branch
from
dimagent/fix-2556-uos-deb
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+334
−125
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7b4265b
feat(linux): package debs for older glibc
zerob13 aa9aecf
test(linux): exercise the packaged terminal
zerob13 49442af
fix(linux): verify desktop as a regular user
zerob13 e8ad6c7
fix(linux): install runtime CA certificates
zerob13 f942a15
fix(linux): handle updater and cloud errors
zerob13 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| # Debian packages and UOS compatibility | ||
|
|
||
| [Issue 2556](https://github.com/ThinkInAIXYZ/deepchat/issues/2556) reports UOS with Linux 4.19 and glibc 2.28. The reporter did not identify the CPU architecture. Both supported Linux architectures need a Debian package with architecture-specific dependencies and update metadata. | ||
|
|
||
| ## Runtime boundary | ||
|
|
||
| The Linux x64 v1.1.5-beta.1 tarball contains an Electron executable requiring GLIBC_2.25 and a Node executable requiring GLIBC_2.28. Its packaged SQLite binding requires GLIBC_2.34. The x64 Dim host imports GLIBC_2.38 and has versioned references up to GLIBC_2.39. In a Debian 10 ARM64 guest with Linux 4.19, the published application stopped during database initialization because its SQLite binding could not load. The packaged Dim host also failed to load. A different installer alone cannot make those binaries runnable on UOS. | ||
|
|
||
| Build the startup SQLite binding and the local agent host against glibc 2.28 from the same pinned sources as other platforms. Exercise the built bindings and a PTY subprocess with the packaged Node runtime. Load the S3 backup adapter on demand, so cloud storage dependencies are needed only when performing cloud operations. Light OCR requires GLIBC_2.38 and GLIBCXX_3.4.32 on x64 and ARM64. The x64 OpenDAL binding requires GLIBC_2.38. On ARM64, OpenDAL loaded on Linux 4.19/glibc 2.28, completed an in-memory write/read round trip and constructed an S3 operator. File search and the preview overlay have separate native dependencies. Their existing platform smoke tests remain on the supported modern Linux runner. | ||
|
|
||
| ## Acceptance | ||
|
|
||
| - The release contains one installable Debian package per Linux architecture. AppImage clients keep their existing update URL and Debian clients find a matching package. | ||
| - The Debian package declares its system dependencies and can be unpacked by the dpkg shipped with glibc 2.28 distributions. | ||
| - Both the encrypted database and the Dim protocol work on a glibc 2.28 userspace. An actual UOS 4.19 launch and the remaining native features need separate verification before declaring full UOS support. | ||
|
|
||
| ## Implementation | ||
|
|
||
| - [x] Add Debian to packaging and release validation. | ||
| - [x] Build the database binding and Dim host against glibc 2.28 on both architectures. | ||
| - [x] Gate distribution on Debian installation, native runtime checks, and desktop startup. Validate both Linux updater payloads during release assembly. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| #!/usr/bin/env bash | ||
| set -euo pipefail | ||
|
|
||
| case "$(uname -m)" in | ||
| x86_64) image=quay.io/pypa/manylinux_2_28_x86_64@sha256:55a36963bc0504cdf004011001c1072306402f0b8b83be5a5eba7068f93eec53 ;; | ||
| aarch64) image=quay.io/pypa/manylinux_2_28_aarch64@sha256:126d9eea9d6b1717f3e17b2b3ac51da04ef159a5f935dac36fe92d621dc8f246 ;; | ||
| *) exit 1 ;; | ||
| esac | ||
|
|
||
| rust_prefix="$(rustc +1.98.1 --print sysroot)" | ||
| node_prefix="$(node -p "require('node:path').dirname(require('node:path').dirname(process.execPath))")" | ||
| cargo_cache="${CARGO_HOME:-$HOME/.cargo}" | ||
| mkdir -p "$cargo_cache/registry" "$cargo_cache/git" | ||
| docker run --rm -i --user "$(id -u):$(id -g)" \ | ||
| -v "$PWD:$PWD" -w "$PWD" \ | ||
| -v "$rust_prefix:/opt/build-rust:ro" -v "$node_prefix:/opt/build-node:ro" \ | ||
| -v "$cargo_cache/registry:/opt/cargo-cache/registry" -v "$cargo_cache/git:/opt/cargo-cache/git" \ | ||
| -e HOME=/tmp -e CARGO_HOME=/tmp/cargo -e CARGO_BUILD_TARGET="$DIM_RUST_TARGET" \ | ||
| -e CARGO_BUILD_JOBS=2 -e CARGO_INCREMENTAL=0 -e CARGO_PROFILE_RELEASE_DEBUG=0 \ | ||
| -e CARGO_PROFILE_RELEASE_STRIP=symbols "$image" bash -seu <<'BUILD' | ||
| export PATH="/opt/build-rust/bin:/opt/build-node/bin:/opt/python/cp312-cp312/bin:$PATH" | ||
| mkdir -p "$CARGO_HOME" | ||
| ln -s /opt/cargo-cache/{registry,git} "$CARGO_HOME/" | ||
| test "$(getconf GNU_LIBC_VERSION)" = 'glibc 2.28' | ||
| node scripts/build-dim-host.mjs | ||
|
|
||
| # N-API is shared by the bundled Node and Electron. Use the package's own cipher flags. | ||
| sqlite="$(realpath node_modules/better-sqlite3-multiple-ciphers)" | ||
| node /opt/build-node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js \ | ||
| rebuild --directory="$sqlite" --nodedir=/opt/build-node -- -Dforce_build=1 | ||
| sqlite_binding="$sqlite/prebuilds/linux-$(node -p process.arch).node" | ||
| install -m 0755 "$sqlite/build/Release/better_sqlite3.node" "$sqlite_binding.tmp" | ||
| mv "$sqlite_binding.tmp" "$sqlite_binding" | ||
| BUILD |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.