Skip to content

Commit 7861002

Browse files
authored
fix(build): use supported AppImage compression (#2499)
1 parent ae674be commit 7861002

3 files changed

Lines changed: 31 additions & 2 deletions

File tree

packages/browseros/bos_build/steps/package/linux_packaging/system.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ def build_appimage(
8888
) -> None:
8989
env = os.environ.copy()
9090
env["ARCH"] = architecture
91+
# The pinned 1.9.1 tools bundle a zstd-only mksquashfs implementation.
9192
self._run(
92-
(str(tool), "--comp", "gzip", str(appdir), str(output)),
93+
(str(tool), "--comp", "zstd", str(appdir), str(output)),
9394
env=env,
9495
)
9596

packages/browseros/bos_build/steps/package/linux_packaging_test.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,34 @@ def extract_deb_control(self, package: Path, destination: Path) -> None:
250250

251251

252252
class LinuxToolchainAdapterTest(unittest.TestCase):
253+
def test_appimagetool_uses_compressor_supported_by_pinned_tool(self) -> None:
254+
completed = SimpleNamespace(returncode=0, stdout="", stderr="")
255+
with (
256+
mock.patch.dict(os.environ, {}, clear=True),
257+
mock.patch(
258+
"bos_build.steps.package.linux_packaging.system.subprocess.run",
259+
return_value=completed,
260+
) as run,
261+
):
262+
SubprocessLinuxToolchain().build_appimage(
263+
Path("/tools/appimagetool"),
264+
Path("/staging/AppDir"),
265+
Path("/dist/BrowserOS.AppImage"),
266+
"x86_64",
267+
)
268+
269+
self.assertEqual(
270+
run.call_args.args[0],
271+
(
272+
"/tools/appimagetool",
273+
"--comp",
274+
"zstd",
275+
"/staging/AppDir",
276+
"/dist/BrowserOS.AppImage",
277+
),
278+
)
279+
self.assertEqual(run.call_args.kwargs["env"]["ARCH"], "x86_64")
280+
253281
def test_ldd_uses_a_stable_locale_and_checks_both_output_streams(self) -> None:
254282
completed = SimpleNamespace(
255283
returncode=0,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
BROWSEROS_MAJOR=0
22
BROWSEROS_MINOR=50
33
BROWSEROS_BUILD=0
4-
BROWSEROS_PATCH=2
4+
BROWSEROS_PATCH=3

0 commit comments

Comments
 (0)