Repository navigation
fix(native): open the code and diff views without fontconfig on Windows and macOS - #828
Merged
Merged
Conversation
…ws and macOS godemirror resolves a family name only through fc-match, which Windows and macOS do not ship, so the native window exited at startup there. Build the views from the files fonts.Locate picks on those systems instead. native.yml now runs the native tests on a real Windows runner and opens the window once against a backend, as the macOS job does.
…without-fontconfig # Conflicts: # CHANGELOG.md
Segoe UI Emoji stores its glyphs as COLR layers, not the PNG bitmaps (CBDT, sbix) the terminal's rasterizer drew, so emoji came out as plain outlines on Windows. Draw COLR version 0 layers and version 1 paint graphs: solid and gradient fills, transforms, glyph clips and composite modes. The Windows smoke now runs even when the native tests fail.
…nter test macOS's Menlo is a .ttc, which ParseTTF refuses.
…template Since git 2.46 a commit starts `git maintenance run --auto --detach`, which outlives it holding objects/maintenance.lock. initRepo copying the template right after listed the lock and failed to open it once it was gone: "copy repository template: open .git/objects/maintenance.lock: no such file or directory". Measured with the template's build-then-copy under two CPUs of contention: 3 failures in 4800 before, 0 in 4800 with maintenance.auto off, and the commit no longer spawns maintenance at all.
TestSubprocessBudgetOutlivesAGrandchild left its grandchild, a re-run of project.test, asleep for ten seconds past the test. A package that finished sooner left it running the binary go test then deletes, which Windows refuses: "go: unlinkat ...\\project.test.exe: Access is denied" (os-tests on #829, run 39256549322). The grandchild now holds the pipe until the test's cleanup releases it, and the cleanup waits for it to exit. Measured by running the two TestSubprocess tests 20 times and checking for a project.test process right after each run: 20/20 left one before, 0/20 after.
…without-fontconfig # Conflicts: # CHANGELOG.md
…without-fontconfig # Conflicts: # CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows (and macOS without Homebrew's fontconfig), 0.71.x's native window exits with status 1 right after it starts. A user's
lich-native.logends on:The code and diff views were built with
godemirror.New/NewDiffView, which resolve a family name only throughfc-match.runreturned that error and the window exited, so lich fell back to the web window.Fix
code_view_fontconfig.go(Linux and the BSDs) keepsgodemirror.New/NewDiffView, with godemirror's fallback for characters the family lacks.code_view_fontscan.go(Windows, macOS) reads the four styles from the filesfonts.Locatealready picks and builds the views withNewFromFonts/NewDiffViewFromFonts. A character the family lacks draws as a box, and a style that sits deeper in a collection draws with its first face, the same ceiling the terminal's rasterizer has.CI: Windows now runs, not only links
Until now
native.ymlonly cross-linkedlich-native.exe, so nothing ever started the window on Windows. That is how this shipped.windows-buildalso cross-builds one test binary per native package, pluslich.exe, and uploads them.windowsjob (windows-latest) runs each test binary from its package directory and fails if a render test skips for want of a GPU. It then runs.github/scripts/win-native-smoke.sh, the Windows twin of the macOS smoke: a windowless backend, one shell session, and the window has to come up, draw its-shot, stay alive and close onlich quit.Verified
TestTheCodeAndDiffViewsOpenInTheSystemMonospace, cross-built for Windows and run under Wine: fails without the fix with the exact error from the user's log, passes with it.glyphs: the Wine prefix has no emoji font. The real runner is the answer for those.gofmt,go vet,go test ./...) green;actionlintclean onnative.yml.Color emoji on Windows
The new Windows job's first run found that the terminal's rasterizer drew emoji in color only from PNG bitmaps (CBDT, sbix). Segoe UI Emoji stores them as COLR layers, so on Windows they came out as plain outlines (
TestMaskDrawsColorEmojiandTestOnlyAColorFontIsParsedForBitmapsfailed onwindows-latest).native/glyphs/colr.goandcolr_fill.gonow draw COLR version 0 layers and version 1 paint graphs: solid, linear, radial and sweep fills; every transform; glyph clips; composite modes. Hue, saturation, color and luminosity mix as normal (ponytail:in the code), and variable paints are read at the default instance.Checked by rendering a row of emoji from Twemoji (COLR v0) and Noto COLRv1 and looking at it, and by running the
glyphstests cross-built for Windows under Wine with a COLRv1 font installed. Then onwindows-latest.Two backend test flakes, fixed at the cause
Neither comes from this PR's changes; both turned up on its CI.
copy repository template: open .git/objects/maintenance.lock: no such file or directory(internal/project,ci / test). Since git 2.46 a commit startsgit maintenance run --auto --detach, which outlives it holdingobjects/maintenance.lock(seen withstrace).initRepocopying the template right after listed the lock and failed to open it once it was gone. The template now setsmaintenance.auto false. Measured with the template's build-then-copy step, 16 processes on two CPUs: 3 failures in 4800 before, 0 in 4800 after.go: unlinkat ...\project.test.exe: Access is denied(os-tests (windows-latest)on fix(native): unfold dropped and attached file paths #829, run 39256549322, no test failing).TestSubprocessBudgetOutlivesAGrandchildleft its grandchild, a re-run ofproject.test, asleep for ten seconds past the test. A package that finished sooner left it running the binarygo testthen deletes, which Windows refuses. The grandchild now holds the pipe until the test's cleanup releases it, and the cleanup waits for it to exit. Measured by running the twoTestSubprocesstests 20 times and checking for aproject.testprocess right after each: 20/20 left one before, 0/20 after. The test still fails withoutWaitDelay:Outputwould then wait the grandchild's full 10 s hold.