mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 18:13:23 +09:00
[Fix] (CI): restore hosted builds and pin CMake 3.31.10
This commit is contained in:
@@ -16,16 +16,16 @@ def normalize(text, old_root, new_root, cmake_root, hardware=False, icd=None):
|
||||
lambda m: cmake_root + '/Modules/' + m[1], text)
|
||||
lines = []
|
||||
for line in text.splitlines(keepends=True):
|
||||
if re.search(r'ENVIRONMENT|LABELS', line):
|
||||
# GoogleTest discovery receives list properties, not one value with
|
||||
# escaped separators. Otherwise BACKEND becomes "DirectVulkan;...".
|
||||
line = line.replace('\\;', ';')
|
||||
# Keep list escaping intact. All CI builders and consumers use CMake
|
||||
# 3.31.10, whose GoogleTest module needs these escaped separators.
|
||||
if icd:
|
||||
line = re.sub(r'VK_ICD_FILENAMES=[^;"\]\s]+', 'VK_ICD_FILENAMES=' + icd, line)
|
||||
line = re.sub(r'VK_ICD_FILENAMES=[^;\\"\]\s]+', 'VK_ICD_FILENAMES=' + icd, line)
|
||||
if hardware:
|
||||
for value in ('LIBGL_ALWAYS_SOFTWARE=1', 'MESA_GL_VERSION_OVERRIDE=3.3',
|
||||
'MESA_GLSL_VERSION_OVERRIDE=330'):
|
||||
line = line.replace(value + ';', '').replace(';' + value, '').replace(value, '')
|
||||
line = re.sub(re.escape(value) + r'\\*;', '', line)
|
||||
line = re.sub(r'\\*;' + re.escape(value), '', line)
|
||||
line = line.replace(value, '')
|
||||
lines.append(line)
|
||||
return ''.join(lines)
|
||||
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
# CPU runners may be GitHub-hosted or self-hosted; the artifact ABI stays Ubuntu.
|
||||
test -f /.dockerenv
|
||||
. /etc/os-release
|
||||
test "$ID" = ubuntu && test "$VERSION_ID" = 24.04
|
||||
apt-get update
|
||||
apt-get install -y curl gnupg tar xz-utils zstd build-essential gh jq unzip zip wget pkg-config cmake
|
||||
curl --fail --silent --show-error https://apt.llvm.org/llvm-snapshot.gpg.key \
|
||||
| gpg --dearmor -o /usr/share/keyrings/llvm-archive-keyring.gpg
|
||||
echo 'deb [signed-by=/usr/share/keyrings/llvm-archive-keyring.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-20 main' \
|
||||
> /etc/apt/sources.list.d/llvm.list
|
||||
apt-get update
|
||||
apt-get install -y libc++1-20 libc++abi1-20 libunwind-20
|
||||
@@ -15,11 +15,10 @@ spec.loader.exec_module(runtime)
|
||||
|
||||
|
||||
class MetadataTest(unittest.TestCase):
|
||||
def test_environment_and_labels_are_lists(self):
|
||||
def test_legacy_environment_and_labels_escaping_is_preserved(self):
|
||||
text = r'[[ENVIRONMENT]] [[MOBILEGL_BACKEND_TYPE=DirectVulkan\;MOBILEGL_TRANSPORT=inproc]] [[LABELS]] [[gpu\;split]]'
|
||||
fixed = runtime.normalize(text, '', '/new', '/cmake')
|
||||
self.assertNotIn(r'\;', fixed)
|
||||
self.assertIn('DirectVulkan;MOBILEGL_TRANSPORT=inproc', fixed)
|
||||
self.assertEqual(fixed, text)
|
||||
|
||||
def test_other_escaped_values_are_preserved(self):
|
||||
text = r'COMMAND "argument\;with-semicolon"'
|
||||
@@ -41,6 +40,11 @@ class MetadataTest(unittest.TestCase):
|
||||
self.assertNotIn('VERSION_OVERRIDE', fixed)
|
||||
self.assertIn('LIBGL_ALWAYS_SOFTWARE=1', runtime.normalize(text, '', '/new', '/cmake'))
|
||||
|
||||
def test_hardware_driver_change_preserves_legacy_separators(self):
|
||||
text = r'ENVIRONMENT "A=x\;VK_ICD_FILENAMES=/lvp.json\;LIBGL_ALWAYS_SOFTWARE=1\;B=y"'
|
||||
fixed = runtime.normalize(text, '', '/new', '/cmake', True, '/dzn.json')
|
||||
self.assertEqual(fixed, r'ENVIRONMENT "A=x\;VK_ICD_FILENAMES=/dzn.json\;B=y"')
|
||||
|
||||
def test_preparation_is_idempotent_and_drops_discovery_cache(self):
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
root = Path(folder)
|
||||
@@ -55,6 +59,8 @@ class MetadataTest(unittest.TestCase):
|
||||
|
||||
@unittest.skipUnless(os.name == 'posix' and shutil.which('cmake'), 'requires POSIX CMake')
|
||||
def test_real_ctest_discovery_separates_environment(self):
|
||||
version = subprocess.check_output(['cmake', '--version'], text=True).splitlines()[0]
|
||||
self.assertIn('3.31.10', version, 'CI must use its pinned legacy GoogleTest discovery version')
|
||||
with tempfile.TemporaryDirectory() as folder:
|
||||
root = Path(folder)
|
||||
probe = root / 'probe.py'
|
||||
|
||||
Reference in New Issue
Block a user