Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:bug: Pin Docker rebuild sources and fix musl stacktrace compilation

Daniel4ab671348ad6
diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml
index df511113c5..573bdaf88e 100644
--- a/.github/workflows/dockerimage.yml
+++ b/.github/workflows/dockerimage.yml
@@ -27,14 +27,29 @@ jobs:
permissions:
packages: write
contents: read
+ defaults:
+ run:
+ working-directory: source
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v6
with:
- ref: ${{ github.sha }}
+ # 手动重建使用正式版标签的源码,避免混入工作流分支上的后续开发内容。
+ ref: ${{ github.event_name == 'workflow_dispatch' && format('refs/tags/v{0}', inputs.version) || github.sha }}
+ path: source
submodules: recursive
+ - name: Checkout Docker build configuration
+ if: ${{ github.event_name == 'workflow_dispatch' }}
+ uses: actions/checkout@v6
+ with:
+ ref: ${{ github.sha }}
+ path: docker-config
+ sparse-checkout: Dockerfile
+ sparse-checkout-cone-mode: false
+ persist-credentials: false
+
- name: Extract version from package.json
id: version
run: |
@@ -62,6 +77,16 @@ jobs:
fi
echo "Release version matches package.json: $VERSION"
+ - name: Apply Docker build configuration
+ if: ${{ github.event_name == 'workflow_dispatch' }}
+ # 只复制工作流提交中的 Dockerfile,应用源码和资源保持正式版标签的内容。
+ run: cp ../docker-config/Dockerfile Dockerfile
+
+ - name: Record source and build configuration
+ run: |
+ echo "Source commit: $(git rev-parse HEAD)"
+ sha256sum Dockerfile
+
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
diff --git a/Dockerfile b/Dockerfile
index d7c17b4c84..6148669ca8 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -54,6 +54,21 @@ RUN git clone --no-checkout https://github.com/microsoft/onnxruntime /onnxruntim
&& cd /onnxruntime \
&& git checkout 3a728b75062256951b6e19ce718907cf1a1d4cf0 \
&& git submodule update --init --recursive
+# Release 构建不生成栈回溯,将 execinfo.h 限定为 Debug 构建所需的头文件。
+RUN <<EORUN
+#!/bin/sh -e
+cd /onnxruntime
+patch --fuzz=0 -p1 <<'EOPATCH'
+--- a/onnxruntime/core/platform/posix/stacktrace.cc
++++ b/onnxruntime/core/platform/posix/stacktrace.cc
+@@ -6,4 +6,4 @@
+-#if !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) && !defined(_AIX)
++#if !defined(NDEBUG) && !defined(__ANDROID__) && !defined(__wasm__) && !defined(_OPSCHEMA_LIB_) && !defined(_AIX)
+ #include <execinfo.h>
+ #endif
+ #include <vector>
+EOPATCH
+EORUN
RUN python3 /onnxruntime/tools/ci_build/build.py --build_dir /onnxruntime/build \
--config Release --update --build --parallel 2 --build_shared_lib \
--skip_tests --allow_running_as_root --compile_no_warning_as_error