From c2bc3c1719eddd30dfab791d07b2c7fdeabc8982 Mon Sep 17 00:00:00 2001 From: Jon Ross-Perkins Date: Thu, 20 Feb 2025 13:06:18 -0800 Subject: [PATCH] Find the exe prior to busybox resolution (#4993) This is required to make $PATH entries work. --- toolchain/install/busybox_main.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toolchain/install/busybox_main.cpp b/toolchain/install/busybox_main.cpp index 9dbca3336f74..c4a87635a839 100644 --- a/toolchain/install/busybox_main.cpp +++ b/toolchain/install/busybox_main.cpp @@ -25,12 +25,13 @@ static auto Main(int argc, char** argv) -> ErrorOr { InitLLVM init_llvm(argc, argv); // Start by resolving any symlinks. - CARBON_ASSIGN_OR_RETURN(auto busybox_info, GetBusyboxInfo(argv[0])); + CARBON_ASSIGN_OR_RETURN(auto busybox_info, + GetBusyboxInfo(FindExecutablePath(argv[0]))); auto fs = llvm::vfs::getRealFileSystem(); // Resolve paths before calling SetWorkingDirForBazel. - std::string exe_path = FindExecutablePath(busybox_info.bin_path.string()); + std::string exe_path = busybox_info.bin_path.string(); const auto install_paths = InstallPaths::MakeExeRelative(exe_path); if (install_paths.error()) { return Error(*install_paths.error());