Skip to content

Commit 77cf022

Browse files
committed
fix(nix): ship every public asset, cursors included, by pointing public/ at dist/
1 parent 3ee6a52 commit 77cf022

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

‎.github/workflows/nix-build.yml‎

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ on:
4242
# and merged with no nix build on the PR.
4343
- electron/native/pipewire-capture/**
4444
- electron/native/whisper-stt/**
45-
# buildPhase is `npx vite build` alone, and installPhase copies
46-
# public/wallpapers unguarded.
45+
# buildPhase is `npx vite build` alone, and public/ reaches the package
46+
# only through the copy Vite makes of it in dist/.
4747
- vite.config.ts
48-
- public/wallpapers/**
4948
# Including itself, or a PR that only edits this file gets no validation of
5049
# the change it is making -- the same rule nix-check.yml already follows.
5150
- .github/workflows/nix-build.yml
@@ -176,6 +175,22 @@ jobs:
176175
echo "closure: $(nix path-info --closure-size --human-readable ./result | tail -1)"
177176
ls -la result/bin/
178177
178+
# The renderer loads wallpapers, cursors and fonts from <app>/public/, and
179+
# a tree missing there degrades the editor without failing anything: the
180+
# cursor style picker rendered empty (#1085). Every entry of the source
181+
# public/ must be there.
182+
- name: Check the renderer's public assets
183+
run: |
184+
set -euo pipefail
185+
missing=0
186+
for entry in public/*; do
187+
if [ ! -e "result/lib/openscreen/$entry" ]; then
188+
echo "::error::$entry is missing from the package"
189+
missing=$((missing + 1))
190+
fi
191+
done
192+
[ "$missing" -eq 0 ]
193+
179194
# The native components are resolved at runtime behind existence checks, so
180195
# a wrapper pointing at a path that is not there degrades the app instead of
181196
# failing it -- silently, which is the failure mode this whole workflow was

‎nix/package.nix‎

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,12 @@ buildNpmPackage {
8686
npm prune --omit=dev --no-save
8787
cp -r node_modules "$out/lib/openscreen/"
8888
89-
# Asset resolution: when app.isPackaged is false, the main process resolves
90-
# assets at <appPath>/public/. Place wallpapers at that root to match the
91-
# packaged layout (electron-builder extraResources -> resources/wallpapers).
92-
mkdir -p "$out/lib/openscreen/public"
93-
cp -r public/wallpapers "$out/lib/openscreen/public/wallpapers"
94-
# Same for the caption/annotation fonts: the renderer's picker loads them from
95-
# there. The compositor itself finds the copy Vite put in dist/fonts.
96-
cp -r public/fonts "$out/lib/openscreen/public/fonts"
89+
# Asset resolution: run as `electron <dir>`, the app resolves the renderer's
90+
# assets (wallpapers, cursors, fonts) at <appPath>/public/ (ASSET_BASE_DIR in
91+
# electron/windows.ts). Vite already copied all of public/ into dist/, so point
92+
# public/ at it rather than copying trees one by one: a hand-kept list missed
93+
# cursors (#1085). The compositor reads the same files through dist/.
94+
ln -s dist "$out/lib/openscreen/public"
9795
9896
# Wrap system electron with the app directory.
9997
#

0 commit comments

Comments
 (0)