fix: canonicalize executable path before resolving resource root - #19
Merged
Conversation
On macOS, std::env::current_exe() returns the symlink path (~/.chief/bin/chief) instead of the resolved target (~/.chief/versions/<v>/bin/chief). The grandparent walk from the symlink path landed on ~/.chief/ instead of the version directory, so the resources/ directory was never found. Canonicalize the executable path before computing the resource root so the walk starts from the real binary and lands on the correct version directory.
hishboy
approved these changes
Aug 31, 2026
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.
On macOS,
std::env::current_exe()returns the symlink path (~/.chief/bin/chief) instead of the resolved target (~/.chief/versions/<v>/bin/chief). The grandparent walk from the symlink path landed on~/.chief/instead of the version directory, so theresources/directory was never found.Fix
Canonicalize the executable path before computing the resource root, so the walk starts from the real binary and lands on the correct version directory.
Testing
install::unit tests pass, including the newresources_are_found_when_the_binary_is_reached_through_a_symlinktest~/.chief/bin/chiefnow passes the resources check and reaches the next gate (tmux)