change how bunx caches things (#8921)

* some things

* yeah

* ok

* fix compilation error

* fix on windows

* ok

* username
This commit is contained in:
dave caruso
2024-02-20 18:58:12 -08:00
committed by GitHub
parent 48e7c0fb8e
commit 5c6b9ea9b6
14 changed files with 260 additions and 126 deletions

View File

@@ -1827,11 +1827,11 @@ pub fn assertIsValidWindowsPath(comptime T: type, path: []const T) void {
if (bun.path.Platform.windows.isAbsoluteT(T, path) and
isWindowsAbsolutePathMissingDriveLetter(T, path))
{
std.debug.panic("Do not pass posix paths to windows APIs, was given '{s}' (missing a root like 'C:\\', see PosixToWinNormalizer for why this is an assertion)", .{
std.debug.panic("Internal Error: Do not pass posix paths to Windows APIs, was given '{s}'" ++ if (Environment.isDebug) " (missing a root like 'C:\\', see PosixToWinNormalizer for why this is an assertion)" else ". Please open an issue on GitHub with a reproduction.", .{
if (T == u8) path else std.unicode.fmtUtf16le(path),
});
}
if (hasPrefixComptimeType(T, path, ":/")) {
if (hasPrefixComptimeType(T, path, ":/") and Environment.isDebug) {
std.debug.panic("Path passed to windows API '{s}' is almost certainly invalid. Where did the drive letter go?", .{
if (T == u8) path else std.unicode.fmtUtf16le(path),
});