turborepo
41736dca - fix: avoid panic during task cache construction (#5882)

Commit
2 years ago
fix: avoid panic during task cache construction (#5882) ### Description When hooking up the task graph visitor to the task cache I hit a [failing debug assertion](https://github.com/vercel/turbo/blob/main/crates/turborepo-paths/src/absolute_system_path.rs#L179). This was triggered by the the [join we perform](https://github.com/vercel/turbo/blob/main/crates/turborepo-lib/src/run/cache.rs#L69) in the task graph construction. This PR: - We join anchored workspace directory instead of the resolved absolute system path. [This now matches Go](https://github.com/vercel/turbo/blob/main/cli/internal/runcache/runcache.go#L313) - Moves this logic into it's own method so it can be tested without an entire `RunCache` instance - Removes an unnecessary cloning of the `TaskOutput` object I'll note that this *probably* isn't what we want to do in the future as we're joining anchored system paths with globs that will [most definitely contain relative unix paths](https://github.com/vercel/turbo/blob/main/cli/internal/nodes/packagetask.go#L38). On windows this results in globs like `apps\web\.turbo/turbo-build.log`. I do want to fix this, but since that would be a behavior change in both Go&Rust, it belongs in its own PR. ### Testing Instructions Moved code that panicked to it's own method and added a unit test that would exercise it. --------- Co-authored-by: Chris Olszewski <Chris Olszewski>
Parents
Loading