mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Pivot towards relative paths for installs and runtimes (#6547)
When building in Bazel actions, notably building runtimes, using absolute paths makes the results non-hermetic and generally less cache-friendly. This restructures the code to only form an absolute path as part of the `bazel run` change of working directory. It also tries to make the API for doing this a bit more clear by taking the `exe_path` and transforming it internally. To support this, this PR also generalizes the `RemovingDir` to support relative paths. While these can be tricky -- the working directory needs to not change while they exist -- that isn't a reason to fully exclude them and they're useful for implementing relative-path runtimes, etc.
This commit is contained in:
@@ -110,7 +110,7 @@ auto main(int argc, char** argv) -> int {
|
||||
// Do LLVM's initialization first, this will also transform UTF-16 to UTF-8.
|
||||
Carbon::InitLLVM init_llvm(argc, argv);
|
||||
|
||||
Carbon::SetWorkingDirForBazel();
|
||||
Carbon::SetWorkingDirForBazelRun();
|
||||
|
||||
llvm::SmallVector<llvm::StringRef> args(argv + 1, argv + argc);
|
||||
bool success = Carbon::Testing::Run(args);
|
||||
|
||||
Reference in New Issue
Block a user