Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/actions/setup-dim/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,10 @@ runs:
~/.cargo/registry
~/.cargo/git
native/dim-host/target
key: ${{ runner.os }}-${{ runner.arch }}-dim-release-1.98.1-${{ hashFiles('native/dim-host/Cargo.lock', 'resources/dim-native-host-lock.json') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-dim-release-1.98.1-
key: ${{ runner.os }}-${{ runner.arch }}-dim-release-1.98.1-${{ inputs.platform == 'linux' && 'glibc228-' || '' }}${{ hashFiles('native/dim-host/Cargo.lock', 'resources/dim-native-host-lock.json') }}
restore-keys: ${{ runner.os }}-${{ runner.arch }}-dim-release-1.98.1-${{ inputs.platform == 'linux' && 'glibc228-' || '' }}
- name: Build pinned native dim host
if: inputs.platform != 'linux'
shell: bash
env:
RUSTUP_TOOLCHAIN: 1.98.1
Expand All @@ -49,6 +50,10 @@ runs:
CARGO_PROFILE_RELEASE_DEBUG: '0'
CARGO_PROFILE_RELEASE_STRIP: symbols
run: pnpm run build:dim-host
- name: Build Linux native host and database for glibc 2.28
if: inputs.platform == 'linux'
shell: bash
run: bash scripts/ci/build-linux-native.sh
- name: Save compiled native Rust dependencies
if: steps.dim-rust-cache.outputs.cache-hit != 'true'
uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/_package-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ jobs:
- name: Package Linux
run: pnpm exec electron-builder --linux --${{ inputs.arch }} --publish=never

- name: Install Debian package and exercise glibc 2.28 runtime
run: bash scripts/ci/smoke-linux-deb.sh

- name: Verify packaged DuckDB VSS
run: |
extension_path="dist/${UNPACKED_DIRECTORY}/resources/app.asar.unpacked/runtime/duckdb/extensions/vss.duckdb_extension"
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ Download the latest version for your system from the [GitHub Releases](https://g
- macOS: `.dmg` installation file
- Linux: `.AppImage` or `.deb` installation file

On Linux, bundled Light OCR on amd64 and arm64 requires glibc 2.38 and libstdc++ with `GLIBCXX_3.4.32`. S3-compatible cloud backup on amd64 also requires glibc 2.38.

**Option 2: Official Website**

Download from the [official website](https://deepchatai.cn/#/download).
Expand Down
2 changes: 2 additions & 0 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ DeepChat 的会话与 Agent 过程基于 Tape.systems 的哲学设计:把过
- macOS: `.dmg`安装文件
- Linux: `.AppImage`或`.deb`安装文件

Linux 的 amd64 和 arm64 安装包中,自带的 Light OCR 需要 glibc 2.38 及提供 `GLIBCXX_3.4.32` 的 libstdc++。amd64 上的 S3 兼容云备份也需要 glibc 2.38。

**方式二:官网下载**

从[官网下载页面](https://deepchatai.cn/#/download)获取安装包。
Expand Down
7 changes: 4 additions & 3 deletions docs/architecture/ci-release-packaging/spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ assembly fails closed against an explicit six-target contract.
- macOS publishes `latest-mac.yml` with x64 and ARM64 ZIP entries plus both ZIP blockmaps.
- DMG remains a manual installer and is excluded from updater metadata and blockmap generation.
- Linux publishes separate `latest-linux.yml` and `latest-linux-arm64.yml` files that reference the
corresponding AppImage.
corresponding AppImage and Debian package, with the AppImage first for legacy clients.
- Every metadata URL resolves to a staged release file, and its SHA-512 and byte size match that file.
- Windows and macOS entries are ordered x64 before ARM64, with legacy `path` and `sha512` fields
pointing to x64.
- The workflow uploads exactly nineteen assets under the current package target configuration,
- The workflow uploads exactly twenty-one assets under the current package target configuration,
including `release-index.json`.

### AC-6 — Package Regression
Expand All @@ -116,6 +116,7 @@ assembly fails closed against an explicit six-target contract.
- The initial baseline records successful run `29978292769` and source commit
`dfb4ba0f34c008c27cfb6bd98a08fdbd36f7b343`.
- Windows EXE, Linux AppImage and tarball, and macOS ZIP and DMG enforce upper and lower delta bounds.
- Add Debian installers to the next size baseline once both architectures have distribution artifact sizes and digests.
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
- `package-regression.yml` supports reusable, manual, and scheduled execution, always covers all six
targets, and uploads reports rather than complete unsigned installers.
- A scheduled failure opens or updates one package-regression issue; the next fully successful
Expand Down Expand Up @@ -183,7 +184,7 @@ assembly fails closed against an explicit six-target contract.
- Package manifest and release index schema version 2 intentionally reject version 1 producers and
consumers. All release jobs execute from one immutable source SHA, so no mixed-version migration
path is supported or required.
- The exact nineteen-asset allowlist intentionally rejects new package formats until the contract,
- The exact twenty-one-asset allowlist intentionally rejects new package formats until the contract,
tests, and release index are updated together.
- Verification-mode macOS package sizes can differ slightly from signed distribution sizes. The
initial 90 MiB delta bounds tolerate signing overhead while still catching material omissions.
Expand Down
21 changes: 21 additions & 0 deletions docs/issues/uos-debian-package/spec.md
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.
8 changes: 4 additions & 4 deletions docs/release-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ This document defines the maintainer release flow for DeepChat without rewriting
- The workflow writes the draft only after fail-closed assembly and local revalidation, then
verifies the uploaded assets through the GitHub API. Treat the run as successful only after
that remote size and digest verification passes. Do not add ad hoc assets to the draft.
- The draft must contain exactly nineteen assets: fourteen target files, four updater metadata
- The draft must contain twenty-one assets, including sixteen target files, four updater metadata
files, and `release-index.json`.
- If a release run must be retried after a native job has completed, rerun all jobs. Package
manifests bind `GITHUB_RUN_ATTEMPT`, so mixing artifacts from different attempts intentionally
Expand Down Expand Up @@ -158,7 +158,7 @@ Use this sequence when the automatic helper is unavailable, especially on Window
git push origin refs/tags/v1.0.0-beta.4
```

8. Wait for the Release workflow, review the exact nineteen-asset draft using the checks in the
8. Wait for the Release workflow, review the exact twenty-one-asset draft using the checks in the
standard sequence, and publish it manually.

9. Delete the temporary release branch after the release is published.
Expand Down Expand Up @@ -193,8 +193,8 @@ x64 and ARM64. It recomputes file digests, rejects incomplete checks or unknown

- `latest.yml` for Windows x64 and ARM64 NSIS payloads;
- `latest-mac.yml` for macOS x64 and ARM64 ZIP payloads, never DMGs;
- separate `latest-linux.yml` and `latest-linux-arm64.yml` AppImage metadata;
- `release-index.json` with six-target evidence and SHA-256 for the other eighteen public files.
- separate `latest-linux.yml` and `latest-linux-arm64.yml` AppImage and Debian metadata;
- `release-index.json` with six-target evidence and SHA-256 for the other twenty public files.

Windows ARM64 uses the `build:win:arm64` script, installs only runtime payloads available for
`win32/arm64`, and packages only plugins whose manifest declares that target. Artifact names and
Expand Down
26 changes: 26 additions & 0 deletions electron-builder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,37 @@ linux:
target:
- AppImage
- tar.gz
- deb
maintainer: ThinkInAIXYZ
category: Utility
artifactName: ${name}-${version}-linux-${arch}.${ext}
mimeTypes:
- x-scheme-handler/deepchat
deb:
Comment thread
zerob13 marked this conversation as resolved.
Resolved
packageName: deepchat
synopsis: Local-first AI desktop assistant
description: >-
Run local agents and chat with AI models. Bundled Light OCR on amd64 and arm64 requires
glibc 2.38 and GLIBCXX_3.4.32. S3-compatible cloud backup on amd64 requires glibc 2.38.
packageCategory: utils
compression: xz
depends:
- ca-certificates
- libc6 (>= 2.28)
- libstdc++6 (>= 8)
- libgtk-3-0
- libnotify4
- libnss3
- libxss1
- libxtst6
- xdg-utils
- libatspi2.0-0
- libuuid1
- libsecret-1-0
- libgbm1
- libcups2
- libudev1
- libasound2
npmRebuild: true
publish:
provider: github
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"description": "DeepChat,一个简单易用的 Agent 客户端",
"main": "./out/main/index.js",
"author": "ThinkInAIXYZ",
"license": "Apache-2.0",
"homepage": "https://deepchatai.cn",
"type": "module",
"engines": {
"node": ">=24.22.1 <25",
Expand Down
21 changes: 8 additions & 13 deletions scripts/ci/assemble-release.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
expectedReleaseAssetCount,
getPublicRoles,
getRoleDefinition,
getUpdaterPayloadRole,
matchesRoleFileName,
PACKAGE_MANIFEST_SCHEMA_VERSION,
RELEASE_INDEX_SCHEMA_VERSION,
Expand Down Expand Up @@ -336,8 +335,6 @@ async function loadTargetPackage(artifactsDirectory, definition, expected) {
)
await validatePackageLayout(artifactRoot, manifest, definition)
const metadataFile = files.find(({ role }) => role === 'update-metadata')
const updaterRole = getUpdaterPayloadRole(definition)
const updaterPayload = files.find(({ role }) => role === updaterRole.name)
const rawMetadata = validateRawUpdateMetadata({
metadata: parseYamlObject(
await readFile(metadataFile.path, 'utf8'),
Expand All @@ -346,7 +343,7 @@ async function loadTargetPackage(artifactsDirectory, definition, expected) {
metadataName: metadataFile.name,
target: definition,
version: expected.version,
updaterPayload
packageFiles: files
})
for (const sidecar of definition.roles.filter(({ sidecarFor }) => sidecarFor)) {
const payload = files.find(({ role }) => role === sidecar.sidecarFor)
Expand Down Expand Up @@ -421,11 +418,11 @@ function mergeArchitectureMetadata(packages, version) {
return metadata
}

function normalizeSingleArchitectureMetadata(packageEntry, version) {
const file = packageEntry.rawMetadata.files[0]
function normalizeLinuxMetadata(packageEntry, version) {
const file = packageEntry.rawMetadata.files.find(({ url }) => url.endsWith('.AppImage'))
const metadata = {
version,
files: [file],
files: packageEntry.rawMetadata.files,
path: file.url,
sha512: file.sha512,
releaseDate: selectReleaseDate([packageEntry]),
Expand Down Expand Up @@ -485,10 +482,8 @@ async function validateFinalMetadata(
) {
throw new Error(`${name} releaseDate must be a canonical ISO string`)
}
const expectedEntries =
name === 'latest-linux.yml' || name === 'latest-linux-arm64.yml' ? 1 : 2
if (!Array.isArray(metadata.files) || metadata.files.length !== expectedEntries) {
throw new Error(`${name} must contain ${expectedEntries} updater files`)
if (!Array.isArray(metadata.files) || metadata.files.length !== 2) {
throw new Error(`${name} must contain two updater files`)
}
for (const file of metadata.files) {
const publicAsset = publicAssets.find(({ name: assetName }) => assetName === file.url)
Expand Down Expand Up @@ -624,11 +619,11 @@ export async function assembleRelease({
},
{
name: 'latest-linux.yml',
metadata: normalizeSingleArchitectureMetadata(linuxX64, version)
metadata: normalizeLinuxMetadata(linuxX64, version)
},
{
name: 'latest-linux-arm64.yml',
metadata: normalizeSingleArchitectureMetadata(linuxArm64, version)
metadata: normalizeLinuxMetadata(linuxArm64, version)
}
]
const metadataAssets = await Promise.all(
Expand Down
34 changes: 34 additions & 0 deletions scripts/ci/build-linux-native.sh
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
2 changes: 2 additions & 0 deletions scripts/ci/classify-package-impact.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ const windowsPackagePaths = new Set([

const linuxPackagePaths = new Set([
'.github/workflows/_package-linux.yml',
'scripts/ci/build-linux-native.sh',
'scripts/ci/smoke-linux-deb.sh',
'build/icon.png',
'resources/linux_tray.png'
])
Expand Down
10 changes: 4 additions & 6 deletions scripts/ci/package-contract.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ const targetDefinitions = [
measured: true,
updaterPayload: true
}),
role('debian', 'files', ['-linux-amd64.deb'], { updaterPayload: true }),
Comment thread
zerob13 marked this conversation as resolved.
Resolved
role('archive', 'files', ['-linux-x64.tar.gz', '-linux-x86_64.tar.gz'], {
measured: true
}),
Expand All @@ -116,6 +117,7 @@ const targetDefinitions = [
measured: true,
updaterPayload: true
}),
role('debian', 'files', ['-linux-arm64.deb'], { updaterPayload: true }),
role('archive', 'files', ['-linux-arm64.tar.gz', '-linux-aarch64.tar.gz'], {
measured: true
}),
Expand Down Expand Up @@ -223,14 +225,10 @@ export function getPublicRoles(target) {
return definition.roles.filter(({ public: isPublic }) => isPublic)
}

export function getUpdaterPayloadRole(target) {
export function getUpdaterPayloadRoles(target) {
const definition =
typeof target === 'string' ? getTargetDefinition(target) : getTargetDefinition(target.id)
const matches = definition.roles.filter(({ updaterPayload }) => updaterPayload)
if (matches.length !== 1) {
throw new Error(`Target ${definition.id} must define exactly one updater payload`)
}
return matches[0]
return definition.roles.filter(({ updaterPayload }) => updaterPayload)
}

export function matchesRoleFileName(fileName, roleDefinition) {
Expand Down
Loading
Loading