Skip to content

Commit

Permalink
Find the exe prior to busybox resolution (carbon-language#4993)
Browse files Browse the repository at this point in the history
This is required to make $PATH entries work.
  • Loading branch information
jonmeow authored Feb 20, 2025
1 parent 9cb6b71 commit c2bc3c1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions toolchain/install/busybox_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,13 @@ static auto Main(int argc, char** argv) -> ErrorOr<int> {
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());
Expand Down

0 comments on commit c2bc3c1

Please sign in to comment.