fix(app): FontCheck asks where the launcher runs from, not where its assembly lies #144

Closed
omgitsgela wants to merge 1 commit from omgitsgela/LongshotLauncher:fix/single-file-fontcheck-il3000 into main
Contributor

main has not built since #137 merged. The release job ("The launcher, both systems") fails on every push to main — actions run 448 and run 455, same line both times:

App/FontCheck.cs(91,45): error IL3000: 'System.Reflection.Assembly.Location.get' always returns
an empty string for assemblies embedded in a single-file app. ...

The last published nightling is nightly-100-5f30eea3; nothing since has been built or published.

What and why

#137 added App/FontCheck.cs (the Windows no-fonts report). Its OtherModules() takes the launcher's own folder as Path.GetDirectoryName(typeof(SKFontManager).Assembly.Location …). The launcher ships as a single-file app (package.sh line 51 sets PublishSingleFile=true), and in a single-file app an embedded assembly has no path on disk — Assembly.Location returns "". Newer .NET 10 SDKs promoted that read to analyzer error IL3000, and Directory.Build.props sets TreatWarningsAsErrors=true, so the build dies in CI.

This was latent from the day #137 merged: an SDK old enough not to flag it builds fine (dotnet build on my host passes even today), which is how it slipped through review. The runner's setup-dotnet 10.0.x picked up an SDK that flags it, and both pushes to main since have been red.

The fix is the one the analyzer itself points at: take the folder the launcher runs from (AppContext.BaseDirectory), which is what the code's own fallback already meant. The report's meaning is unchanged — OtherModules() lists modules that are neither Windows' nor the launcher's own, and the process module list still carries complete paths for every loaded DLL in a single-file app. The SkiaSharp import is still used by SkiaFamilies() (line 116), so this commit does not touch the usings.

Proven locally, not just argued

Reproduced the failure and the fix with the real packaging path on a clean origin/main (5d86f319) worktree:

worktree scripts/package.sh result
pristine main fails, IL3000, zero artifacts produced (the Linux AppImage publish dies on the same error, so a Deck build is blocked too)
+ this commit IL3000 gone; artifacts: Windows setup 107,198,758 B · portable zip 45,215,227 B · AppImage 40,466,936 B

Suites on the fixed tree: launcher core: 1374 checks passed; test_release.py Ran 34 tests … OK. (The core count is main's, without #130's additions.)

Scope

One expression, no behaviour intended to change — with one verified nuance, in this change's favour. In a single-file build the old expression's fallback always ran (Location is ""), and GetDirectoryName of BaseDirectory yields the app folder without its trailing separator (probed, not assumed: GetDirectoryName("/dir/App/") → /dir/App, not /dir). The old prefix therefore swallowed sibling folders whose names start with the launcher's own: /dir/App2/injected.dll passes StartsWith("/dir/App") but not StartsWith("/dir/App/"). The fix's trailing-separator form makes the filter a true directory boundary — it narrows OtherModules' blind spot rather than widening it. If HumanBean meant the directory containing SkiaSharp specifically in a non-single-file build: that distinction is moot for what OtherModules reports — SkiaSharp ships in the launcher's folder, and its native library is separately excused two lines below.

Delegated adversarial review ran (deepseek-flash route; the Astra subscription route was rate-capped at the time): verdict safe to merge as-is, no change requested. Its single novel mechanism claim (old code yielding the parent folder) is refuted by the probe above; the boundary improvement it gestured at is real and stated here in its verified form.

