Emoji font: install it readable, and retry a failed load
CI / test (push) Failing after 44m48s

The fetch script downloaded through mktemp (0600) and the installer kept
that mode, so the session couldn't read the root-owned font and reported
it missing. The failure was also cached until the next session.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
nandiandClaude Sonnet 5.5 committed 2026-11-26 00:12:06 -08:00
1 parent 44688453d7
commit 7912a0b32b
3 files changed
+20 -6

No files matched your search

+11 -6
View File
@@ -24,7 +24,7 @@ pub fn missing_font_message(env_path : String) -> String {
"CHANDRA_EMOJI_FONT=" + env_path + " can't be read as a bitmap (CBDT) colour emoji font. " +
"Unset it to use Chandra's own Noto Color Emoji."
} else {
"Chandra's emoji font is missing: " + font_path + " (Noto Color Emoji, bitmap edition). " +
"Chandra's emoji font is missing or unreadable: " + font_path + " (Noto Color Emoji, bitmap edition). " +
"Run `just install` (or `just emoji-font` in a checkout), then press Super+. again."
}
}
@@ -439,12 +439,13 @@ pub fn EmojiSource::new() -> EmojiSource {
{ state: None, images: {} }
}
///| Open the font: CHANDRA_EMOJI_FONT when set, else the first of `font_paths` that parses.
/// The path, or what to tell the user. Logged once.
///| Open the font: CHANDRA_EMOJI_FONT when set, else `font_path`. The path, or what to tell the
/// user. A failure is tried again on the next call (so fixing the file needs no new session) and
/// logged only when it changes.
pub fn EmojiSource::font(self : EmojiSource) -> Result[String, String] {
let st = match self.state {
Some(s) => s
None => {
Some(Ok(s)) => Ok(s)
previous => {
let env = @sys.getenv("CHANDRA_EMOJI_FONT")
let p = if env.length() > 0 { env } else { font_path }
let data = @sys.read_file_bytes(p)
@@ -458,7 +459,11 @@ pub fn EmojiSource::font(self : EmojiSource) -> Result[String, String] {
}
match found {
Ok((p, f)) => @sys.log("emoji: " + p + " (" + f.ppem.to_string() + " px pictures)")
Err(m) => @sys.log("emoji: " + m)
Err(m) =>
match previous {
Some(Err(old)) if old == m => ()
_ => @sys.log("emoji: " + m)
}
}
self.state = Some(found)
found