diff --git a/lib/std/posix.zig b/lib/std/posix.zig index f1f4e279d1726ad4997dc2f2009755887aa3c520..a12182b4065d1ee518bd7c82ac938c4b4e693ea0 100644 --- a/lib/std/posix.zig +++ b/lib/std/posix.zig @@ -521,6 +521,7 @@ pub fn getppid() pid_t { pub const GetCwdError = error{ NameTooLong, + /// Not possible on Windows. CurrentWorkingDirectoryUnlinked, } || UnexpectedError; diff --git a/lib/std/process.zig b/lib/std/process.zig index dbf2fbe666311a8a7236630e19f20c4b32d54933..6798bba675b9cbe98da2d8fe438c04a285e5d1f6 100644 --- a/lib/std/process.zig +++ b/lib/std/process.zig @@ -73,7 +73,10 @@ pub fn getCwd(out_buffer: []u8) GetCwdError![]u8 { } // Same as GetCwdError, minus error.NameTooLong + Allocator.Error -pub const GetCwdAllocError = Allocator.Error || error{CurrentWorkingDirectoryUnlinked} || posix.UnexpectedError; +pub const GetCwdAllocError = Allocator.Error || error{ + /// Not possible on Windows. + CurrentWorkingDirectoryUnlinked, +} || posix.UnexpectedError; /// Caller must free the returned memory. /// On Windows, the result is encoded as [WTF-8](https://wtf-8.codeberg.page/). @@ -342,8 +345,6 @@ pub const SpawnError = error{ /// Windows-only. `cwd` or `argv` was provided and it was invalid WTF-8. /// https://wtf-8.codeberg.page/ InvalidWtf8, - /// Windows-only. `cwd` was provided, but the path did not exist when spawning the child process. - CurrentWorkingDirectoryUnlinked, /// Windows-only. NUL (U+0000), LF (U+000A), CR (U+000D) are not allowed /// within arguments when executing a `.bat`/`.cmd` script. /// - NUL/LF signifiies end of arguments, so anything afterwards diff --git a/lib/std/zig/system.zig b/lib/std/zig/system.zig index 0e7d814a71f1f28f424509d481a1106282924bd2..8bb1678e7d0244a0206ab14952fd5dc3d35fe19a 100644 --- a/lib/std/zig/system.zig +++ b/lib/std/zig/system.zig @@ -504,7 +504,6 @@ pub fn resolveTargetQuery(io: Io, query: Target.Query) DetectError!Target { if (builtin.os.tag == .linux and result.isBionicLibC() and query.os_tag == null and query.android_api_level == null) { result.os.version_range.linux.android = detectAndroidApiLevel(io) catch |err| return switch (err) { error.InvalidWtf8, - error.CurrentWorkingDirectoryUnlinked, error.InvalidBatchScriptArg, => unreachable, // Windows-only error.ApiLevelQueryFailed => |e| e, diff --git a/src/Compilation.zig b/src/Compilation.zig index 85fceebfb88aab25eeedd87946fb7477c2ce09fc..15c1837ec2dfb6a8f23691868b3f414828d4af5e 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -1851,7 +1851,6 @@ fn addModuleTableToCacheHash( ) error{ OutOfMemory, Unexpected, - CurrentWorkingDirectoryUnlinked, }!void { assert(zcu.module_roots.count() != 0); // module_roots is populated @@ -1919,7 +1918,6 @@ pub const CreateError = error{ OutOfMemory, Canceled, Unexpected, - CurrentWorkingDirectoryUnlinked, /// An error has been stored to `diag`. CreateFail, }; @@ -2906,7 +2904,6 @@ pub const UpdateError = error{ OutOfMemory, Canceled, Unexpected, - CurrentWorkingDirectoryUnlinked, }; /// Detect changes to source files, perform semantic analysis, and update the output files. diff --git a/src/Sema.zig b/src/Sema.zig index 191da7c30dda58400f157c61d5739412cf08b7e0..ea2890ee6a220a0cc013f6735057f8ee27e92ed3 100644 --- a/src/Sema.zig +++ b/src/Sema.zig @@ -13604,10 +13604,6 @@ fn zirEmbedFile(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!A error.ImportOutsideModulePath => { return sema.fail(block, operand_src, "embed of file outside package path: '{s}'", .{name}); }, - error.CurrentWorkingDirectoryUnlinked => { - // TODO: this should be some kind of retryable failure, in case the cwd is put back - return sema.fail(block, operand_src, "unable to resolve '{s}': working directory has been unlinked", .{name}); - }, error.OutOfMemory => |e| return e, error.Canceled => |e| return e, }; diff --git a/src/Zcu/PerThread.zig b/src/Zcu/PerThread.zig index d79b66b7c2a6b8b4216fbd372c01e6871f23c830..950a3e5a19f5c08524df7087aa201f54e4f05400 100644 --- a/src/Zcu/PerThread.zig +++ b/src/Zcu/PerThread.zig @@ -2388,7 +2388,6 @@ pub fn embedFile( OutOfMemory, Canceled, ImportOutsideModulePath, - CurrentWorkingDirectoryUnlinked, }!Zcu.EmbedFile.Index { const zcu = pt.zcu; const gpa = zcu.gpa;