mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
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:
@@ -32,9 +32,8 @@ class ToolchainFileTest : public FileTestBase {
|
||||
auto Run(const llvm::SmallVector<llvm::StringRef>& test_args,
|
||||
llvm::vfs::InMemoryFileSystem& fs, llvm::raw_pwrite_stream& stdout,
|
||||
llvm::raw_pwrite_stream& stderr) -> ErrorOr<RunResult> override {
|
||||
const llvm::StringRef data_dir = "";
|
||||
|
||||
auto prelude = Driver::FindPreludeFiles(data_dir, stderr);
|
||||
auto prelude =
|
||||
Driver::FindPreludeFiles(installation_.core_package(), stderr);
|
||||
if (prelude.empty()) {
|
||||
return Error("Could not find prelude");
|
||||
}
|
||||
@@ -42,7 +41,7 @@ class ToolchainFileTest : public FileTestBase {
|
||||
CARBON_RETURN_IF_ERROR(AddFile(fs, file));
|
||||
}
|
||||
|
||||
Driver driver(fs, &installation_, data_dir, stdout, stderr);
|
||||
Driver driver(fs, &installation_, stdout, stderr);
|
||||
auto driver_result = driver.RunCommand(test_args);
|
||||
|
||||
RunResult result{
|
||||
@@ -84,7 +83,9 @@ class ToolchainFileTest : public FileTestBase {
|
||||
args.push_back("--no-prelude-import");
|
||||
}
|
||||
|
||||
args.insert(args.end(), {"--exclude-dump-file-prefix=core/", "%s"});
|
||||
args.insert(
|
||||
args.end(),
|
||||
{"--exclude-dump-file-prefix=" + installation_.core_package(), "%s"});
|
||||
return args;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user