diff options
author | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-04-24 16:13:47 +0200 |
---|---|---|
committer | Klaus Aehlig <klaus.aehlig@huawei.com> | 2025-04-24 17:46:35 +0200 |
commit | 15f3c80f2a22b136e11f0118f4886a8668469c1f (patch) | |
tree | b76f21c2c5575981e63ba45bd50eb44672c7a034 | |
parent | 5615498846307cb8f08e5485e5091cda7969d502 (diff) | |
download | justbuild-15f3c80f2a22b136e11f0118f4886a8668469c1f.tar.gz |
profile: fix path rebasing
During execution, paths are relative to the working directory of the
action; however, in our representation, all paths are always relative
to the action root. Commit d65d711f844224dcf9215c52be8f69fd2885adfc
tried to change the reporing to our usual standard, however got
the direction wrong; fix this.
-rw-r--r-- | src/buildtool/profile/TARGETS | 1 | ||||
-rw-r--r-- | src/buildtool/profile/profile.cpp | 5 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/buildtool/profile/TARGETS b/src/buildtool/profile/TARGETS index 7906c2b4..318ed075 100644 --- a/src/buildtool/profile/TARGETS +++ b/src/buildtool/profile/TARGETS @@ -13,7 +13,6 @@ , ["src/buildtool/common", "cli"] , ["src/buildtool/common", "common"] , ["src/utils/cpp", "expected"] - , ["src/utils/cpp", "path_rebase"] ] , "stage": ["src", "buildtool", "profile"] } diff --git a/src/buildtool/profile/profile.cpp b/src/buildtool/profile/profile.cpp index bc0560cf..6e7e8d47 100644 --- a/src/buildtool/profile/profile.cpp +++ b/src/buildtool/profile/profile.cpp @@ -14,13 +14,13 @@ #include "src/buildtool/profile/profile.hpp" +#include <filesystem> #include <fstream> #include "gsl/gsl" #include "src/buildtool/common/artifact_digest.hpp" #include "src/buildtool/common/cli.hpp" #include "src/utils/cpp/expected.hpp" -#include "src/utils/cpp/path_rebase.hpp" void Profile::Write(int exit_code) { if (not actions_.empty()) { @@ -140,9 +140,10 @@ void Profile::NoteActionCompleted(std::string const& id, } } else { + std::filesystem::path base{cwd}; for (auto const& [k, v] : **artifacts) { actions_[id].artifacts.emplace( - RebasePathStringRelativeTo(cwd, k), v.digest.hash()); + (base / k).lexically_normal().string(), v.digest.hash()); } } } |