-
-
Notifications
You must be signed in to change notification settings - Fork 535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix fonts on NixOS and any other XDG-compliant distro with unusual directory structure #31
Conversation
Whoops, looks like the code I gave you, or the edits you made (either or) are now causing a use after free https://github.com/LadybirdWebBrowser/ladybird/actions/runs/9357541272/job/25757496121?pr=31#step:14:47 Do feel free to resolve resolved comments yourself btw, the only people who can do that on github are the author and people with write access. |
the tests pass locally so idk how to fix this with no debug feedback... trying a rebuild with |
I haven't quite updated it yet, but there is a RunningTests.md documentation file. Basically, poke CMake to -DENABLE_UNDEFINED_SANITIZER=ON and -DENABLE_ADDRESS_SANITIZER=ON and set the associated OPTIONS environment variables to reproduce the CI failure |
fyi this was temporarily fixed downstream by hardcoding the nixos font path in NixOS/nixpkgs#315048 |
The bug was that you had
However, Core::Environment::get() returns The fix is straightforward: Don't use temporary strings, use stringview literals
I'll push this tiny fix to your branch and merge it soon |
NixOS doesn't have
/usr/share/fonts
, so Ladybird was only loading the default bitmap font. This fixes that by replacing hardcoded paths (/usr/share/fonts
,/usr/local/share/fonts
,$HOME/.local/share/fonts
) with their XDG base directory equivalents (with fallbacks included so nothing changes on systems where$XDG_DATA_HOME
or$XDG_DATA_DIRS
are unset). It also silences the warnings when nonexistent directories are returned fromStandardPaths.cpp::font_directories()
, since that is to be expected with the updated code that checks for more possible directories.