Compare commits

...
1 Commits
Author SHA1 Message Date
waozi 7854da88e2 Hash the shared controller on Python 3.10
Stream SHA-256 in bounded chunks instead of using hashlib.file_digest,
which is unavailable on Ubuntu 22.04's Python 3.10. Keep the controller
payload and trusted manifest digest unchanged.

Local test: build-queue -- python3 with hashlib.file_digest removed,
running tests/ui_build_test.py. Both consumer and standalone builds pass.
2026-11-16 23:57:59 -03:00
+4 -1
View File
@@ -29,7 +29,10 @@ subprocess.run([str(args.compiler.resolve()), 'bundle', '--project', *flags,
'--root', str(ROOT / 'ui'), '--entry', entry, '--define', 'KRYON_HOSTED_UI',
'-o', str(WORK / 'apps.zx'), str(ROOT / 'ui/apps.zi')], cwd=project, check=True)
with (WORK / 'apps.zx').open('rb') as stream:
digest = hashlib.file_digest(stream, 'sha256').hexdigest()
digest_state = hashlib.sha256()
for chunk in iter(lambda: stream.read(1024 * 1024), b''):
digest_state.update(chunk)
digest = digest_state.hexdigest()
(WORK / 'apps.sha256').write_text(digest + '\n')
(WORK / 'manifest.json').write_text(json.dumps(dict(id='apps', protocol='app/1', sha256=digest), indent=2) + '\n')
print(f'Built shared Apps UI and trusted digest in {WORK}')