[fix] lower minimum Xmake version to 3.0.0

This commit is contained in:
dijunkun
2026-10-08 15:48:34 +08:00
parent 5af7cc35e9
commit f335f274ab
19 changed files with 52 additions and 49 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.1.1." >&2
echo "XMAKE_MIN_VERSION must be a numeric major.minor.patch version, for example 3.0.0." >&2
exit 2
fi
+10 -9
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.1.1", status=0, arguments=()):
def check(self, version_output=None, *, minimum="3.0.0", status=0, arguments=()):
with tempfile.TemporaryDirectory(prefix="crossdesk-xmake-check-") as directory:
root = Path(directory)
output_file = root / "github-output"
@@ -63,7 +63,8 @@ class XmakeVersionCheckTest(unittest.TestCase):
return result, outputs, invocation
def test_keeps_minimum_and_newer_versions(self):
for version in ("3.1.1", "3.1.2", "3.1.10", "3.2.0", "3.10.0", "4.0.0"):
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"):
with self.subTest(version=version):
result, outputs, invocation = self.check(f"xmake v{version}\n")
self.assertEqual(result.returncode, 0, result.stderr)
@@ -73,12 +74,12 @@ class XmakeVersionCheckTest(unittest.TestCase):
self.assertIn("Keeping installed Xmake", result.stdout)
def test_older_versions_require_upgrade(self):
for version in ("3.1.0", "3.0.99", "2.99.99"):
for version in ("2.9.9", "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.1.1 or newer", result.stdout)
self.assertIn("Install Xmake 3.0.0 or newer", result.stdout)
def test_components_are_compared_numerically(self):
for installed, minimum, expected in (
@@ -110,8 +111,8 @@ class XmakeVersionCheckTest(unittest.TestCase):
("", 0),
("xmake version unknown\n", 0),
("xmake v3.1\n", 0),
("xmake v3.1.1invalid\n", 0),
("xmake v3.1.1-rc.1\n", 0),
("xmake v3.0.0invalid\n", 0),
("xmake v3.0.0-rc.1\n", 0),
("otherxmake v9.9.9\n", 0),
)
for output, status in cases:
@@ -120,16 +121,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.1.1 or newer", result.stdout)
self.assertIn("Install Xmake 3.0.0 or newer", result.stdout)
def test_verification_fails_when_install_did_not_provide_required_version(self):
for output, status in ((None, 0), ("xmake v3.1.0", 0), ("unknown", 0), ("xmake v3.1.1", 5)):
for output, status in ((None, 0), ("xmake v2.99.99", 0), ("unknown", 0), ("xmake v3.0.0", 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.1.1 or newer", result.stderr)
self.assertIn("3.0.0 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.1.1"
XMAKE_MIN_VERSION: "3.0.0"
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.1.1 and pins
# Cache installed packages only. build_native.py checks Xmake >= 3.0.0 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.1.1"
XMAKE_MIN_VERSION: "3.0.0"
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.1.1-rust1.92.0
STACK_TAG: buildenv-cuda12.6.3-gcc10-cmake3.31.6-pipewire0.3.48-xmake3.0.0-rust1.92.0
CMAKE_VERSION: 3.31.6
XMAKE_VERSION: 3.1.1
XMAKE_VERSION: 3.0.0
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.1.1"
XMAKE_MIN_VERSION: "3.0.0"
jobs:
build-linux: