feat-deviant(os): embed a configurable resource directory
Relocating a Cargo-installed binary loses executable-relative resource lookup even when themes and shell integration exist under /usr/share. Allow packagers to set GHOSTTY_BUILD_RESOURCES_DIR when compiling. Absolute paths are used directly; relative paths resolve against the running executable's directory for relocatable installations. Explicit paths do not require terminfo sentinels. A nonempty runtime override wins in every profile when the build option is configured. Unset or empty build options preserve existing discovery, including debug precedence. Cargo watches the build option so changing or unsetting it recompiles lookup. Resource files still need to be installed separately. Document this requested upstream deviation and the build option in the README, architecture overview, and deviation register. Test Plan: - Eight resource lookup unit tests pass. - Nightly formatting and ghostty-os Clippy with -D warnings pass. - Production build with /usr/share/ghostty succeeds; a copied executable lists all 463 themes with no runtime override. - Compiled probes verify absolute, relative, unset, and empty options, Cargo rebuilds, relocation, runtime overrides, and unrelated cwd. Deviation-Register: docs/rewrite/DEVIANT_FIXES.md
This commit is contained in:
1 parent
4cfeee71cc
commit
85489a164e
5 files changed
+142
-15
No files matched your search
@@ -70,6 +70,14 @@ ghostty-bench (benchmarks), ghostty-build-data (completions, man pages, syntax).
|
||||
Non-code: `resources/` (shell-integration, themes, terminfo), `dist/` (desktop
|
||||
integration), `po/` (translations), crate-local `res/`/`shaders/`/`resources/`.
|
||||
|
||||
Resource lookup: `ghostty-os::resourcesdir` accepts the optional build-time
|
||||
`GHOSTTY_BUILD_RESOURCES_DIR` path (watched by `ghostty-os/build.rs`). Runtime
|
||||
`GHOSTTY_RESOURCES_DIR` overrides a configured build path; otherwise that path
|
||||
precedes automatic discovery. Relative build paths resolve from the executable's
|
||||
directory, allowing relocatable installations. Without a build path, upstream's
|
||||
environment/terminfo lookup and the checkout resource fallback apply. See
|
||||
`README.md` (Build-time resource directory) and `DEVIANT_FIXES.md`.
|
||||
|
||||
Build inputs: `ghostty-build-info/build.rs` derives version metadata from the
|
||||
workspace manifest and Git HEAD/refs, watching `packed-refs` only when it exists
|
||||
(packing loose refs also changes the watched `refs` directory). The GTK build
|
||||
|
||||
Reference in new issue
Block a user