mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-20 21:35:59 +00:00
CI builds the MaliBridge client as a component
The components job checks out external/MaliBridge and builds the guest ICD, its manifest and the self-test as the vkbridge recipe; a submodule counts in a recipe's identity by its pinned commit.
This commit is contained in:
1 parent
a69ce00b6a
commit
c883ce4439
5 files changed
+57
No files matched your search
@@ -35,6 +35,9 @@ def identity(name, root=ROOT):
|
||||
for name_ in sorted(set(paths)):
|
||||
if '__pycache__' in name_ or name_.endswith(('.pyc', '.md')):
|
||||
continue
|
||||
if (root / name_).is_dir():
|
||||
values[name_] = subprocess.check_output(['git', 'ls-files', '--stage', '--', name_], cwd=root, text=True).split()[1]
|
||||
continue
|
||||
content = (root / name_).read_bytes()
|
||||
if b'\0' not in content:
|
||||
content = content.replace(b'\r\n', b'\n')
|
||||
|
||||
@@ -222,5 +222,20 @@
|
||||
"cmake",
|
||||
"xz-utils"
|
||||
]
|
||||
},
|
||||
"vkbridge": {
|
||||
"script": "tools/components/recipes/vkbridge.sh",
|
||||
"inputs": [
|
||||
"external/MaliBridge",
|
||||
"tools/components/recipes/vkbridge.sh"
|
||||
],
|
||||
"outputs": [
|
||||
"app/src/main/assets/linuxfs/usr/local/lib/vkbridge/libvulkan_droidbridge.so",
|
||||
"app/src/main/assets/linuxfs/usr/local/share/vkbridge/droidbridge_icd.json",
|
||||
"app/src/main/assets/linuxfs/usr/local/bin/droiddeck-vkbridge-smoke"
|
||||
],
|
||||
"packages": [
|
||||
"gcc-aarch64-linux-gnu"
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
test -f external/MaliBridge/scripts/build-client-linux.sh
|
||||
bash external/MaliBridge/scripts/build-client-linux.sh app/src/main/assets/linuxfs aarch64-linux-gnu-gcc
|
||||
@@ -57,6 +57,26 @@ class ComponentPrepareTest(unittest.TestCase):
|
||||
script.write_text(script.read_text() + '\nprintf changed\n')
|
||||
self.assertNotEqual(changed, components.identity('fake', self.root))
|
||||
|
||||
def test_identity_follows_a_submodule_commit(self):
|
||||
library = self.root / 'library'
|
||||
subprocess.run(['git', 'init', '-q', str(library)], check=True)
|
||||
def commit(text):
|
||||
(library / 'source.c').write_text(text)
|
||||
subprocess.run(['git', '-C', str(library), 'add', '.'], check=True)
|
||||
subprocess.run(['git', '-C', str(library), '-c', 'user.name=Test Developer', '-c', 'user.email=test@example.test',
|
||||
'commit', '-qm', text], check=True)
|
||||
return subprocess.check_output(['git', '-C', str(library), 'rev-parse', 'HEAD'], text=True).strip()
|
||||
first = commit('int a;\n')
|
||||
subprocess.run(['git', '-C', str(self.root), 'add', 'library'], check=True)
|
||||
spec = dict(script='tools/components/recipes/fake.sh', inputs=['library'], outputs=[])
|
||||
(self.root / components.REGISTRY).write_text(json.dumps(dict(fake=spec)))
|
||||
original = components.identity('fake', self.root)
|
||||
commit('int b;\n')
|
||||
self.assertEqual(original, components.identity('fake', self.root))
|
||||
subprocess.run(['git', '-C', str(self.root), 'add', 'library'], check=True)
|
||||
self.assertNotEqual(original, components.identity('fake', self.root))
|
||||
self.assertNotEqual(first, subprocess.check_output(['git', '-C', str(library), 'rev-parse', 'HEAD'], text=True).strip())
|
||||
|
||||
def test_tool_requirements_are_installed_in_one_union(self):
|
||||
definitions = dict(one=dict(packages=['gcc', 'cmake']), two=dict(packages=['gcc', 'qemu-user']))
|
||||
with patch.object(components, 'registry', return_value=definitions), patch.object(components.subprocess, 'run') as run:
|
||||
|
||||
Reference in new issue
Block a user