mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-19 04:46:08 +00:00
ESync, FSync, NTSync + OpenNow + FEX for Desktop Apps (#197)
* Make the Compatible Proton ARM64 the default and label compatible builds
The CompatToolMapping "0" default always points at DroidDeck's Proton
ARM64 tool, and per-game picks of adopted GE/CachyOS builds are kept,
including when the shortcuts writer remaps.
The tool is named after the Proton build it runs, Proton Experimental
ARM64 (Compatible), or Proton 11.0 ARM64 (Compatible) once that newer build
is installed. Adopted builds carry the same Compatible mark, read from a
string resource the app stages into the runtime, and the Proton page
explains which builds have the prefix fixes.
The registrar is renamed steam-compatibility and the tool
droiddeck-proton-arm64. Existing installs migrate on the next session: the
old tool directory is removed, every mapping that named it moves to the new
tool, and the retired bannerlator-steam-compat script is removed from the
runtime. CI and local packaging include the renamed script.
* Drop the duplicate R import left by merging main
* Add userspace ntsync for Proton on Android
Android kernels have no /dev/ntsync and its app policy refuses futex_waitv,
so every Proton 11 build here fell back to wineserver for every wait.
libblsession now serves /dev/ntsync itself: wineserver opens a memfd region,
each sync object is a timerfd that carries its slot, and the kernel ntsync
ioctls are answered in shared memory with futexes, following the kernel
driver's wake order. Valve's Proton Experimental ARM64, GE-Proton and
proton-cachyos use it unchanged.
Locks record their owner so a killed process cannot wedge the others,
signals are held off inside each critical section, dead processes and
exiting threads are swept, and object lifetimes follow close, dup2, dup3,
close_range and received descriptors.
Fast sync is on by default under Performance > Session fixes, and
PROTON_NO_NTSYNC=1 turns it off per game.
* Add droiddeck-esync as the default sync for Proton on Android
Without a kernel ntsync driver, Proton 11 builds here fell back to
wineserver for every wait. droiddeck-esync brings eventfd and shared-memory
sync to the exact Proton build a game runs on: a pack holds that build's
ntdll.so and wineserver with the patch series in tools/droiddeck-esync
applied, and the guest runs Proton from a shadow tree that links the stock
tool and swaps in those two files. A wineserver from a pack still prefers
/dev/ntsync when a kernel driver or droiddeck-ntsync is there.
Packs are built in Valve's SDK image from each release's own wine source
(Proton Experimental ARM64 tags, GE-Proton and proton-cachyos releases); the
control build must reproduce the release binaries byte for byte, and a
signed index lists the packs. The APK bundles the packs pinned in
release.env, the app fetches newer ones, and Steam's compatibility tool
picks the pack for each Proton build, so new Proton releases get packs
without an app update.
The ntdll side reads, writes and polls its eventfds with raw system calls,
so the guest's LD_PRELOAD wrappers stay out of the sync path. The server
abandons a mutex once a thread killed by TerminateThread has really exited
and when its process dies, and a mutex's owner and recursion count change
in one atomic step, so a killed owner cannot touch the next owner's count.
droiddeck-esync is on by default and PROTON_NO_ESYNC=1 turns it off per
game; droiddeck-ntsync, the userspace ntsync, is now an opt-in toggle.
* Watch Valve's Proton releases and build droiddeck-esync packs for them
A scheduled workflow reads the Proton ARM64 builds Steam ships (anonymous
steamcmd app info) and the upstream source tags, compares them with the
previous watch state and starts the pack build for any build that has no
pack yet. The pack build applies the patch series with --fuzz=0 and runs a
smoke test of each new pack against the esstress suite before it is
published.
* Add droiddeck-fsync, keep Steam and the app on one Proton, fix DirectAudio
droiddeck-fsync: libblsession answers futex_waitv(2), which the app
sandbox refuses, in userspace, so Proton's own fsync runs on the stock
Proton files with no pack. Waiters register the words they wait on in a
table beside the fsync shared memory and sleep on a futex of their own;
FUTEX_WAKE on the fsync memory wakes the registered waiters. Slots carry
one owner word that the sweeper and the owner claim with a CAS, and the
mapping table is rebuilt under a lock held across the real munmap, so a
reused address or a recycled slot cannot lose a waiter. It stands in for
a Proton build without a pack (droiddeck-ntsync where fsync is off), takes
over for games with esync off, and the "droiddeck-fsync first" toggle
(BL_FSYNC_FIRST, also per game) puts it ahead of the packs. The games
Proton keeps off fsync and esync never get it. A launch into a prefix
whose wineserver is still running keeps that server's sync choice.
One Proton for Steam and the app: the Components page's Proton is the
default Steam uses, applied live through the client while Steam runs
(droiddeck-steam-compat) and at the next start otherwise; a choice made in
Steam's menu comes back to the app. Requests are ordered by a sequence that
never goes backwards, and the page no longer jumps back to the default
after a swap or restore.
DirectAudio: the wrapper wrote the driver key with its backslashes
stripped, so no game ever used DirectAudio. Wine 11 also loads a builtin
only from the prefix, so the driver is now linked into system32 and
syswow64 before "directaudio,pulse" is selected; mmdevapi falls back to
winepulse whenever DirectAudio cannot start.
* Pick esync, ntsync or fsync from the Steam settings' Games group
A three-way tab row above the FEX preset sets the sync Proton games use. It
writes the existing switches together (droiddeck-ntsync, droiddeck-fsync
first, droiddeck-esync), so the Performance toggles and the tabs always agree,
starts on esync and keeps the choice until it is changed again.
* Make droiddeck-fsync the default sync for Proton games
A fresh install, or one that never picked a sync, starts on fsync; a choice made
in the Steam settings' Games group still sticks. Games Proton keeps off fsync
still fall back to droiddeck-esync.
* Add wineserver to the Wine sync tabs and order them ntsync, fsync, esync, wineserver
wineserver turns every in-process sync off so games wait through wineserver;
picking any other tab turns sync back on. The tabs shrink to fit a narrow pane.
* Shorten the Wine sync description
* Answer openat2 and execveat for FEX in the session preload
FEX opens every file of its x86 rootfs with openat2(RESOLVE_IN_ROOT) and
only falls back to the host path on EXDEV. Under proot on Android openat2
answers ENOSYS, so each lookup of an x86 library silently went to the host
and missed. The exported syscall() now turns openat2 into openat once the
real call reports ENOSYS: RESOLVE_IN_ROOT paths are taken relative to the
root fd (FEX has already resolved the links inside the rootfs), and an
absolute path under RESOLVE_BENEATH fails with EXDEV as the kernel would.
execveat with an absolute path, or relative to AT_FDCWD, and without
AT_EMPTY_PATH or AT_SYMLINK_NOFOLLOW, is plain execve; it is sent as such
because proot refuses execveat with a directory fd, which FEX uses when it
re-executes itself for a child x86 program.
* Run x86 Linux games and programs through FEX
Steam: Linux-only titles that have no ARM64 build (from the client's
appinfo cache: type game, demo, application or beta) are mapped to a new
compatibility tool, droiddeck-fex ("Linux x86 (FEX)", linux to linux,
no required runtime). Valve's own "fex" tool needs pressure-vessel, which
cannot run under proot, so a mapping to it or to a Steam Linux Runtime is
replaced; any other pick the user made stays. Titles that also ship for
Windows stay on Proton. When such a title is installed and FEX or the
sniper runtime is missing, the client is asked to install them.
droiddeck-fex runs the program under the FEX that Steam installs (app
3127680), with Steam Linux Runtime 3.0 (sniper, app 1628350) as the x86
rootfs:
- the sniper platform is linked in place from its usr-mtree (relative
links only, files/usr -> .), once per runtime version;
- the x86_64 and i386 builds of libblsession and libfakeinput go into the
runtime's lib/<triplet>/droiddeck and its etc/ld.so.preload, mirroring
the session's own list, so x86 programs get the pads and the session
fixes (FEX passes their system calls straight to the kernel, so the
ARM64 preloads cannot reach them);
- Config.json sets RootFS and the GL and Vulkan thunks, so x86 games draw
with the device's Turnip and Mesa;
- the FEX preset and the game's own environment from the Steam settings
apply, and ARM64 entries are dropped from LD_PRELOAD/LD_LIBRARY_PATH.
It also links ~/.steam/sdk64 and sdk32 to the client's x86 steamclient
when the client has one and nothing is there yet.
Desktop: x86_64 and i386 AppImages can be imported now; they unpack
through FEX (or unsquashfs) and record their architecture. Scripts,
AppImages and programs started in a run session use FEX automatically
when they are x86, and each added app has a "Use FEX" Auto/On/Off choice
in its edit dialog. The launchers' "still running" checks also look at
FEX processes, whose exe is FEX rather than the program. A GitHub release
without an ARM64 AppImage falls back to its x86_64 one. Decky's x86
loader starts through droiddeck-fex instead of the fex-mesa rootfs path,
which no runtime ships.
The x86 preloads are built against glibc 2.31 (Debian 11) so they load
in sniper: tools/linuxfs/build-x86-preloads.sh, run in CI and by
build_local.sh. fakeinput's stat hooks fall back to __xstat on a glibc
without a stat export, and mmap64 takes off64_t for the i386 build.
* Keep a FEX unixlib from outliving its DLL
A FEX package or original bundle without the aarch64-unix helpers left
the previous version's libarm64ecfex.so / libwow64fex.so in the Proton,
so the new DLLs loaded a unixlib built for another FEX. A swap now removes
the helpers the package does not carry; FEX then runs DLL-only, which it
already falls back to when Wine cannot load the unixlib.
* Fix the Wine sync choices an audit found
- wineserver tab: it passed Proton's environment through, so a build with
esync built in (GE, cachyos) still ran esync and a kernel ntsync would
still be used. It now sets PROTON_NO_ESYNC, PROTON_NO_FSYNC and
PROTON_NO_NTSYNC (unless the game's own environment sets them).
- ntsync tab: a Proton whose wineserver has no /dev/ntsync client got
wineserver-only sync although fsync would work. The hash cache records
whether the wineserver has one; without it the launch goes to
droiddeck-fsync, and no stand-in or pack turns droiddeck-ntsync on.
- A build with esync built in returned before the per-game fallbacks, so
a game that turns esync off ran with no in-process sync. It now gets
droiddeck-fsync, or droiddeck-ntsync where fsync is off too.
- When a pack's proton cannot start and the stock one is used, or the
selection fails, the prefix's record now says stock, so a second
launch into the same running prefix no longer picks the pack's ntdll.
- droiddeck-fsync: its mutex is held across fork and re-made in the
child, a closed or replaced shm fd is forgotten (close, dup2, dup3,
close_range, closefrom), and a waiter woken while it was leaving on a
timeout or signal reports the wake instead of losing it.
- BL_SYNC_MIN_NOFILE applies per game to every verb, debug logs carry
prefixes.json, the device report names the chosen sync instead of the
three raw switches, and PATCHES.md and the proot notes describe the
selector, the fsync default and droiddeck-fsync's futex_waitv.
* Name the runtime's scripts and files droiddeck, migrating old installs
The guest scripts are droiddeck-* now (droiddeck-session and the other 19),
as are the files the app and scripts generate (etc/droiddeck, the network
state files, the components dir, the Steam install stamp, the redist marker,
the extra-Proton wrapper and backups) and the compositor's own names
(libdroiddeckwayland, droiddeck_* sources, DROIDDECK_* switches, the
wl_output and seat names).
Installed runtimes carry on: LegacyNames moves etc/bannerlator and
share/bannerlator over and leaves relative links at the old paths before
every proot command, turns any old script into a link to its new name,
moves the generated files and points menu entries at the new scripts.
The session scripts and steam-compatibility move their markers on first
use, the components dir's desired.tsv is rewritten with it, and the
runtime counts as installed under either session script.
Kept: the banner_ahb_v1/banner_desktop_v1 wire names and BANNER_AUDIO_DIRECT
(read by prebuilt Turnip and Wine builds), Banners-Turnip and other
third-party names, BL_* switches, libblsession, and credits to Bannerlator.
* Unpack x86 AppImages without FEX, then ask Steam for FEX
Importing an x86 AppImage failed when FEX was not installed yet ("needs FEX
to unpack and no unsquashfs is installed"). AppImages now unpack with
uruntime (VHSgunzo, MIT, v0.8.1 aarch64, pinned by sha256 and shipped
unmodified with its licence), which reads SquashFS and DwarFS images of any
architecture natively. FEX's own --appimage-extract and unsquashfs stay as
fallbacks, and an ARM64 image whose own runtime cannot unpack it goes the
same way.
An x86 import with FEX missing records that FEX is wanted, so the next
Steam session requests FEX and the Steam Linux Runtime, and the program's
page says FEX is not set up yet and how to get it.
* Run Vulkan Qt Quick AppImages on Wayland
OpenNOW (Qt 6.8, Qt Quick on Vulkan) closed within two seconds in a run
mode. The session sends toolkits to gamescope's Xwayland, and Qt's xcb
backend only presents with Vulkan when Mesa's X11 WSI does, which needs
DRI3; Xwayland on KGSL has none, so Qt found no queue that can present and
aborted ("Failed to create RHI").
An AppImage that bundles Qt Quick, the Vulkan loader and Qt's Wayland
plugin now runs on gamescope's Wayland socket (the desktop's, outside
gamescope), where Turnip presents as it does for games, with Qt's xcb
backend as the fallback. SDL_VIDEODRIVER and XDG_SESSION_TYPE follow, so
helpers that pick their window system from them (OpenNOW's streamer) agree
with Qt. Everything else stays on X11; a qt file in the app's directory
(wayland or xcb) overrides the choice.
* Keep gamescope's WSI layer away from Qt apps on its Wayland socket
OpenNOW still closed at once: its FFmpeg (the Raspberry Pi fork, libavutil
61) creates its Vulkan queues internally synchronized whenever the driver
offers VK_KHR_internally_synchronized_queues, which DD-Turnip does. The
gamescope WSI layer registers every queue of a new device through
vkGetDeviceQueue, which only returns queues created without flags, so it
got VK_NULL_HANDLE and vkroots aborted on assert(obj) before Qt opened a
window.
Programs that draw on gamescope's Wayland socket do not need the layer,
which only carries X11 windows past Xwayland, so it is turned off for
them. OpenNOW bundles no Vulkan loader (it reaches Vulkan through Qt and
dlopen), so a binary that uses QVulkanInstance counts as a Vulkan app too,
and a Qt Quick app left on X11 says why in the session log.
* Keep the end of the session log, and say when FEX is missing
The session sends its output through head -c into session.log. head
writes through stdio, so it held up to 4 KB that proot's --kill-on-exit
threw away when the guest ended: every log stopped mid-line at a 4096-byte
boundary, losing exactly the lines that say why a program quit (an x86
AppImage's "x86 Linux programs need FEX" among them). dd writes each read
as it comes and keeps the same cap.
A run mode always ends with status 0 (gamescope does not pass its child's
on), so a program that could not start just closed. When the log says FEX
is missing, the ended screen now says so and how to get it.
The app reads FEX's readiness from status.json, which only a launch or an
import wrote, so it still said "not set up" after Steam installed FEX.
droiddeck-fex status rewrites it, and a Steam session ends with it while
FEX is wanted. FEX is also looked for at the tool's root and under files/,
and a tool folder without it lists what it holds.
* Let FEX and its runtime install runnable on an SD card library
A Steam library on shared storage loses the executable bits, so native
tools are staged in private directories bound over it; only Proton and
SteamLinuxRuntime folders were. FEX (3127680) installed there could never
run, droiddeck-fex saw no FEX and kept asking Steam for it. FEX and the
sniper runtime (1628350) now get private directories from their first
download, whatever their install folder is called.
* Keep fsync off in the pack smoke test
A runner whose kernel allows futex_waitv started stock Proton with fsync,
so the server-side baseline never said what the test waits for and every
pack was waved through as untestable; the esync run would have measured
fsync too.
* Judge a pack against stock's own esstress failures
Stock Proton fails esstress's dup wait all under server-side sync as well
(a Wine bug, seen on the phone too), and any stock failure made the test
call the runner unusable. A pack now fails only when it crashes, hangs or
fails a check stock passes.
* Ask Steam for FEX and its runtime one at a time
Both steam://install requests were started together, and the running client
took only the first: FEX installed, the sniper runtime FEX needs never did.
Each request now waits for the client to take it before the next.
* Bundle the first published droiddeck-esync packs in the apk
* Log how an x86 program under FEX ends
FEX keeps its own errors quiet unless asked, so a program it could not run
left nothing in the session log. Its log now goes to stderr, and the AppImage
launcher records the program's exit status or the signal that ended it.
* Show the log a failed AppImage program wrote
Programs like Eden stop themselves on a failed check and say why only in
their own log under the home folder. When the program ends badly, the end of
any log it wrote during the run is copied into the session log.
* Report where an x86 program under FEX hit an illegal instruction
A tiny x86_64 preload, built without libc, catches SIGILL and writes the
address, the instruction bytes and the mapping they belong to before the
program dies as it would have. droiddeck-fex preloads it into x86_64 programs.
* Load the fault reporter from the x86 runtime
Programs under FEX look libraries up in the x86 runtime, so the reporter is
copied there with the other preloads and named by its path inside it.
* Hand FEX its x86 runtime and thunks through the environment
Valve's FEX runs portable and reads its config beside itself, so the
Config.json droiddeck-fex writes was not seen: programs ran without the
runtime. The runtime, thunk libraries and thunk list now also go in FEX's
own environment variables, and each launch says what it was given.
* Use the sync pack built for the installed Proton release
Some Proton releases ship byte-identical ntdll.so and wineserver (Valve
11.0-2b/2c, CachyOS 0702/0703), so a pack built for a newer release
matched an older install exactly and the older install never fetched its
own pack. A pack from a newer release no longer counts as an exact match;
among matches the one built for the installed version wins, then rev.
The app ranks the pack a tool already uses the same way and only fetches
a pack that ranks higher, reads the release epoch from tools.tsv and
refetches when tools.tsv changes. A prefix whose server is still running
re-checks its recorded pack on waitforexitandrun and starts fresh when a
better one now applies.
* Keep published sync packs and revocations consistent
The publish step never replaces a pack that has an entry beside it; a
pack left without its entry by an interrupted run is replaced so the
build stops repeating. Discovery counts revocations the signed index does
not show yet, including superseded packs only the flavor releases list,
so the index is signed again. The release watch always builds every
flavor.
* Fetch the droiddeck-esync packs from DroidDeck-Components
The packs, the signed index and the apk bundle now live in the releases
of Droid-Deck/DroidDeck-Components, together with the pipeline that
builds them, so this repository keeps only the app and the guest code
that consumes them. The app's index and asset URLs point there,
release.env names the repository its bundle comes from, and the apk
builds drop bundled packs that the published index revokes.
* Stop the apk build when the published sync index cannot be read
* Ask Steam for one FEX dependency at a time
The client shows a confirmation dialog for each steam://install, and a
second request replaces the first dialog, so FEX was never installed
when the runtime was requested right after it. The next dependency is
now requested once the previous one has an app manifest.
* Use generic names in the AppImage test fixtures
* Give x86-64 apps under FEX the Vulkan thunk
Apps that bring their own glibc and Vulkan loader skipped FEX's thunk
overlay and loaded their bundled desktop Mesa drivers, which crash on the
phone's GPU during Vulkan setup. droiddeck-fex now adds an x86-64 audit
module when a program's bundled glibc and libstdc++ meet the thunk's
version needs. The module sends libvulkan.so.1 lookups to a nodelete stub
that needs FEX's thunk path. That keeps the thunk mapped when an app
unloads Vulkan and loads it again, since FEX keeps its first trampoline
links and the old addresses get reused.
The fault reporter now restores the default action before re-raising,
because FEX ignores SA_RESETHAND and the handler looped.
This commit is contained in:
1 parent
84bc7d9948
commit
27782068a3
165 files changed
+11709
-9667
No files matched your search
@@ -1,449 +0,0 @@
|
||||
name: Build droiddeck-esync packs
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '17 5 * * *'
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths:
|
||||
- 'tools/droiddeck-esync/**'
|
||||
- '.github/workflows/build-droiddeck-esync-packs.yml'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
flavor:
|
||||
description: 'Proton flavor to look at'
|
||||
type: choice
|
||||
options: [ all, valve, ge, cachyos ]
|
||||
default: all
|
||||
ref:
|
||||
description: 'One release tag to build (e.g. GE-Proton11-7); empty = the newest builds of each family'
|
||||
required: false
|
||||
default: ''
|
||||
publish:
|
||||
description: 'Publish the packs and sign a new index'
|
||||
type: boolean
|
||||
default: false
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
concurrency:
|
||||
group: droiddeck-esync-packs-${{ (github.repository == 'Droid-Deck/DroidDeck' && github.ref == 'refs/heads/main' && (github.event_name != 'workflow_dispatch' || inputs.publish)) && 'publish' || format('build-{0}', github.run_id) }}
|
||||
cancel-in-progress: false
|
||||
|
||||
env:
|
||||
SYNC_BASE_URL: https://github.com/Droid-Deck/DroidDeck/releases/download
|
||||
|
||||
jobs:
|
||||
discover:
|
||||
if: ${{ github.repository == 'Droid-Deck/DroidDeck' || github.event_name == 'workflow_dispatch' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
permissions:
|
||||
contents: read
|
||||
outputs:
|
||||
matrix: ${{ steps.discover.outputs.matrix }}
|
||||
count: ${{ steps.discover.outputs.count }}
|
||||
unindexed: ${{ steps.discover.outputs.unindexed }}
|
||||
publish: ${{ steps.discover.outputs.publish }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Find the Proton builds without a pack
|
||||
id: discover
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
FLAVOR: ${{ inputs.flavor || 'all' }}
|
||||
REF: ${{ inputs.ref }}
|
||||
ASKED: ${{ github.event_name != 'workflow_dispatch' || inputs.publish }}
|
||||
PUBLISH: ${{ github.repository == 'Droid-Deck/DroidDeck' && github.ref == 'refs/heads/main' && (github.event_name != 'workflow_dispatch' || inputs.publish) }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ "$ASKED" = true ] && [ "$PUBLISH" != true ]; then
|
||||
echo "::notice::packs are published only from main of Droid-Deck/DroidDeck; this run only builds them"
|
||||
fi
|
||||
echo "publish=$PUBLISH" >> "$GITHUB_OUTPUT"
|
||||
python3 tools/droiddeck-esync/discover.py matrix --flavor "$FLAVOR" --ref "$REF" \
|
||||
--index-release droiddeck-esync-index --repo "$GITHUB_REPOSITORY" --revoked tools/droiddeck-esync/revoked.txt
|
||||
|
||||
build:
|
||||
name: ${{ matrix.flavor }} ${{ matrix.tag }}
|
||||
needs: discover
|
||||
if: needs.discover.outputs.count != '0'
|
||||
runs-on: ubuntu-24.04-arm
|
||||
timeout-minutes: 360
|
||||
permissions:
|
||||
contents: read
|
||||
strategy:
|
||||
fail-fast: false
|
||||
max-parallel: 2
|
||||
matrix: ${{ fromJSON(needs.discover.outputs.matrix) }}
|
||||
env:
|
||||
FLAVOR: ${{ matrix.flavor }}
|
||||
REPO: ${{ matrix.repo }}
|
||||
TAG: ${{ matrix.tag }}
|
||||
ASSET: ${{ matrix.asset }}
|
||||
VERSION_TOKEN: ${{ matrix.token }}
|
||||
DEPOT_APP: ${{ matrix.depot_app }}
|
||||
REV: ${{ matrix.rev }}
|
||||
SERIES: ${{ matrix.series }}
|
||||
PROFILE: ${{ matrix.profile }}
|
||||
SOURCE_MATCH: ${{ matrix.source_match }}
|
||||
SUBMODULES: ${{ matrix.submodules }}
|
||||
CLONE: ${{ matrix.clone }}
|
||||
PREP: ${{ matrix.prep }}
|
||||
BUILD_DIR: ${{ matrix.build_dir }}
|
||||
HAVE_DEPOT_LOGIN: ${{ secrets.STEAM_DEPOT_USER != '' && secrets.STEAM_DEPOT_TOKEN != '' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Check the build script and the patch series
|
||||
run: |
|
||||
set -euo pipefail
|
||||
test -f tools/droiddeck-esync/build-pack.sh
|
||||
ls "tools/droiddeck-esync/patches/$SERIES"/*.patch
|
||||
|
||||
- name: Install the host tools
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq autoconf automake git patch perl python3 rsync unzip wget xz-utils zstd >/dev/null
|
||||
|
||||
- name: Fetch the stock binaries
|
||||
if: matrix.asset != ''
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
rm -rf stock-download stock
|
||||
mkdir -p stock-download stock
|
||||
gh release download "$TAG" -R "$REPO" -p "$ASSET" -D stock-download
|
||||
tar -xf "stock-download/$ASSET" -C stock
|
||||
rm -rf stock-download
|
||||
mapfile -t tops < <(find stock -mindepth 1 -maxdepth 1 -type d)
|
||||
if [ "${#tops[@]}" != 1 ]; then
|
||||
echo "::error::$ASSET does not hold exactly one Proton directory"
|
||||
exit 1
|
||||
fi
|
||||
dir=$(realpath "${tops[0]}")
|
||||
test -f "$dir/files/lib/wine/aarch64-unix/ntdll.so"
|
||||
test -f "$dir/files/bin-arm64/wineserver"
|
||||
line=$(head -n1 "$dir/version" | tr -d '\r')
|
||||
if ! grep -qE '^[0-9]+[[:space:]]+[[:graph:]]+' <<<"$line"; then
|
||||
echo "::error::$ASSET has no usable version file"
|
||||
exit 1
|
||||
fi
|
||||
echo "Stock $line"
|
||||
{
|
||||
echo "STOCK_DIR=$dir"
|
||||
echo "VERSION_LINE=$line"
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: Fetch the stock depot (optional, Valve only, needs STEAM_DEPOT_USER, STEAM_DEPOT_TOKEN and DEPOT_DOWNLOADER_SHA256)
|
||||
if: matrix.flavor == 'valve' && env.HAVE_DEPOT_LOGIN == 'true'
|
||||
continue-on-error: true
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
DEPOT_DOWNLOADER_TAG: DepotDownloader_3.4.0
|
||||
DEPOT_DOWNLOADER_SHA256: ${{ vars.DEPOT_DOWNLOADER_SHA256 }}
|
||||
STEAM_DEPOT_USER: ${{ secrets.STEAM_DEPOT_USER }}
|
||||
STEAM_DEPOT_TOKEN: ${{ secrets.STEAM_DEPOT_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if ! grep -qxE '[0-9a-f]{64}' <<<"$DEPOT_DOWNLOADER_SHA256"; then
|
||||
echo "::warning::set the repository variable DEPOT_DOWNLOADER_SHA256 to the sha256 of DepotDownloader-linux-arm64.zip from $DEPOT_DOWNLOADER_TAG to fetch the depot"
|
||||
exit 0
|
||||
fi
|
||||
rm -rf depotdownloader depot
|
||||
gh release download "$DEPOT_DOWNLOADER_TAG" -R SteamRE/DepotDownloader -p 'DepotDownloader-linux-arm64.zip' -D depotdownloader
|
||||
echo "$DEPOT_DOWNLOADER_SHA256 depotdownloader/DepotDownloader-linux-arm64.zip" | sha256sum -c -
|
||||
unzip -q depotdownloader/DepotDownloader-linux-arm64.zip -d depotdownloader
|
||||
chmod +x depotdownloader/DepotDownloader
|
||||
printf '%s\n' version files/lib/wine/aarch64-unix/ntdll.so files/bin-arm64/wineserver > depot-files.txt
|
||||
timeout 30m depotdownloader/DepotDownloader -app "$DEPOT_APP" -os linux -all-archs \
|
||||
-username "$STEAM_DEPOT_USER" -password "$STEAM_DEPOT_TOKEN" \
|
||||
-filelist depot-files.txt -dir depot </dev/null
|
||||
test -f depot/files/lib/wine/aarch64-unix/ntdll.so
|
||||
test -f depot/files/bin-arm64/wineserver
|
||||
line=$(head -n1 depot/version | tr -d '\r')
|
||||
token=$(awk '{ print $2 }' <<<"$line")
|
||||
if [ "$token" != "$VERSION_TOKEN" ]; then
|
||||
echo "::notice::app $DEPOT_APP is at $token, not $VERSION_TOKEN; this pack matches by source"
|
||||
exit 0
|
||||
fi
|
||||
echo "Depot $line"
|
||||
{
|
||||
echo "STOCK_DIR=$PWD/depot"
|
||||
echo "VERSION_LINE=$line"
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: Prepare the wine source
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git config --global user.name "ci"
|
||||
git config --global user.email "ci@users.noreply.github.com"
|
||||
rm -rf src
|
||||
git init -q src
|
||||
git -C src remote add origin "https://github.com/$REPO.git"
|
||||
git -C src fetch -q --depth 1 origin "refs/tags/$TAG:refs/tags/$TAG"
|
||||
git -C src checkout -q "refs/tags/$TAG"
|
||||
read -r -a modules <<<"$SUBMODULES"
|
||||
case "$CLONE" in
|
||||
shallow) history=(--depth 1) ;;
|
||||
treeless) history=(--filter=tree:0) ;;
|
||||
*) echo "::error::unknown clone mode $CLONE"; exit 1 ;;
|
||||
esac
|
||||
git -C src submodule update -q --init "${history[@]}" -- "${modules[@]}"
|
||||
if [ -n "$PREP" ]; then
|
||||
if ! (cd src && bash "$PREP") > prep.log 2>&1; then
|
||||
tail -n 200 prep.log
|
||||
echo "::error::$PREP failed"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
test -f src/wine/server/protocol.def
|
||||
image=$(python3 tools/droiddeck-esync/discover.py sdk-image src/Makefile.in)
|
||||
commit=$(git -C src rev-parse HEAD)
|
||||
wine_commit=$(git -C src rev-parse HEAD:wine)
|
||||
line=${VERSION_LINE:-}
|
||||
if [ -z "$line" ]; then
|
||||
if [ -z "$VERSION_TOKEN" ]; then
|
||||
echo "::error::no stock version file and no version token for $TAG"
|
||||
exit 1
|
||||
fi
|
||||
line="$(git -C src log -1 --format=%ct HEAD) $VERSION_TOKEN"
|
||||
fi
|
||||
echo "SDK image $image, $REPO $commit, wine $wine_commit, version $line"
|
||||
{
|
||||
echo "SDK_IMAGE=$image"
|
||||
echo "SOURCE_COMMIT=$commit"
|
||||
echo "WINE_COMMIT=$wine_commit"
|
||||
echo "VERSION_LINE=$line"
|
||||
echo "SOURCE_DATE_EPOCH=${line%%[[:space:]]*}"
|
||||
} >> "$GITHUB_ENV"
|
||||
|
||||
- name: Build the control and the patched binaries
|
||||
run: |
|
||||
set -euo pipefail
|
||||
docker pull -q "$SDK_IMAGE"
|
||||
for kind in control patched; do
|
||||
work=$PWD/build/work-$kind
|
||||
out=$PWD/build/$kind
|
||||
sudo rm -rf "$work" "$out"
|
||||
mkdir -p "$work" "$out"
|
||||
if [ "$kind" = patched ]; then
|
||||
bash tools/droiddeck-esync/build-pack.sh prepare "$PWD/src/wine" "$work" "$PWD/tools/droiddeck-esync/patches/$SERIES"
|
||||
else
|
||||
bash tools/droiddeck-esync/build-pack.sh prepare "$PWD/src/wine" "$work"
|
||||
fi
|
||||
docker run --rm \
|
||||
-v "$work:$BUILD_DIR" -v "$out:/out" -v "$PWD/tools/droiddeck-esync/build-pack.sh:/build-pack.sh:ro" \
|
||||
-w "$BUILD_DIR" -e HOME=/tmp -e LANG=C.UTF-8 -e JOBS="$(nproc)" \
|
||||
-e SOURCE_DATE_EPOCH -e SYNC_PROFILE="$PROFILE" \
|
||||
"$SDK_IMAGE" /bin/bash /build-pack.sh build "$BUILD_DIR" /out
|
||||
done
|
||||
sudo chown -R "$(id -u):$(id -g)" build
|
||||
sha256sum build/*/files/lib/wine/aarch64-unix/ntdll.so build/*/files/bin-arm64/wineserver
|
||||
|
||||
- name: Make the pack
|
||||
run: |
|
||||
set -euo pipefail
|
||||
source_json=$(python3 -c 'import json, os; print(json.dumps({"repo": os.environ["REPO"], "ref": os.environ["TAG"], "asset": os.environ["ASSET"], "commit": os.environ["SOURCE_COMMIT"], "wine_commit": os.environ["WINE_COMMIT"], "sdk_image": os.environ["SDK_IMAGE"]}, sort_keys=True))')
|
||||
match=()
|
||||
if [ -z "${STOCK_DIR:-}" ] && [ "$SOURCE_MATCH" = true ]; then
|
||||
match=(--source-match)
|
||||
fi
|
||||
rm -rf out
|
||||
id=$(python3 tools/droiddeck-esync/make_pack.py --flavor "$FLAVOR" --rev "$REV" --stock-dir "${STOCK_DIR:-}" \
|
||||
--version-line "$VERSION_LINE" --control build/control --patched build/patched \
|
||||
--source-json "$source_json" --patch-series "$SERIES" --out out "${match[@]}")
|
||||
echo "Pack \`$id\` from $FLAVOR $TAG" >> "$GITHUB_STEP_SUMMARY"
|
||||
ls -l out
|
||||
|
||||
- name: Smoke-test the pack on the release it was made for
|
||||
if: matrix.asset != ''
|
||||
run: |
|
||||
set -euo pipefail
|
||||
id=$(basename out/*.tzst .tzst)
|
||||
docker run --rm -v "$PWD:/work" -w /work "$SDK_IMAGE" \
|
||||
/opt/llvm-mingw/bin/aarch64-w64-mingw32-clang -O2 -o esstress.exe tools/droiddeck-esync/tests/esstress.c
|
||||
set +e
|
||||
bash tools/droiddeck-esync/smoke-test.sh "$STOCK_DIR" "out/$id.tzst" esstress.exe smoke
|
||||
status=$?
|
||||
set -e
|
||||
case $status in
|
||||
0) echo "Smoke test passed for \`$id\`" >> "$GITHUB_STEP_SUMMARY" ;;
|
||||
3) echo "::warning::stock $TAG does not run on this runner, so $id could not be smoke-tested" ;;
|
||||
*) echo "::error::$id failed the smoke test on $TAG"; exit 1 ;;
|
||||
esac
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: droiddeck-esync-pack-${{ matrix.key }}
|
||||
path: out/
|
||||
if-no-files-found: error
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: failure()
|
||||
with:
|
||||
name: droiddeck-esync-logs-${{ matrix.key }}
|
||||
path: |
|
||||
prep.log
|
||||
build/work-*/*.log
|
||||
smoke/*.log
|
||||
if-no-files-found: ignore
|
||||
|
||||
publish:
|
||||
name: Publish the packs
|
||||
needs: [ discover, build ]
|
||||
if: ${{ !cancelled() && needs.discover.result == 'success' && needs.discover.outputs.publish == 'true' && needs.discover.outputs.count != '0' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: actions/download-artifact@v4
|
||||
with:
|
||||
pattern: droiddeck-esync-pack-*
|
||||
path: packs
|
||||
|
||||
- name: Upload the packs to their releases
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
MATRIX: ${{ needs.discover.outputs.matrix }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p packs
|
||||
python3 tools/droiddeck-esync/discover.py packs --matrix "$MATRIX" packs > packs.tsv
|
||||
if [ ! -s packs.tsv ]; then
|
||||
echo "::notice::no build made a pack"
|
||||
exit 0
|
||||
fi
|
||||
while IFS=$'\t' read -r -u 3 flavor dir id; do
|
||||
tag="droiddeck-esync-$flavor"
|
||||
if ! gh release view "$tag" -R "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
|
||||
gh release create "$tag" -R "$GITHUB_REPOSITORY" --latest=false --prerelease=false --title "$tag" \
|
||||
--notes "droiddeck-esync packs for $flavor Proton builds (tools/droiddeck-esync). The app fetches them through the signed index in the droiddeck-esync-index release." \
|
||||
|| gh release view "$tag" -R "$GITHUB_REPOSITORY" >/dev/null
|
||||
fi
|
||||
gh release upload "$tag" -R "$GITHUB_REPOSITORY" "$dir/$id.tzst" --clobber
|
||||
gh release upload "$tag" -R "$GITHUB_REPOSITORY" "$dir/$id.json" --clobber
|
||||
gh release edit "$tag" -R "$GITHUB_REPOSITORY" --latest=false --prerelease=false
|
||||
echo "Published \`$id\` to $tag" >> "$GITHUB_STEP_SUMMARY"
|
||||
done 3< packs.tsv
|
||||
|
||||
- name: Record the builds that made no pack
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
MATRIX: ${{ needs.discover.outputs.matrix }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p packs failed
|
||||
python3 tools/droiddeck-esync/discover.py failures --matrix "$MATRIX" packs > failed.tsv
|
||||
while IFS=$'\t' read -r -u 3 flavor marker; do
|
||||
tag="droiddeck-esync-$flavor"
|
||||
if ! gh release view "$tag" -R "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
|
||||
gh release create "$tag" -R "$GITHUB_REPOSITORY" --latest=false --prerelease=false --title "$tag" \
|
||||
--notes "droiddeck-esync packs for $flavor Proton builds (tools/droiddeck-esync). The app fetches them through the signed index in the droiddeck-esync-index release." \
|
||||
|| gh release view "$tag" -R "$GITHUB_REPOSITORY" >/dev/null
|
||||
fi
|
||||
echo "$RUN_URL" > "failed/$marker"
|
||||
gh release upload "$tag" -R "$GITHUB_REPOSITORY" "failed/$marker" --clobber
|
||||
echo "::warning::$marker: no pack was made; discovery skips this build for a day unless rev or the patch series changes"
|
||||
done 3< failed.tsv
|
||||
|
||||
index:
|
||||
name: Sign the index
|
||||
needs: [ discover, build, publish ]
|
||||
if: ${{ !cancelled() && needs.discover.result == 'success' && needs.discover.outputs.publish == 'true' && (needs.discover.outputs.count != '0' || needs.discover.outputs.unindexed != '0') }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 30
|
||||
environment: droiddeck-esync-signing
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Collect the published packs
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
fetch() {
|
||||
local out
|
||||
if out=$(gh release download "$1" -R "$GITHUB_REPOSITORY" -p "$2" -D "$3" --clobber 2>&1); then
|
||||
return 0
|
||||
fi
|
||||
if grep -qiE 'release not found|no assets match' <<<"$out"; then
|
||||
echo "::notice::$1 has no $2 yet"
|
||||
return 0
|
||||
fi
|
||||
echo "$out" >&2
|
||||
return 1
|
||||
}
|
||||
rm -rf entries previous bundle-packs out
|
||||
mkdir -p entries previous bundle-packs
|
||||
for flavor in valve ge cachyos; do
|
||||
fetch "droiddeck-esync-$flavor" '*.json' entries
|
||||
done
|
||||
fetch droiddeck-esync-index index.json previous
|
||||
fetch droiddeck-esync-index index.json.sig previous
|
||||
args=(--entries entries --base-url "$SYNC_BASE_URL" --revoked tools/droiddeck-esync/revoked.txt)
|
||||
if [ -f previous/index.json ]; then
|
||||
args+=(--previous previous/index.json --previous-sig previous/index.json.sig)
|
||||
fi
|
||||
python3 tools/droiddeck-esync/make_index.py "${args[@]}" --list-bundle > bundle.tsv
|
||||
while IFS=$'\t' read -r flavor id; do
|
||||
fetch "droiddeck-esync-$flavor" "$id.tzst" bundle-packs
|
||||
done < bundle.tsv
|
||||
echo "Entries: $(find entries -name '*.json' | wc -l); bundled packs: $(wc -l < bundle.tsv)"
|
||||
|
||||
- name: Sign the index and make the apk bundle
|
||||
id: index
|
||||
env:
|
||||
SYNC_INDEX_KEY: ${{ secrets.SYNC_INDEX_KEY }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "$SYNC_INDEX_KEY" ]; then
|
||||
echo "::error::the droiddeck-esync-signing environment has no SYNC_INDEX_KEY secret"
|
||||
exit 1
|
||||
fi
|
||||
args=(--entries entries --base-url "$SYNC_BASE_URL" --revoked tools/droiddeck-esync/revoked.txt)
|
||||
if [ -f previous/index.json ]; then
|
||||
args+=(--previous previous/index.json --previous-sig previous/index.json.sig)
|
||||
fi
|
||||
python3 tools/droiddeck-esync/make_index.py "${args[@]}" --out out --bundle-packs-dir bundle-packs
|
||||
|
||||
- name: Publish the index
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
CHANGED: ${{ steps.index.outputs.changed }}
|
||||
BUNDLE: ${{ steps.index.outputs.bundle }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ "$CHANGED" != true ]; then
|
||||
echo "::notice::no pack was added, replaced or revoked; the published index stays"
|
||||
exit 0
|
||||
fi
|
||||
tag=droiddeck-esync-index
|
||||
if ! gh release view "$tag" -R "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
|
||||
gh release create "$tag" -R "$GITHUB_REPOSITORY" --latest=false --prerelease=false --title "$tag" \
|
||||
--notes "Signed index of the droiddeck-esync packs (tools/droiddeck-esync). The app fetches index.json and index.json.sig; the apk build bundles the bundle-*.tzst that tools/droiddeck-esync/release.env names." \
|
||||
|| gh release view "$tag" -R "$GITHUB_REPOSITORY" >/dev/null
|
||||
fi
|
||||
gh release upload "$tag" -R "$GITHUB_REPOSITORY" "out/$BUNDLE"
|
||||
gh release upload "$tag" -R "$GITHUB_REPOSITORY" out/index.json out/index.json.sig --clobber
|
||||
sum=$(sha256sum "out/$BUNDLE" | cut -d' ' -f1)
|
||||
gh release edit "$tag" -R "$GITHUB_REPOSITORY" --latest=false --prerelease=false
|
||||
{
|
||||
echo "### tools/droiddeck-esync/release.env"
|
||||
echo
|
||||
echo '```'
|
||||
echo "SYNC_BUNDLE_TAG=$tag"
|
||||
echo "SYNC_BUNDLE_ASSET=$BUNDLE"
|
||||
echo "SYNC_BUNDLE_SHA256=$sum"
|
||||
echo '```'
|
||||
} | tee -a "$GITHUB_STEP_SUMMARY"
|
||||
@@ -28,7 +28,7 @@ concurrency:
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
|
||||
|
||||
env:
|
||||
PRELOAD_CACHE_VERSION: v2
|
||||
PRELOAD_CACHE_VERSION: v3
|
||||
|
||||
jobs:
|
||||
build:
|
||||
@@ -157,7 +157,7 @@ jobs:
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: app/src/main/assets/linuxfs
|
||||
key: preloads-${{ env.PRELOAD_CACHE_VERSION }}-${{ hashFiles('app/src/main/cpp/fakeinput_steam.cpp', 'tools/linuxfs/preload/*.c', 'tools/linuxfs/clipboard/*.c', 'tools/proot/fastpath/*.c', 'tools/linuxfs/overlay/usr/local/bin/*', 'tools/linuxfs/overlay/usr/bin/**', 'tools/linuxfs/desktop/*', 'tools/gamescope/release.env', 'tools/wlroots/release.env', 'tools/mangoapp/*') }}
|
||||
key: preloads-${{ env.PRELOAD_CACHE_VERSION }}-${{ hashFiles('app/src/main/cpp/fakeinput_steam.cpp', 'tools/linuxfs/preload/*.c', 'tools/linuxfs/build-x86-preloads.sh', 'tools/linuxfs/fex/*', 'tools/linuxfs/clipboard/*.c', 'tools/proot/fastpath/*.c', 'tools/linuxfs/overlay/usr/local/bin/*', 'tools/linuxfs/overlay/usr/bin/**', 'tools/linuxfs/desktop/*', 'tools/gamescope/release.env', 'tools/wlroots/release.env', 'tools/linuxfs/uruntime.env', 'tools/linuxfs/licenses/*', 'tools/mangoapp/*') }}
|
||||
|
||||
- name: Build libfakeinput.so and libblsession.so (glibc aarch64)
|
||||
if: steps.preloads.outputs.cache-hit != 'true'
|
||||
@@ -182,7 +182,7 @@ jobs:
|
||||
mkdir -p "$D/usr/local/bin"
|
||||
aarch64-linux-gnu-gcc -O2 -Wall -Wextra -o "$D/usr/local/bin/droiddeck-clipboard" tools/linuxfs/clipboard/clipboard.c -ldl
|
||||
aarch64-linux-gnu-strip --strip-unneeded "$D/usr/local/bin/droiddeck-clipboard"
|
||||
for script in tools/linuxfs/overlay/usr/local/bin/bannerlator-*; do
|
||||
for script in tools/linuxfs/overlay/usr/local/bin/droiddeck-* tools/linuxfs/overlay/usr/local/bin/steam-compatibility; do
|
||||
install -Dm644 "$script" "$D/usr/local/bin/$(basename "$script")"
|
||||
done
|
||||
for f in tools/linuxfs/overlay/usr/bin/* tools/linuxfs/overlay/usr/bin/steamos-polkit-helpers/*; do
|
||||
@@ -204,6 +204,12 @@ jobs:
|
||||
test -f "$D/usr/local/lib/droiddeck-wlroots/libwlroots-0.20.so"
|
||||
rm wlroots.tzst
|
||||
fi
|
||||
. tools/linuxfs/uruntime.env
|
||||
curl -fsSL --retry 3 -o uruntime "https://github.com/VHSgunzo/uruntime/releases/download/${URUNTIME_VERSION}/${URUNTIME_ASSET}"
|
||||
echo "${URUNTIME_SHA256} uruntime" | sha256sum -c -
|
||||
install -Dm644 uruntime "$D/usr/local/lib/droiddeck/uruntime"
|
||||
install -Dm644 tools/linuxfs/licenses/uruntime-LICENSE "$D/usr/local/share/licenses/uruntime/LICENSE"
|
||||
rm uruntime
|
||||
M="$D/usr/local/lib/mangoapp"
|
||||
mkdir -p "$M" mango-pkgs
|
||||
grep -v '^#' tools/mangoapp/packages.txt | while read -r sum url; do
|
||||
@@ -233,6 +239,46 @@ jobs:
|
||||
install -Dm644 tools/linuxfs/desktop/firefox-droiddeck.js "$D/usr/lib/firefox/defaults/pref/droiddeck.js"
|
||||
ls -lR "$D"
|
||||
|
||||
- name: Build the x86 preloads FEX guests load (glibc 2.31)
|
||||
if: steps.preloads.outputs.cache-hit != 'true'
|
||||
run: |
|
||||
set -euo pipefail
|
||||
docker run --rm -v "$PWD:/src" -w /src debian:bullseye bash -c '
|
||||
set -euo pipefail
|
||||
printf "deb http://archive.debian.org/debian bullseye main\ndeb http://archive.debian.org/debian-security bullseye-security main\n" > /etc/apt/sources.list
|
||||
apt-get -o Acquire::Check-Valid-Until=false update -qq
|
||||
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends gcc g++ gcc-multilib g++-multilib binutils >/dev/null
|
||||
tools/linuxfs/build-x86-preloads.sh app/src/main/assets/linuxfs
|
||||
'
|
||||
sudo chown -R "$(id -u):$(id -g)" app/src/main/assets/linuxfs
|
||||
ls -l app/src/main/assets/linuxfs/x86_64 app/src/main/assets/linuxfs/i386
|
||||
|
||||
- name: Bundle the droiddeck-esync packs
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -f tools/droiddeck-esync/release.env ]; then
|
||||
. tools/droiddeck-esync/release.env
|
||||
gh release download "$SYNC_BUNDLE_TAG" -R "$SYNC_BUNDLE_REPO" -p "$SYNC_BUNDLE_ASSET" -O sync-bundle.tzst
|
||||
echo "$SYNC_BUNDLE_SHA256 sync-bundle.tzst" | sha256sum -c -
|
||||
mkdir -p app/src/main/assets/droiddeck-esync
|
||||
tar --use-compress-program=unzstd -xf sync-bundle.tzst -C app/src/main/assets/droiddeck-esync
|
||||
rm sync-bundle.tzst
|
||||
gh release download "$SYNC_BUNDLE_TAG" -R "$SYNC_BUNDLE_REPO" -p index.json -O sync-index.json
|
||||
revoked=$(python3 -c 'import json, sys; print(" ".join(p["id"] for p in json.load(open(sys.argv[1]))["packs"] if p.get("revoked") is True))' sync-index.json)
|
||||
for id in $revoked; do
|
||||
if [ -e "app/src/main/assets/droiddeck-esync/packs/$id.tzst" ]; then
|
||||
echo "::warning::$SYNC_BUNDLE_ASSET carries revoked pack $id; it is left out of the APK (point tools/droiddeck-esync/release.env at a newer bundle)"
|
||||
rm -f "app/src/main/assets/droiddeck-esync/packs/$id.tzst"
|
||||
fi
|
||||
done
|
||||
rm sync-index.json
|
||||
test -f app/src/main/assets/droiddeck-esync/index.json
|
||||
test -f app/src/main/assets/droiddeck-esync/index.json.sig
|
||||
ls -lR app/src/main/assets/droiddeck-esync
|
||||
fi
|
||||
|
||||
- name: Cache PulseAudio 13.0 source
|
||||
id: pa-src
|
||||
uses: actions/cache@v4
|
||||
@@ -297,11 +343,11 @@ jobs:
|
||||
echo "::error::libfakeinput.so exports the C++ runtime"; exit 1
|
||||
fi
|
||||
SESSION=$(syms "$D/libblsession.so")
|
||||
for sym in socket bind getsockname setsockopt statfs statvfs; do
|
||||
for sym in socket bind getsockname setsockopt statfs statvfs syscall shm_open shm_unlink mmap mmap64 munmap; do
|
||||
grep -qx "$sym" <<<"$SESSION" || { echo "::error::libblsession.so does not export $sym"; exit 1; }
|
||||
done
|
||||
test -f "$D/usr/local/bin/bannerlator-session"
|
||||
test -f "$D/usr/local/bin/bannerlator-proton-extra"
|
||||
test -f "$D/usr/local/bin/droiddeck-session"
|
||||
test -f "$D/usr/local/bin/droiddeck-proton-extra"
|
||||
|
||||
- name: Cache the CMake build tree
|
||||
uses: actions/cache@v4
|
||||
|
||||
@@ -1,112 +0,0 @@
|
||||
name: Watch Proton releases
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '*/20 * * * *'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
actions: write
|
||||
|
||||
concurrency:
|
||||
group: watch-proton-releases
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
watch:
|
||||
if: ${{ github.repository == 'Droid-Deck/DroidDeck' }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 15
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Pick the steamcmd cache week
|
||||
id: week
|
||||
run: echo "week=$(date -u +%G-%V)" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/steamcmd
|
||||
key: steamcmd-${{ runner.os }}-${{ steps.week.outputs.week }}
|
||||
restore-keys: steamcmd-${{ runner.os }}-
|
||||
|
||||
- name: Read the Proton builds Steam ships
|
||||
run: |
|
||||
set -euo pipefail
|
||||
sudo apt-get update -qq
|
||||
sudo apt-get install -y -qq lib32gcc-s1 >/dev/null
|
||||
mkdir -p ~/steamcmd
|
||||
if [ ! -x ~/steamcmd/steamcmd.sh ]; then
|
||||
curl -fsSL https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz | tar -xz -C ~/steamcmd
|
||||
fi
|
||||
apps=$(python3 tools/droiddeck-esync/discover.py steam-apps)
|
||||
args=(+login anonymous +app_info_update 1)
|
||||
for app in $apps; do
|
||||
args+=(+app_info_print "$app")
|
||||
done
|
||||
if ! timeout 300 ~/steamcmd/steamcmd.sh "${args[@]}" +quit > steam-info.txt 2>&1; then
|
||||
tail -n 20 steam-info.txt
|
||||
echo "::warning::steamcmd failed; this run watches the source tags only"
|
||||
: > steam-info.txt
|
||||
fi
|
||||
|
||||
- name: Fetch the previous watch state
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
mkdir -p previous
|
||||
if ! out=$(gh release download droiddeck-esync-index -R "$GITHUB_REPOSITORY" -p watch-state.json -D previous --clobber 2>&1); then
|
||||
if grep -qiE 'release not found|no assets match' <<<"$out"; then
|
||||
echo "::notice::no watch state yet; every flavor counts as new"
|
||||
else
|
||||
echo "$out" >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
- name: Compare with the last run
|
||||
id: watch
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
info=()
|
||||
if [ -s steam-info.txt ]; then
|
||||
info=(--steam-info steam-info.txt)
|
||||
fi
|
||||
python3 tools/droiddeck-esync/discover.py watch --state previous/watch-state.json "${info[@]}" --out watch-state.json
|
||||
|
||||
- name: Start the pack builds
|
||||
if: steps.watch.outputs.changed != ''
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
CHANGED: ${{ steps.watch.outputs.changed }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
read -r -a flavors <<<"$CHANGED"
|
||||
if [ "${#flavors[@]}" -gt 1 ]; then
|
||||
flavors=(all)
|
||||
fi
|
||||
for flavor in "${flavors[@]}"; do
|
||||
gh workflow run build-droiddeck-esync-packs.yml -R "$GITHUB_REPOSITORY" --ref main -f flavor="$flavor" -f publish=true
|
||||
echo "Started the pack build for $flavor" >> "$GITHUB_STEP_SUMMARY"
|
||||
done
|
||||
|
||||
- name: Save the watch state
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tag=droiddeck-esync-index
|
||||
if ! gh release view "$tag" -R "$GITHUB_REPOSITORY" >/dev/null 2>&1; then
|
||||
echo "::notice::$tag does not exist yet; the state is saved once the first index is published"
|
||||
exit 0
|
||||
fi
|
||||
if cmp -s watch-state.json previous/watch-state.json; then
|
||||
exit 0
|
||||
fi
|
||||
gh release upload "$tag" -R "$GITHUB_REPOSITORY" watch-state.json --clobber
|
||||
Reference in new issue
Block a user