**main has not built since #137 merged.** The release job ("The launcher, both systems") fails on every push to main — actions [run 448](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/actions/runs/448/jobs/1/attempt/1) and [run 455](https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/actions/runs/455/jobs/1/attempt/1), same line both times: ``` App/FontCheck.cs(91,45): error IL3000: 'System.Reflection.Assembly.Location.get' always returns an empty string for assemblies embedded in a single-file app. ... ``` The last published nightling is `nightly-100-5f30eea3`; nothing since has been built or published. ## What and why `#137` added `App/FontCheck.cs` (the Windows no-fonts report). Its `OtherModules()` takes the launcher's own folder as `Path.GetDirectoryName(typeof(SKFontManager).Assembly.Location …)`. The launcher ships as a **single-file app** (`package.sh` line 51 sets `PublishSingleFile=true`), and in a single-file app an embedded assembly has no path on disk — `Assembly.Location` returns "". Newer .NET 10 SDKs promoted that read to analyzer error IL3000, and `Directory.Build.props` sets `TreatWarningsAsErrors=true`, so the build dies in CI. This was latent from the day #137 merged: an SDK old enough not to flag it builds fine (`dotnet build` on my host passes even today), which is how it slipped through review. The runner's `setup-dotnet 10.0.x` picked up an SDK that flags it, and both pushes to main since have been red. The fix is the one the analyzer itself points at: take the folder the launcher runs from (`AppContext.BaseDirectory`), which is what the code's own fallback already meant. The report's meaning is unchanged — `OtherModules()` lists modules that are neither Windows' nor the launcher's own, and the process module list still carries complete paths for every loaded DLL in a single-file app. The `SkiaSharp` import is still used by `SkiaFamilies()` (line 116), so this commit does not touch the usings. ## Proven locally, not just argued Reproduced the failure and the fix with the real packaging path on a clean `origin/main` (`5d86f319`) worktree: | worktree | `scripts/package.sh` result | |---|---| | pristine main | fails, `IL3000`, **zero artifacts produced** (the Linux AppImage publish dies on the same error, so a Deck build is blocked too) | | + this commit | IL3000 gone; artifacts: Windows setup 107,198,758 B · portable zip 45,215,227 B · AppImage 40,466,936 B | Suites on the fixed tree: `launcher core: 1374 checks passed`; `test_release.py` `Ran 34 tests … OK`. (The core count is main's, without #130's additions.) ## Scope One expression, no behaviour intended to change — with one verified nuance, in this change's favour. In a single-file build the old expression's fallback always ran (`Location` is `""`), and `GetDirectoryName` of `BaseDirectory` yields the app folder *without its trailing separator* (probed, not assumed: `GetDirectoryName("/dir/App/")` → `/dir/App`, not `/dir`). The old prefix therefore swallowed sibling folders whose names start with the launcher's own: `/dir/App2/injected.dll` passes `StartsWith("/dir/App")` but not `StartsWith("/dir/App/")`. The fix's trailing-separator form makes the filter a true directory boundary — it narrows `OtherModules`' blind spot rather than widening it. If HumanBean meant the *directory containing SkiaSharp* specifically in a non-single-file build: that distinction is moot for what `OtherModules` reports — SkiaSharp ships in the launcher's folder, and its native library is separately excused two lines below. Delegated adversarial review ran (deepseek-flash route; the Astra subscription route was rate-capped at the time): verdict safe to merge as-is, no change requested. Its single novel mechanism claim (old code yielding the parent folder) is refuted by the probe above; the boundary improvement it gestured at is real and stated here in its verified form.
fix(app): FontCheck asks where the launcher runs from, not where its assembly lies
Some checks failed
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Compile and test (pull_request) Has been cancelled
227ea73633
The launcher ships as one file, and an assembly inside one has no path on
disk: the new .NET 10 SDK's analyzers made the read an error (IL3000), and
with warnings-as-errors the release job has failed since #137 merged
(actions 448/457, 'The launcher, both systems'). The folder the launcher
runs from is what 'its own' means in OtherModules anyway; the modules' own
filenames are still complete paths in a single-file app, so the report's
meaning stands.
Author
Contributor

Closing: upstream merged #158 for the same IL3000 font check before this could land, so this branch is no longer needed. Our tile PR #130 has since merged main and keeps the fix (with one deliberate difference worth a look: this branch and #130 use Path.GetFullPath(AppContext.BaseDirectory) for the launcher's own folder, where #158 uses Path.GetDirectoryName(AppContext.BaseDirectory). BaseDirectory ends in a separator, so GetDirectoryName yields the PARENT folder — on the Deck that would blank OtherModules for anything under /home/deck, hiding the very overlay DLLs the check exists to find. Filed separately.)

Closing: upstream merged #158 for the same IL3000 font check before this could land, so this branch is no longer needed. Our tile PR #130 has since merged main and keeps the fix (with one deliberate difference worth a look: this branch and #130 use `Path.GetFullPath(AppContext.BaseDirectory)` for the launcher's own folder, where #158 uses `Path.GetDirectoryName(AppContext.BaseDirectory)`. `BaseDirectory` ends in a separator, so `GetDirectoryName` yields the PARENT folder — on the Deck that would blank `OtherModules` for anything under `/home/deck`, hiding the very overlay DLLs the check exists to find. Filed separately.)
Author
Contributor

Superseded by upstream #158 (same IL3000 fix merged first). See the thread note about the one deliberate difference #130 keeps.

Superseded by upstream #158 (same IL3000 fix merged first). See the thread note about the one deliberate difference #130 keeps.
omgitsgela closed this pull request 2026-11-17 01:48:49 +00:00
Some checks failed
CI / Conventional Commit title (pull_request) Has been cancelled
CI / Compile and test (pull_request) Has been cancelled

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!144
No description provided.