From fa486c2b76cf092be4b8fb3f3b0467f21433710a Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 3 Jun 2026 18:20:35 +0900 Subject: [PATCH 1/5] chore: build musl release target --- scripts/release.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index 2863dcc..ce2b355 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -4,10 +4,8 @@ import subprocess import tarfile from pathlib import Path - from prebuild import get_pyapp, rebuild_cpython - root = Path(__file__).resolve().parents[1] output = root.joinpath("dist") build_dir = root.joinpath("build") @@ -17,6 +15,7 @@ wheel = builder.build("wheel", output_directory=output) stem = Path(wheel).stem tarname = f"{stem}.tar.gz" + metadata = stem.split("-") appname = metadata[0] version = metadata[1] @@ -44,9 +43,18 @@ env["PYAPP_FULL_ISOLATION"] = "true" env["PYAPP_DISTRIBUTION_PATH"] = str(cpython) env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3" -proc = subprocess.run(["cargo", "build", "--release"], env=env, cwd=pyapp_dir) +target = "x86_64-unknown-linux-musl" +build_params = [ "cargo", "build", "--release", "--target", target] + +proc = subprocess.run( + build_params, + env=env, + cwd=pyapp_dir, +) + +# TODO: set proper release tags on tarfile if proc.returncode == 0: - output_exe = build_dir.joinpath("pyapp-latest/target/release/pyapp") + output_exe = build_dir.joinpath(f"pyapp-latest/target/{target}/release/pyapp") release_exe = output.joinpath(appname) output_exe.rename(release_exe) tarpath = output.joinpath(tarname) From 41b0e86fdaa3a4a5e9662cb7017ecdaaebf14c41 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Wed, 3 Jun 2026 19:35:30 +0900 Subject: [PATCH 2/5] docs: update DEVELOPERS.md --- DEVELOPERS.md | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/DEVELOPERS.md b/DEVELOPERS.md index 609fa8a..886aae1 100644 --- a/DEVELOPERS.md +++ b/DEVELOPERS.md @@ -13,11 +13,6 @@ git submodule update --recursive --init sphinx-build -M html source build -a # Building standalone DZGUI release binaries -1. Run `./scripts/dl_pyapp.sh` -# TODO: secondary script that packs this archive -2. Download cpython 3.13, linux, gnu, v3 -https://github.com/astral-sh/python-build-standalone/releases/download/20251014/cpython-3.13.9%2B20251014-x86_64_v3-unknown-linux-gnu-install_only_stripped.tar.gz -3. Explicitly install dependencies into site-packages -4. Pack back into a tarball -5. Run `python3 scripts/release.py` -6. Generate a release and tag against the bundled `dzgui` executable +1. Set up the build target: `rustup target add x86_64-unknown-linux-musl` +2. Run `python3 scripts/release.py` +3. Generate a release and tag against the bundled `dzgui` executable From 63a853af7c124ab833922e1a89811f740e4fde7c Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 4 Jun 2026 14:12:09 +0900 Subject: [PATCH 3/5] chore: update build flags --- scripts/release.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index ce2b355..e488948 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -7,11 +7,11 @@ from pathlib import Path from prebuild import get_pyapp, rebuild_cpython root = Path(__file__).resolve().parents[1] -output = root.joinpath("dist") +dist_dir = root.joinpath("dist") build_dir = root.joinpath("build") builder = build.ProjectBuilder(root) -wheel = builder.build("wheel", output_directory=output) +wheel = builder.build("wheel", output_directory=dist_dir) stem = Path(wheel).stem tarname = f"{stem}.tar.gz" @@ -24,6 +24,7 @@ pyapp_dir = build_dir.joinpath("pyapp-latest") if pyapp_dir.is_dir() is False: get_pyapp() +# TODO: rename version and filepath from subscript packaged_version = rebuild_cpython() assert packaged_version == version cpython = build_dir.joinpath("airgapped.tar.gz") @@ -43,8 +44,8 @@ env["PYAPP_FULL_ISOLATION"] = "true" env["PYAPP_DISTRIBUTION_PATH"] = str(cpython) env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3" -target = "x86_64-unknown-linux-musl" -build_params = [ "cargo", "build", "--release", "--target", target] +platform = "x86_64-unknown-linux-musl" +build_params = ["cargo", "build", "--release", "--target-dir", str(dist_dir), "--target", platform] proc = subprocess.run( build_params, @@ -54,10 +55,11 @@ proc = subprocess.run( # TODO: set proper release tags on tarfile if proc.returncode == 0: - output_exe = build_dir.joinpath(f"pyapp-latest/target/{target}/release/pyapp") - release_exe = output.joinpath(appname) + output_exe = dist_dir.joinpath("pyapp") + release_exe = dist_dir.joinpath(appname) output_exe.rename(release_exe) - tarpath = output.joinpath(tarname) + + tarpath = dist_dir.joinpath(tarname) with tarfile.open(tarpath, "w:gz") as tar: info = tar.gettarinfo(release_exe) info.uname = appname From 5b90068fe4b41edc994c9a13dd5347562cde3d93 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:26:53 +0900 Subject: [PATCH 4/5] chore: wrap line --- scripts/release.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/release.py b/scripts/release.py index e488948..d39703a 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -45,7 +45,15 @@ env["PYAPP_DISTRIBUTION_PATH"] = str(cpython) env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3" platform = "x86_64-unknown-linux-musl" -build_params = ["cargo", "build", "--release", "--target-dir", str(dist_dir), "--target", platform] +build_params = [ + "cargo", + "build", + "--release", + "--target-dir", + str(dist_dir), + "--target", + platform, +] proc = subprocess.run( build_params, From 8edb38f175f75f94cac805a88608c501e3ad2eec Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Thu, 4 Jun 2026 19:37:49 +0900 Subject: [PATCH 5/5] fix: use correct platform compat tags --- scripts/release.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/scripts/release.py b/scripts/release.py index df6a56a..1d0b45c 100644 --- a/scripts/release.py +++ b/scripts/release.py @@ -10,11 +10,13 @@ from concat_licenses import concat_license from parse_toml import get_entrypoint from prebuild import get_pyapp, rebuild_cpython + def update_uname(info: tarfile.TarInfo) -> tarfile.TarInfo: info.uname = "dzgui" info.gname = "users" return info + root = Path(__file__).resolve().parents[1] dist_dir = root.joinpath("dist") build_dir = root.joinpath("build") @@ -52,7 +54,8 @@ env["PYAPP_DISTRIBUTION_PATH"] = str(cpython) env["PYAPP_DISTRIBUTION_PYTHON_PATH"] = "python/bin/python3" platform = "x86_64-unknown-linux-musl" -tarname = f"{appname}-{platform}.tar.gz" +build_name = f"{appname}-{version}-{platform}" +tarname = f"{build_name}.tar.gz" tarpath = dist_dir.joinpath(tarname) build_params = [ @@ -74,13 +77,13 @@ proc = subprocess.run( if proc.returncode != 0: sys.exit(1) -output_exe = dist_dir.joinpath("pyapp") -release_exe = dist_dir.joinpath(appname) -output_exe.rename(release_exe) - -subfolder = output.joinpath(stem) +subfolder = dist_dir.joinpath(build_name) subfolder.mkdir(parents=True) +output_exe = dist_dir.joinpath("pyapp") +release_exe = subfolder.joinpath(appname) +output_exe.rename(release_exe) + combined_licenses = concat_license() license_file = subfolder.joinpath("LICENSE") license_file.write_text(combined_licenses) @@ -97,4 +100,4 @@ assert proc.stdout.rstrip() == version release_exe.unlink() license_file.unlink() subfolder.rmdir() -Path(wheel).unlink() \ No newline at end of file +Path(wheel).unlink()