Build the phone-tested Breeze 2.1.51 application for the Focal OpenStore runtime

This commit is contained in:
waozi committed 2026-10-27 01:17:52 -03:00
commit 882c1a5cad
5 files changed
+113 -44

No files matched your search

+36 -39
View File
@@ -31,9 +31,18 @@ permissions:
jobs:
publish:
runs-on: ubuntu-24.04
# The published focal channel must use Focal's ARM64 libc and libraries.
container: clickable/ci-20.04-arm64@sha256:c6227ffcdb2abb50101a8469dd2a8df3ffd9208e04a3e07e351db63d36bec5d6
defaults:
run:
shell: bash
timeout-minutes: 90
env:
DEBIAN_FRONTEND: noninteractive
# Ziran runs on the builder; only Click artifacts use the cross compiler.
CC: gcc
CXX: g++
OPENSTORE_API_KEY: ${{ secrets.OPENSTORE_API_KEY }}
OPENSTORE_APP_ID: inbe
OPENSTORE_CHANNEL: ${{ github.event.inputs.channel || 'focal' }}
@@ -46,6 +55,27 @@ jobs:
run: |
[[ "$CANDIDATE" =~ ^[0-9a-f]{40}$ ]] || { echo 'An exact commit is required'; exit 1; }
- name: Install the Focal build environment
run: |
set -euo pipefail
apt-get update
apt-get install -y --no-install-recommends \
build-essential binutils-aarch64-linux-gnu ca-certificates ccache \
click curl gcc-aarch64-linux-gnu git git-lfs jq make patchelf \
pkg-config tcl xz-utils zlib1g-dev libbz2-1.0 libffi7 liblzma5 \
libsqlite3-0 libssl-dev \
libdrm-dev:arm64 libegl1-mesa-dev:arm64 libgbm-dev:arm64 \
libgles2-mesa-dev:arm64 libsdl2-dev:arm64 libssl-dev:arm64 zlib1g-dev:arm64
- name: Set up build Python for Focal
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
# Last upstream Actions build that supports Ubuntu 20.04.
python-version: '3.12.10'
- name: Install current build tools
run: python3 -m pip install cmake==3.28.4 fonttools==4.58.5
- name: Checkout
uses: actions/checkout@v4
with:
@@ -62,40 +92,6 @@ jobs:
python3 scripts/check-secrets.py --working-tree
python3 scripts/check-secrets.py --history
- name: Install build dependencies
run: |
sudo dpkg --add-architecture arm64
# Ubuntu's archive/security mirrors only carry amd64/i386; arm64
# lives on ports.ubuntu.com. Pin the stock deb822 sources to amd64
# and add a ports source, otherwise apt-get update 404s on
# binary-arm64 and the install step fails.
sudo sed -i 's/^Types: deb$/Types: deb\nArchitectures: amd64 i386/' /etc/apt/sources.list.d/ubuntu.sources
printf 'Types: deb\nURIs: http://ports.ubuntu.com/ubuntu-ports\nSuites: noble noble-updates noble-backports noble-security\nComponents: main universe restricted multiverse\nArchitectures: arm64\nSigned-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg\n' | sudo tee /etc/apt/sources.list.d/ports-arm64.sources >/dev/null
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
build-essential \
binutils-aarch64-linux-gnu \
ccache \
click \
cmake \
curl \
gcc-aarch64-linux-gnu \
jq \
make \
patchelf \
pkg-config \
python3-fonttools \
tcl \
zlib1g-dev \
libcurl4-openssl-dev:arm64 \
libdrm-dev:arm64 \
libegl-dev:arm64 \
libgbm-dev:arm64 \
libgles-dev:arm64 \
libsdl2-dev:arm64 \
libssl-dev:arm64 \
zlib1g-dev:arm64
- name: Build Click package
run: |
set -euo pipefail
@@ -105,7 +101,7 @@ jobs:
export AARCH64_CC="$(command -v aarch64-linux-gnu-gcc)"
export AARCH64_AR="$(command -v aarch64-linux-gnu-ar)"
export AARCH64_RANLIB="$(command -v aarch64-linux-gnu-ranlib)"
export AARCH64_PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig
export AARCH64_PKG_CONFIG_PATH=/opt/sdl/lib/pkgconfig:/usr/lib/aarch64-linux-gnu/pkgconfig:/usr/share/pkgconfig
export PKG_CONFIG_LIBDIR="$AARCH64_PKG_CONFIG_PATH"
export AARCH64_RAY_SDL_CFLAGS="$(pkg-config --cflags sdl2)"
export AARCH64_RAY_SDL_LDLIBS="$(pkg-config --libs sdl2)"
@@ -113,11 +109,10 @@ jobs:
export AARCH64_RAY_GL_LDLIBS="$(pkg-config --libs libdrm gbm egl glesv2)"
export AARCH64_RAY_CFLAGS="$AARCH64_RAY_SDL_CFLAGS $AARCH64_RAY_GL_CFLAGS"
export AARCH64_RAY_LDLIBS="$AARCH64_RAY_SDL_LDLIBS $AARCH64_RAY_GL_LDLIBS"
export AARCH64_RAY_SDL_INCLUDE_DIR=/usr/include/SDL2
export AARCH64_KRYON_CURL_CFLAGS="$(pkg-config --cflags libcurl)"
export AARCH64_KRYON_CURL_LDLIBS="$(pkg-config --libs libcurl)"
export AARCH64_CLICK_RUNTIME_LIBS="/usr/lib/aarch64-linux-gnu/libSDL2-2.0.so.0 /usr/lib/aarch64-linux-gnu/libcurl.so.4 /usr/lib/aarch64-linux-gnu/libssl.so.3 /usr/lib/aarch64-linux-gnu/libcrypto.so.3 /usr/lib/aarch64-linux-gnu/libdrm.so.2 /usr/lib/aarch64-linux-gnu/libgbm.so.1 /usr/lib/aarch64-linux-gnu/libEGL.so.1 /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 /usr/lib/aarch64-linux-gnu/libz.so.1"
export AARCH64_RAY_SDL_INCLUDE_DIR="$(pkg-config --variable=includedir sdl2)/SDL2"
export AARCH64_CLICK_RUNTIME_LIBS="$(pkg-config --variable=libdir sdl2)/libSDL2-2.0.so.0 /usr/lib/aarch64-linux-gnu/libssl.so.1.1 /usr/lib/aarch64-linux-gnu/libcrypto.so.1.1 /usr/lib/aarch64-linux-gnu/libdrm.so.2 /usr/lib/aarch64-linux-gnu/libgbm.so.1 /usr/lib/aarch64-linux-gnu/libEGL.so.1 /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 /usr/lib/aarch64-linux-gnu/libz.so.1"
make CLICK_ARCH=arm64 click
python3 scripts/check-click-abi.py build/dist/click/*.click
- name: Show package contents
run: |
@@ -145,5 +140,7 @@ jobs:
if: ${{ !inputs.build_only }}
run: |
set -euo pipefail
version="$(python3 scripts/check-version.py --print-version)"
python3 scripts/check-phone-check.py "$version" --revision "$(git rev-parse HEAD)"
click_file="$(ls -t build/dist/click/*.click | head -1)"
scripts/publish-openstore.sh "$click_file"
+27 -2
View File
@@ -23,6 +23,30 @@ GENERATED_CLICK_C = $(shell find $(CLICK_GEN_DIR) -type f -name '*.c' 2>/dev/nul
CLICK_APP_INCLUDE = $(filter-out -iquote$(KRY_GEN_DIR)%,$(APP_INCLUDE)) \
-iquote$(CLICK_GEN_DIR) \
$(foreach dir,$(sort $(dir $(ZI_SRCS))),-iquote$(CLICK_GEN_DIR)/$(dir))
CLICK_CURL_BUILD_DIR := $(VENDOR_BUILD_DIR)/click/$(CLICK_ARCH)/curl
CLICK_CURL_A := $(CLICK_CURL_BUILD_DIR)/lib/libcurl.a
# Focal's system curl predates WebSocket support. Build the locked curl for
# the same target as the app rather than borrowing a newer distribution's ABI.
$(CLICK_CURL_A): $(KRYON_CURL_DIR)/CMakeLists.txt mk/packaging.mk
$(CMAKE) -S $(KRYON_CURL_DIR) -B $(CLICK_CURL_BUILD_DIR) \
-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_C_COMPILER=$(AARCH64_CC) \
-DCMAKE_AR=$(AARCH64_AR) -DCMAKE_RANLIB=$(AARCH64_RANLIB) \
-DCMAKE_BUILD_TYPE=MinSizeRel \
-DCMAKE_INSTALL_PREFIX=$(abspath $(CLICK_CURL_BUILD_DIR)) \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON \
-DCURL_USE_OPENSSL=ON -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF \
-DCURL_USE_GSSAPI=OFF -DUSE_NGHTTP2=OFF -DUSE_LIBIDN2=OFF \
-DCURL_DISABLE_LDAP=ON -DCURL_DISABLE_LDAPS=ON -DCURL_DISABLE_SMB=ON \
-DENABLE_CURL_MANUAL=OFF -DBUILD_EXAMPLES=OFF \
-DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DBUILD_TESTING=OFF \
$(KRYON_CURL_EXTRA_CMAKE_FLAGS)
$(CMAKE) --build $(CLICK_CURL_BUILD_DIR) --target libcurl_static --parallel 2
$(CMAKE) --install $(CLICK_CURL_BUILD_DIR)
@sh $(CLICK_CURL_BUILD_DIR)/bin/curl-config --protocols | grep -Eq '(^|[[:space:]])WS([[:space:]]|$$)'
@sh $(CLICK_CURL_BUILD_DIR)/bin/curl-config --protocols | grep -Eq '(^|[[:space:]])WSS([[:space:]]|$$)'
$(CLICK_GEN_STAMP): Makefile mk/packaging.mk ziran.lock $(ZI2C_BIN) $(ZI_SRCS) $(KRYON_ZI_MODULES) $(GAME2D_MODULES) $(DAOCHI_CLIENT_MODULES) $(wildcard build/packages/entity/src/*.zi) $(ZIRAN_STD_MODULES) $(SYNC_RETRY_SOURCE) | build-laws zi-check
rm -rf $(CLICK_GEN_DIR)
@@ -78,8 +102,9 @@ $(CLICK_LIBOQS_A): $(LIBOQS_DIR)/CMakeLists.txt mk/sync.mk Makefile
-DOQS_MINIMAL_BUILD="$(KRYON_LIBOQS_MINIMAL_BUILD)"
$(CMAKE) --build $(CLICK_LIBOQS_BUILD_DIR) --target oqs
$(CLICK_BIN): Makefile mk/packaging.mk $(APP_SRCS) $(CLICK_GEN_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_FILES) $(EMBEDDED_ASSETS_C) $(CLICK_RAYLIB_A) $(CLICK_LIBOQS_A) | $(CLICK_BIN_DIR)
$(CLICK_BIN): Makefile mk/packaging.mk $(APP_SRCS) $(CLICK_GEN_STAMP) $(SQLITE_SRC) $(SQLITE_AMALGAMATION_H) $(FONT_FILES) $(EMBEDDED_ASSETS_C) $(CLICK_RAYLIB_A) $(CLICK_LIBOQS_A) $(CLICK_CURL_A) | $(CLICK_BIN_DIR)
$(AARCH64_CC) $(CLICK_CFLAGS) \
-DCURL_STATICLIB -I$(CLICK_CURL_BUILD_DIR)/include \
$(CLICK_APP_INCLUDE) \
$(KRYON_INCLUDE) \
$(SQLITE_INCLUDE) \
@@ -97,7 +122,7 @@ $(CLICK_BIN): Makefile mk/packaging.mk $(APP_SRCS) $(CLICK_GEN_STAMP) $(SQLITE_S
$(CLICK_RAYLIB_A) \
$(CLICK_LIBOQS_A) \
$(AARCH64_RAY_LDLIBS) \
$(AARCH64_KRYON_CURL_LDLIBS) \
$(CLICK_CURL_A) -lssl -lcrypto \
-lm -lpthread -ldl -lrt -latomic -lz \
$(LDFLAGS)
@if command -v patchelf >/dev/null; then \
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env python3
"""Reject Click binaries that require a newer runtime than their framework."""
import argparse
import json
from pathlib import Path
import re
import subprocess
import tempfile
def verify(package):
with tempfile.TemporaryDirectory(prefix="click-abi-") as temporary:
root = Path(temporary)
subprocess.run(["dpkg-deb", "-x", str(package), str(root)], check=True)
subprocess.run(["dpkg-deb", "-e", str(package), str(root / "DEBIAN")], check=True)
manifest = json.loads((root / "DEBIAN/manifest").read_text())
if manifest["framework"] != "ubuntu-sdk-20.04" or manifest["architecture"] != "arm64":
raise ValueError("expected the ARM64 ubuntu-sdk-20.04 package")
checked = 0
for path in sorted(root.rglob("*")):
if not path.is_file() or path.is_symlink():
continue
with path.open("rb") as stream:
if stream.read(4) != b"\x7fELF":
continue
relative = path.relative_to(root)
header = subprocess.check_output(["readelf", "-h", str(path)], text=True)
if not re.search(r"Machine:\s+AArch64\b", header):
raise ValueError(f"{relative}: expected an AArch64 ELF")
versions = subprocess.check_output(["readelf", "--version-info", str(path)], text=True)
required = [tuple(map(int, match.split(".")))
for match in re.findall(r"\bGLIBC_(\d+\.\d+(?:\.\d+)?)\b", versions)]
newest = max(required, default=(0, 0))
if newest > (2, 31):
raise ValueError(f"{relative}: GLIBC_{'.'.join(map(str, newest))} exceeds Focal's 2.31")
print(f"{relative}: ARM64, newest GLIBC_{'.'.join(map(str, newest))}")
checked += 1
if not checked:
raise ValueError("package contains no ELF executables or libraries")
print(f"Click ABI: {checked} ELF files match the Focal ARM64 framework")
if __name__ == "__main__":
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("package", type=Path)
verify(parser.parse_args().package.resolve())
+2 -2
View File
@@ -158,8 +158,8 @@
"name": "Inbe"
},
"toolchain": {
"commit": "5efa24f818485cf265bdd5c066a4e2150175ac0e",
"ref": "master",
"commit": "5a1ce92f921be670c9777b7d46fa86ead3062519",
"ref": "5a1ce92f921be670c9777b7d46fa86ead3062519",
"url": "https://github.com/ziranlang/ziran.git"
}
}
+1 -1
View File
@@ -5,7 +5,7 @@ module_roots = ["src", "src/apps", "src/app", "src/core", "src/habits", "src/pra
[toolchain]
git = "https://github.com/ziranlang/ziran.git"
ref = "master"
ref = "5a1ce92f921be670c9777b7d46fa86ead3062519"
[dependencies.kryon]
git = "https://github.com/kryonlabs/kryon.git"