diff --git a/src/install/lockfile.zig b/src/install/lockfile.zig index 69d92a4847..2e9fe25e3b 100644 --- a/src/install/lockfile.zig +++ b/src/install/lockfile.zig @@ -4744,7 +4744,7 @@ pub const Package = extern struct { const workspace = dependency_version.value.workspace.slice(buf); const path = string_builder.append(String, if (strings.eqlComptime(workspace, "*")) "*" else brk: { var buf2: bun.PathBuffer = undefined; - break :brk Path.relativePlatform( + const rel = Path.relativePlatform( FileSystem.instance.top_level_dir, Path.joinAbsStringBuf( FileSystem.instance.top_level_dir, @@ -4758,6 +4758,8 @@ pub const Package = extern struct { .auto, false, ); + bun.path.dangerouslyConvertPathToPosixInPlace(u8, Path.relative_to_common_path_buf[0..rel.len]); + break :brk rel; }); if (comptime Environment.allow_assert) { assert(path.len() > 0); diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig index 35e23c6572..c1f9b3e995 100644 --- a/src/resolver/resolve_path.zig +++ b/src/resolver/resolve_path.zig @@ -307,7 +307,7 @@ pub fn longestCommonPathPosix(input: []const []const u8) []const u8 { return longestCommonPathGeneric(input, .posix); } -threadlocal var relative_to_common_path_buf: bun.PathBuffer = undefined; +pub threadlocal var relative_to_common_path_buf: bun.PathBuffer = undefined; /// Find a relative path from a common path // Loosely based on Node.js' implementation of path.relative