Fix regression causing build/fish to use wrong config paths

Commit 8b102f2571 (Stop using Cargo's OUT_DIR,
2025-06-22) accidentally removed canonicalization of
FISH_BUILD_DIR=${CMAKE_BINARY_DIR}.  This means that if the path to
${CMAKE_BINARY_DIR} includes a symlink, ${CMAKE_BINARY_DIR}/fish will
wrongly use /usr/share/fish instead of ${CARGO_MANIFEST_DIR}/share.
Fix this and reintroduce the comment.
This commit is contained in:
Johannes Altmanninger
2025-09-13 11:14:28 +02:00
parent bde8a5aa40
commit 33735f507a

View File

@@ -13,10 +13,14 @@ fn main() {
let cargo_target_dir = fish_build_helper::get_target_dir();
// FISH_BUILD_DIR is set by CMake, if we are using it.
rsconf::set_env_value(
"FISH_BUILD_DIR",
option_env!("FISH_BUILD_DIR").unwrap_or(cargo_target_dir.to_str().unwrap()),
// This is set by CMake and might include symlinks. Since we want to compare this to
// the dir fish is executed in we need to canonicalize it.
option_env!("FISH_BUILD_DIR")
.map_or(cargo_target_dir, fish_build_helper::canonicalize)
.to_str()
.unwrap(),
);
// We need to canonicalize (i.e. realpath) the manifest dir because we want to be able to