Move the core standard library to the installation. (#3995)

This removes the `data_dir` from the driver favoring the installation
abstraction for the both locating the prelude and linking utilities.

With this, an installed toolchain should also be able to compile and
link Carbon successfully, and the build of the examples should exercise
this path almost exactly. (The only difference is using the driver
`cc_binary` directly rather than relying on the symlink from inside the
install tree.)
This commit is contained in:
Chandler Carruth
2024-06-01 05:16:44 +00:00
committed by GitHub
parent 0d37095ec6
commit e34e240263
15 changed files with 56 additions and 42 deletions
+1 -9
View File
@@ -9,7 +9,6 @@
#include "common/init_llvm.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Path.h"
#include "toolchain/driver/driver.h"
#include "toolchain/install/install_paths.h"
@@ -29,14 +28,7 @@ auto main(int argc, char** argv) -> int {
const auto install_paths = Carbon::InstallPaths::MakeExeRelative(exe_path);
// Construct the data directory relative to the executable location.
// TODO: Will be removed when everything moves to the install_paths.
llvm::SmallString<256> data_dir(llvm::sys::path::parent_path(exe_path));
llvm::sys::path::append(data_dir, llvm::sys::path::Style::posix,
"carbon.runfiles/_main/");
Carbon::Driver driver(*fs, &install_paths, data_dir, llvm::outs(),
llvm::errs());
Carbon::Driver driver(*fs, &install_paths, llvm::outs(), llvm::errs());
bool success = driver.RunCommand(args).success;
return success ? EXIT_SUCCESS : EXIT_FAILURE;
}