[fix] restore minimum Xmake version to 3.1.1

This commit is contained in:
dijunkun
2026-10-08 16:26:25 +08:00
parent b0d6e8a520
commit 5004c91a6c
19 changed files with 49 additions and 52 deletions
@@ -12,7 +12,7 @@ fi
minimum_version="${XMAKE_MIN_VERSION:-}"
if [[ ! "$minimum_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "XMAKE_MIN_VERSION must be a numeric major.minor.patch version, for example 3.0.0." >&2
echo "XMAKE_MIN_VERSION must be a numeric major.minor.patch version, for example 3.1.1." >&2
exit 2
fi
+9 -10
View File
@@ -14,7 +14,7 @@ BASH = shutil.which("bash")
@unittest.skipUnless(BASH, "Bash is required to exercise the CI version check")
class XmakeVersionCheckTest(unittest.TestCase):
def check(self, version_output=None, *, minimum="3.0.0", status=0, arguments=()):
def check(self, version_output=None, *, minimum="3.1.1", status=0, arguments=()):
with tempfile.TemporaryDirectory(prefix="crossdesk-xmake-check-") as directory:
root = Path(directory)
output_file = root / "github-output"
@@ -63,8 +63,7 @@ class XmakeVersionCheckTest(unittest.TestCase):
return result, outputs, invocation
def test_keeps_minimum_and_newer_versions(self):
for version in ("3.0.0", "3.0.1", "3.0.9", "3.0.99", "3.1.0", "3.1.1",
"3.1.2", "3.1.10", "3.2.0", "3.10.0", "4.0.0"):
for version in ("3.1.1", "3.1.2", "3.1.10", "3.2.0", "3.10.0", "4.0.0"):
with self.subTest(version=version):
result, outputs, invocation = self.check(f"xmake v{version}\n")
self.assertEqual(result.returncode, 0, result.stderr)
@@ -74,12 +73,12 @@ class XmakeVersionCheckTest(unittest.TestCase):
self.assertIn("Keeping installed Xmake", result.stdout)
def test_older_versions_require_upgrade(self):
for version in ("2.9.9", "2.99.99"):
for version in ("3.1.0", "3.0.99", "2.99.99"):
with self.subTest(version=version):
result, outputs, _ = self.check(f"xmake v{version}\n")
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(outputs["needs-upgrade"], "true")
self.assertIn("Install Xmake 3.0.0 or newer", result.stdout)
self.assertIn("Install Xmake 3.1.1 or newer", result.stdout)
def test_components_are_compared_numerically(self):
for installed, minimum, expected in (
@@ -111,8 +110,8 @@ class XmakeVersionCheckTest(unittest.TestCase):
("", 0),
("xmake version unknown\n", 0),
("xmake v3.1\n", 0),
("xmake v3.0.0invalid\n", 0),
("xmake v3.0.0-rc.1\n", 0),
("xmake v3.1.1invalid\n", 0),
("xmake v3.1.1-rc.1\n", 0),
("otherxmake v9.9.9\n", 0),
)
for output, status in cases:
@@ -121,16 +120,16 @@ class XmakeVersionCheckTest(unittest.TestCase):
self.assertEqual(result.returncode, 0, result.stderr)
self.assertEqual(outputs["needs-upgrade"], "true")
self.assertEqual(outputs["detected-version"], "")
self.assertIn("Install Xmake 3.0.0 or newer", result.stdout)
self.assertIn("Install Xmake 3.1.1 or newer", result.stdout)
def test_verification_fails_when_install_did_not_provide_required_version(self):
for output, status in ((None, 0), ("xmake v2.99.99", 0), ("unknown", 0), ("xmake v3.0.0", 5)):
for output, status in ((None, 0), ("xmake v3.1.0", 0), ("unknown", 0), ("xmake v3.1.1", 5)):
with self.subTest(output=output, status=status):
result, outputs, _ = self.check(output, status=status, arguments=("--verify",))
self.assertEqual(result.returncode, 1)
self.assertEqual(outputs["needs-upgrade"], "true")
self.assertIn("Xmake verification failed", result.stderr)
self.assertIn("3.0.0 or newer", result.stderr)
self.assertIn("3.1.1 or newer", result.stderr)
def test_verification_accepts_newer_version(self):
result, outputs, _ = self.check("xmake v4.0.0", arguments=("--verify",))
+2 -2
View File
@@ -41,7 +41,7 @@ jobs:
version: ${{ steps.package.outputs.version }}
env:
# Exercise the minimum supported version; local builds may use newer Xmake.
XMAKE_MIN_VERSION: "3.0.0"
XMAKE_MIN_VERSION: "3.1.1"
CROSSDESK_SOURCE_TAG: ${{ inputs.source_tag || '' }}
CROSSDESK_RELEASE_BUILD: ${{ inputs.source_tag && 'YES' || 'NO' }}
steps:
@@ -130,7 +130,7 @@ jobs:
path: apps/android/.native/global/.xmake/repositories/xmake-repo
key: ${{ runner.os }}-${{ runner.arch }}-android-xmake-repo-v1-${{ hashFiles('apps/android/scripts/build_native.py') }}
# Cache installed packages only. build_native.py checks Xmake >= 3.0.0 and pins
# Cache installed packages only. build_native.py checks Xmake >= 3.1.1 and pins
# its own package repository; never reuse another platform's build/config.
- name: Cache native dependencies
uses: actions/cache@v5
+1 -1
View File
@@ -52,7 +52,7 @@ jobs:
IOS_DEPLOYMENT_TARGET: "16.0"
EXPECTED_IOS_SDK: "26.5"
# Exercise the minimum supported version; local builds may use newer Xmake.
XMAKE_MIN_VERSION: "3.0.0"
XMAKE_MIN_VERSION: "3.1.1"
XMAKE_REPO_REVISION: "121109352da272cd1a3d4ed52f2dcda34f839955"
steps:
+2 -2
View File
@@ -27,9 +27,9 @@ concurrency:
env:
IMAGE_NAME: crossdesk/ubuntu20.04
STACK_TAG: buildenv-cuda12.6.3-gcc10-cmake3.31.6-pipewire0.3.48-xmake3.0.0-rust1.92.0
STACK_TAG: buildenv-cuda12.6.3-gcc10-cmake3.31.6-pipewire0.3.48-xmake3.1.1-rust1.92.0
CMAKE_VERSION: 3.31.6
XMAKE_VERSION: 3.0.0
XMAKE_VERSION: 3.1.1
RUST_VERSION: 1.92.0
RUSTUP_VERSION: 1.28.2
+1 -1
View File
@@ -27,7 +27,7 @@ permissions:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
XMAKE_MIN_VERSION: "3.0.0"
XMAKE_MIN_VERSION: "3.1.1"
jobs:
build-linux:
+3 -3
View File
@@ -36,7 +36,7 @@
- JDK 17 或更新版本(可使用 Android Studio 自带 JBR)。
- Android SDK Platform 36、Build Tools 36.0.0、NDK `28.2.13676358`。
- Xmake **3.0.0 或更新版本**、Python 3.9+、Git、CMake 和主机编译工具。
- Xmake **3.1.1 或更新版本**、Python 3.9+、Git、CMake 和主机编译工具。
- Python 的 setuptools、wheel,用于构建依赖的宿主工具。
先在仓库根目录初始化子模块:
@@ -50,7 +50,7 @@ macOS 命令行示例:
```sh
export ANDROID_HOME="$HOME/Library/Android/sdk"
export JAVA_HOME="/Applications/Android Studio.app/Contents/jbr/Contents/Home"
# 使用 PATH 中的 Xmake(最低 3.0.0),或通过 XMAKE_BIN 指定其他可执行文件。
# 使用 PATH 中的 Xmake(最低 3.1.1),或通过 XMAKE_BIN 指定其他可执行文件。
cd apps/android
./gradlew :app:assembleDebug
```
@@ -94,7 +94,7 @@ git push origin android-v1.6.0-20261002
已有 Release 需要补传服务器或刷新下载信息时,可手动运行 `Update version.json from Release` 并填写已有 `source_tag`,无需重新构建。
工作流使用 Ubuntu 24.04、JDK 17、Python 3.13、SDK 36、Build Tools 36.0.0、NDK r28c,并使用最低支持的 Xmake 3.0.0 验证构建;本地允许使用更新的 Xmake。Gradle 使用工程内的 Wrapper,原生构建器固定 Xmake 包仓库版本。SDK/NDK 使用独立目录缓存,按宿主系统、架构和工具链版本区分;命中缓存时跳过 SDK 安装,未命中时在安装完成后立即保存,即使后续 APK 构建失败,下次也可复用。Xmake 可执行环境、固定版本的包仓库和 pip 下载也有各自的缓存;Ubuntu 系统工具只安装缺失项。
工作流使用 Ubuntu 24.04、JDK 17、Python 3.13、SDK 36、Build Tools 36.0.0、NDK r28c,并使用最低支持的 Xmake 3.1.1 验证构建;本地允许使用更新的 Xmake。Gradle 使用工程内的 Wrapper,原生构建器固定 Xmake 包仓库版本。SDK/NDK 使用独立目录缓存,按宿主系统、架构和工具链版本区分;命中缓存时跳过 SDK 安装,未命中时在安装完成后立即保存,即使后续 APK 构建失败,下次也可复用。Xmake 可执行环境、固定版本的包仓库和 pip 下载也有各自的缓存;Ubuntu 系统工具只安装缺失项。
Gradle 缓存与 Android 原生依赖缓存分别管理;原生缓存按宿主架构、构建脚本及 MiniRTC 配方区分,不复用桌面或 iOS 的配置和目标文件。GitHub 托管 runner 每次启动仍是新环境;第一次运行或缓存失效时需要安装。不同分支和标签可读取默认分支的缓存,因此建议先在默认分支运行一次 `Build Android` 预热,再创建发布标签。
+1 -1
View File
@@ -1,5 +1,5 @@
set_project("crossdesk_android")
set_xmakever("3.0.0")
set_xmakever("3.1.1")
set_languages("c++17")
add_rules("mode.release", "mode.debug")
set_policy("package.precompiled", false)
+1 -1
View File
@@ -12,7 +12,7 @@ ROOT = ANDROID.parents[1]
SOURCE = ROOT / 'deps/submodules/minirtc'
CACHE = ANDROID / '.native'
PACKAGE_REVISION = 'eda39de3fb99b420c168f1ab9ab2d1791e11b662'
XMAKE_MIN_VERSION = (3, 0, 0)
XMAKE_MIN_VERSION = (3, 1, 1)
def find_xmake():
+7 -8
View File
@@ -18,16 +18,15 @@ class XmakeSelectionTest(unittest.TestCase):
for patcher in (
patch.dict(os.environ, {}, clear=True),
patch.object(build_native.shutil, "which", return_value="/tools/xmake"),
patch.object(build_native.subprocess, "check_output", return_value="xmake v3.0.0\n"),
patch.object(build_native.subprocess, "check_output", return_value="xmake v3.1.1\n"),
):
patcher.start()
self.addCleanup(patcher.stop)
def test_path_tool_accepts_minimum_and_newer_versions(self):
for output in ("xmake v3.0.0", "xmake v3.0.1\n", "xmake v3.0.9\n", "xmake v3.0.99\n",
"xmake v3.1.0\n", "xmake v3.1.1\n", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
for output in ("xmake v3.1.1", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
"xmake v3.2.0\n", "xmake v3.10.0\n", "xmake v4.0.0\n",
"\x1b[1mxmake v3.0.0+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
"\x1b[1mxmake v3.1.1+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
with self.subTest(output=output):
build_native.subprocess.check_output.return_value = output
self.assertEqual(build_native.find_xmake(), "/tools/xmake")
@@ -41,16 +40,16 @@ class XmakeSelectionTest(unittest.TestCase):
def test_missing_tool_reports_minimum_requirement(self):
build_native.shutil.which.return_value = None
with self.assertRaisesRegex(SystemExit, "Xmake 3.0.0 or newer is required"):
with self.assertRaisesRegex(SystemExit, "Xmake 3.1.1 or newer is required"):
build_native.find_xmake()
build_native.subprocess.check_output.assert_not_called()
def test_older_or_unrecognized_versions_are_rejected(self):
for output in ("xmake v2.9.9\n", "xmake v2.99.99\n",
"xmake version unknown\n", "xmake v3.0\n", "xmake v3.0.0invalid\n", ""):
for output in ("xmake v3.1.0\n", "xmake v3.0.99\n", "xmake v2.99.99\n",
"xmake version unknown\n", "xmake v3.1\n", "xmake v3.1.1invalid\n", ""):
with self.subTest(output=output):
build_native.subprocess.check_output.return_value = output
with self.assertRaisesRegex(SystemExit, "Use Xmake 3.0.0 or newer"):
with self.assertRaisesRegex(SystemExit, "Use Xmake 3.1.1 or newer"):
build_native.find_xmake()
+3 -3
View File
@@ -7,7 +7,7 @@ There is no `WKWebView` or browser runtime.
## Requirements
- Xcode 16 or newer
- Xmake 3.0.0 or newer available on `PATH` (or selected with `XMAKE_BIN`)
- Xmake 3.1.1 or newer available on `PATH` (or selected with `XMAKE_BIN`)
- A physical arm64 iPhone/iPad running iOS 16 or newer, or an iOS simulator on Apple Silicon
## Build
@@ -27,7 +27,7 @@ licenses** when cloning: `git clone --branch <source-tag> --recurse-submodules
https://github.com/kunkundi/crossdesk.git`. The iOS marketing version is independent
of the repository tag; use the source tag or commit recorded in the app.
Install [Xmake](https://xmake.io/guide/quick-start.html) 3.0.0 or newer,
Install [Xmake](https://xmake.io/guide/quick-start.html) 3.1.1 or newer,
CMake, and a current Python 3 with setuptools/wheel. Pin the package repository
in a separate Xmake global directory before building:
@@ -105,7 +105,7 @@ or relevant build configuration also trigger it. The main
workflow on branch/tag pushes and manual runs, and waits for its result before
publishing a version-tag release.
The workflow builds with the minimum supported Xmake version (3.0.0) and retains
The workflow builds with the minimum supported Xmake version (3.1.1) and retains
the pinned Xcode/SDK, dependency cache, license catalog validation, unsigned arm64
Release build, and app-bundle verification. Unit tests run locally as needed.
It uploads
+1 -1
View File
@@ -900,7 +900,7 @@
],
"bundle_sha256": "f54e5e2168bf6e91d81a413931a052d29f59e0c221df5e1de3f51bd27c662c3a",
"toolchain": {
"xmake_min_version": "3.0.0",
"xmake_min_version": "3.1.1",
"xmake_repository_revision": "121109352da272cd1a3d4ed52f2dcda34f839955"
}
}
+6 -7
View File
@@ -52,7 +52,7 @@ class LicenseValidationTest(unittest.TestCase):
self.target.write_text(str(self.root / "packages/a/asio/1.0/abcd/include") + "\n")
self.lock = {
"bundle_sha256": licenses.digest(self.bundle.read_bytes()),
"toolchain": {"xmake_min_version": "3.0.0"},
"toolchain": {"xmake_min_version": "3.1.1"},
"components": [
{
"id": "minirtc", "version": self.reviewed_revision,
@@ -151,21 +151,20 @@ class LicenseValidationTest(unittest.TestCase):
def test_minimum_and_newer_xmake_versions_are_accepted(self):
version = self.root / "xmake-version.txt"
for output in ("xmake v3.0.0", "xmake v3.0.1\n", "xmake v3.0.9\n", "xmake v3.0.99\n",
"xmake v3.1.0\n", "xmake v3.1.1\n", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
for output in ("xmake v3.1.1", "xmake v3.1.2\n", "xmake v3.1.10, A build utility\n",
"xmake v3.2.0\n", "xmake v3.10.0\n", "xmake v4.0.0\n",
"\x1b[1mxmake v3.0.0+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
"\x1b[1mxmake v3.1.1+HEAD.3ba37a0d4, A build utility\x1b[0m\n"):
with self.subTest(output=output):
version.write_text(output)
self.verify(xmake_version=version)
def test_older_or_unrecognized_xmake_versions_are_rejected(self):
version = self.root / "xmake-version.txt"
for output in ("xmake v2.9.9\n", "xmake v2.99.99\n",
"xmake version unknown\n", "xmake v3.0\n", "xmake v3.0.0invalid\n", ""):
for output in ("xmake v3.1.0\n", "xmake v3.0.99\n", "xmake v2.99.99\n",
"xmake version unknown\n", "xmake v3.1\n", "xmake v3.1.1invalid\n", ""):
with self.subTest(output=output):
version.write_text(output)
with self.assertRaisesRegex(ValueError, "Xmake 3.0.0 or newer is required"):
with self.assertRaisesRegex(ValueError, "Xmake 3.1.1 or newer is required"):
self.verify(xmake_version=version)
+1 -1
View File
@@ -5,7 +5,7 @@ FROM ${BASE_IMAGE}
ARG TARGETARCH
ARG CMAKE_VERSION=3.31.6
ARG XMAKE_VERSION=3.0.0
ARG XMAKE_VERSION=3.1.1
ARG RUST_VERSION=1.92.0
ARG RUSTUP_VERSION=1.28.2
+4 -4
View File
@@ -5,14 +5,14 @@ CMake 3.31、xmake、Rust、Linux 开发库(包括 D-Bus、DRM,以及仅用
PipeWire 0.3/SPA 头文件 SDK)以及根据项目
`xmake.lua` 提前编译好的依赖。
Xmake 最低支持 3.0.0,与移动端一致,构建环境校验允许更新版本。发布镜像的工具链 tag
Xmake 最低支持 3.1.1,与移动端一致,构建环境校验允许更新版本。发布镜像的工具链 tag
记录实际安装的版本;默认使用最低支持版本验证构建。
常规应用构建目前复用已发布的 `xmake3.0.9` 工具链镜像,并在容器启动后检查
Xmake 版本:缺失或低于 3.0.0 时安装或升级,达标时保留现有版本,随后再次校验。
Xmake 版本:缺失或低于 3.1.1 时安装或升级,达标时保留现有版本,随后再次校验。
Linux、macOS 和 Windows 桌面构建共用 `.github/actions/ensure-xmake`;Linux 还会
执行仓库中的 `verify-build-image.sh` 校验环境。这样既保留预编译
依赖缓存,也不依赖尚未发布的 `xmake3.0.0` 镜像。切换镜像 tag 前必须确认
依赖缓存,也不依赖尚未发布的 `xmake3.1.1` 镜像。切换镜像 tag 前必须确认
amd64 和 arm64 变体均已发布。
## 发布方式
@@ -22,7 +22,7 @@ amd64 和 arm64 变体均已发布。
全部通过后再合并为同一个 multi-arch 镜像:
```text
crossdesk/ubuntu20.04:buildenv-cuda12.6.3-gcc10-cmake3.31.6-pipewire0.3.48-xmake3.0.0-rust1.92.0
crossdesk/ubuntu20.04:buildenv-cuda12.6.3-gcc10-cmake3.31.6-pipewire0.3.48-xmake3.1.1-rust1.92.0
```
Docker 会根据运行机器自动选择正确架构。amd64 变体以
+1 -1
View File
@@ -3,7 +3,7 @@ set -euo pipefail
EXPECTED_ARCH="${EXPECTED_ARCH:-}"
EXPECTED_CMAKE_VERSION="${EXPECTED_CMAKE_VERSION:-3.31.6}"
XMAKE_MIN_VERSION="${XMAKE_MIN_VERSION:-3.0.0}"
XMAKE_MIN_VERSION="${XMAKE_MIN_VERSION:-3.1.1}"
EXPECTED_RUST_VERSION="${EXPECTED_RUST_VERSION:-1.92.0}"
BUILD_CC="${CC:-/usr/bin/gcc-10}"
BUILD_CXX="${CXX:-/usr/bin/g++-10}"
+2 -2
View File
@@ -6,7 +6,7 @@
## 构建依赖
- Git、[Xmake](https://xmake.io/guide/quick-start.html)(桌面端和移动端均要求 3.0.0 或更新版本)及下文对应平台的编译工具链。
- Git、[Xmake](https://xmake.io/guide/quick-start.html)(桌面端和移动端均要求 3.1.1 或更新版本)及下文对应平台的编译工具链。
- 构建脚本通过 Xmake 管理 **CMake 3.x(≥ 3.21、< 4.0)**、**Rust 1.92.0** 等依赖;首次构建需要下载工具与源码。具体约束见 [Slint 包配置](../deps/thirdparty/slint/xmake.lua)。
## Windows
@@ -248,6 +248,6 @@ README 的桌面图片直接由当前 Slint UI 渲染,复现方式见 [截图
## Android
原生控制端位于独立的 `apps/android` Gradle 工程,要求 Android 8.0+ arm64 设备,使用 SDK 36、NDK r28c 和 Xmake 3.0.0 或更新版本。构建、APK 安装与模拟器测试见 [Android 开发说明](../apps/android/README.md)。
原生控制端位于独立的 `apps/android` Gradle 工程,要求 Android 8.0+ arm64 设备,使用 SDK 36、NDK r28c 和 Xmake 3.1.1 或更新版本。构建、APK 安装与模拟器测试见 [Android 开发说明](../apps/android/README.md)。
[Android CI](../.github/workflows/build-android.yml) 可独立手动运行,并由主构建工作流调用。CI 提供 Debug / 设备测试 APK、未签名 Release APK 和 Lint 报告,执行原生协议测试及 16 KB 对齐、许可证检查;标签发布收集未签名 Release APK,安装前需要自行签名。设备测试需要另行在 arm64 手机或模拟器上执行。
+2 -2
View File
@@ -6,7 +6,7 @@ After cloning, run build and packaging commands from the repository root. The [X
## Build requirements
- Git, [Xmake](https://xmake.io/guide/quick-start.html) (3.0.0 or newer for both desktop and mobile), and the platform toolchain listed below.
- Git, [Xmake](https://xmake.io/guide/quick-start.html) (3.1.1 or newer for both desktop and mobile), and the platform toolchain listed below.
- The build scripts use Xmake to manage **CMake 3.x (≥ 3.21, < 4.0)**, **Rust 1.92.0**, and other dependencies. The first build downloads tools and source archives. See the [Slint package configuration](../deps/thirdparty/slint/xmake.lua) for the constraints.
## Windows
@@ -260,6 +260,6 @@ Desktop README images are rendered directly from the current Slint UI. See the [
## Android
The native controller is a separate Gradle project in `apps/android`, targeting Android 8.0+ arm64 with SDK 36, NDK r28c, and Xmake 3.0.0 or newer. See the [Android development guide](../apps/android/README.md) for APK builds, installation, and emulator tests.
The native controller is a separate Gradle project in `apps/android`, targeting Android 8.0+ arm64 with SDK 36, NDK r28c, and Xmake 3.1.1 or newer. See the [Android development guide](../apps/android/README.md) for APK builds, installation, and emulator tests.
[Android CI](../.github/workflows/build-android.yml) can run manually on its own and is also called by the main build workflow. It uploads Debug/device-test APKs, an unsigned Release APK and Lint reports, runs native protocol tests, and checks 16 KB alignment and license contents. Tag releases include the unsigned Release APK, which requires your own signing before installation. Device tests must be run separately on an arm64 phone or emulator.
+1 -1
View File
@@ -1,5 +1,5 @@
set_project("crossdesk")
set_xmakever("3.0.0")
set_xmakever("3.1.1")
set_license("GPL-3.0-only")
local source_dir = os.getenv("CROSSDESK_SOURCE_DIR") or os.scriptdir()