Improve install_paths handling for relative paths. (#4331)

Because install_paths is not presently validated, and it's resolved
after the `SetWorkingDirForBazel` call, if a relative path is used with
bazel then it would fail silently. This starts making the driver share
install path errors, and starts changing how `//toolchain` launches
`carbon`.

Note the implementation is still brittle and will break with symlinks.
That's something I plan to address as part of busyboxing.
This commit is contained in:
Jon Ross-Perkins
2024-09-23 22:26:53 +00:00
committed by GitHub
parent edc6ed3d10
commit c7057eff89
8 changed files with 78 additions and 10 deletions
+1 -1
View File
@@ -118,7 +118,7 @@ TEST_F(InstallPathsTest, BinaryRunfiles) {
}
TEST_F(InstallPathsTest, Errors) {
auto paths = InstallPaths::Make("foo/bar/baz");
auto paths = InstallPaths::Make("/foo/bar/baz");
EXPECT_THAT(paths.error(), Optional(HasSubstr("foo/bar/baz")));
EXPECT_THAT(paths.prefix(), Eq(""));