Zig Version
0.17.0-dev.203+073889523
Steps to Reproduce, Observed Behavior, and Expected Behavior
On Windows x64.
(削除) Expectation: Zig should be able to handle any type of file in the repository. (削除ここまで)
Expectation: Zig should report the reason for zig fetch failure.
Bug Report
If a project contains symbolic links (symlinks), it cannot be successfully fetched by the zig fetch command.
Here is a minimal example: a project that includes a symlink pointing to the README file. When you attempt to fetch it with zig fetch, the following error occurs:
error: unable to hash 'README': Unexpected
I have also built a debug version of the latest version of Zig. It outputs:
error.Unexpected NTSTATUS=0x103 (PENDING)
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:1459:40: 0x7ff60f29b409 in unexpectedNtstatus (zig_zcu.obj)
return windows.unexpectedStatus(status);
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:8202:59: 0x7ff60f2ff021 in dirReadLinkWindows (zig_zcu.obj)
else => |status| return syscall.unexpectedNtstatus(status),
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:8079:46: 0x7ff60f2fc9a4 in dirReadLink (zig_zcu.obj)
.windows => return dirReadLinkWindows(dir, sub_path, buffer),
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Dir.zig:1303:33: 0x7ff60f713e40 in readLink (zig_zcu.obj)
return io.vtable.dirReadLink(io.userdata, dir, sub_path, buffer);
^
E:\_dev\zig\src\Package\Fetch.zig:1922:54: 0x7ff60f729a60 in hashFileFallible (zig_zcu.obj)
const link_name = buf[0..try dir.readLink(io, hashed_file.fs_path, &buf)];
^
E:\_dev\zig\src\Package\Fetch.zig:1890:43: 0x7ff60f729699 in workerHashFile (zig_zcu.obj)
hashed_file.failure = hashFileFallible(io, dir, hashed_file);
^
E:/_dev/zig/build/stage3/lib/zig/std/Io.zig:1265:17: 0x7ff60f72955b in start (zig_zcu.obj)
_ = @as(Cancelable!void, @call(.auto, function, args_casted.*)) catch {};
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:553:22: 0x7ff60f312427 in start (zig_zcu.obj)
task.func(task.contextPointer());
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:1798:29: 0x7ff60f31167f in worker (zig_zcu.obj)
runnable.startFn(runnable, &thread, t);
^
E:/_dev/zig/build/stage3/lib/zig/std/Thread.zig:422:13: 0x7ff60f3111b1 in callFn__anon_48619 (zig_zcu.obj)
@call(.auto, f, args);
^
E:/_dev/zig/build/stage3/lib/zig/std/Thread.zig:536:30: 0x7ff60f31108a in entryFn (zig_zcu.obj)
return callFn(f, self.fn_args);
^
???:?:?: 0x7ffaabd5e956 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffaad267c1b in ??? (ntdll.dll)
error: unable to hash 'README': Unexpected
But PENDING seems to be an error that should not have occurred.
About
On ziggit
### Zig Version
0.17.0-dev.203+073889523
### Steps to Reproduce, Observed Behavior, and Expected Behavior
On Windows x64.
~Expectation: Zig should be able to handle any type of file in the repository.~
Expectation: Zig should report the reason for `zig fetch` failure.
## Bug Report
If a project contains symbolic links (symlinks), it cannot be successfully fetched by the `zig fetch` command.
[Here](https://github.com/Verafahn/bug-report) is a minimal example: a project that includes a symlink pointing to the `README` file. When you attempt to fetch it with `zig fetch`, the following error occurs:
```
error: unable to hash 'README': Unexpected
```
I have also built a debug version of the latest version of Zig. It outputs:
```
error.Unexpected NTSTATUS=0x103 (PENDING)
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:1459:40: 0x7ff60f29b409 in unexpectedNtstatus (zig_zcu.obj)
return windows.unexpectedStatus(status);
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:8202:59: 0x7ff60f2ff021 in dirReadLinkWindows (zig_zcu.obj)
else => |status| return syscall.unexpectedNtstatus(status),
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:8079:46: 0x7ff60f2fc9a4 in dirReadLink (zig_zcu.obj)
.windows => return dirReadLinkWindows(dir, sub_path, buffer),
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Dir.zig:1303:33: 0x7ff60f713e40 in readLink (zig_zcu.obj)
return io.vtable.dirReadLink(io.userdata, dir, sub_path, buffer);
^
E:\_dev\zig\src\Package\Fetch.zig:1922:54: 0x7ff60f729a60 in hashFileFallible (zig_zcu.obj)
const link_name = buf[0..try dir.readLink(io, hashed_file.fs_path, &buf)];
^
E:\_dev\zig\src\Package\Fetch.zig:1890:43: 0x7ff60f729699 in workerHashFile (zig_zcu.obj)
hashed_file.failure = hashFileFallible(io, dir, hashed_file);
^
E:/_dev/zig/build/stage3/lib/zig/std/Io.zig:1265:17: 0x7ff60f72955b in start (zig_zcu.obj)
_ = @as(Cancelable!void, @call(.auto, function, args_casted.*)) catch {};
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:553:22: 0x7ff60f312427 in start (zig_zcu.obj)
task.func(task.contextPointer());
^
E:/_dev/zig/build/stage3/lib/zig/std/Io/Threaded.zig:1798:29: 0x7ff60f31167f in worker (zig_zcu.obj)
runnable.startFn(runnable, &thread, t);
^
E:/_dev/zig/build/stage3/lib/zig/std/Thread.zig:422:13: 0x7ff60f3111b1 in callFn__anon_48619 (zig_zcu.obj)
@call(.auto, f, args);
^
E:/_dev/zig/build/stage3/lib/zig/std/Thread.zig:536:30: 0x7ff60f31108a in entryFn (zig_zcu.obj)
return callFn(f, self.fn_args);
^
???:?:?: 0x7ffaabd5e956 in ??? (KERNEL32.DLL)
???:?:?: 0x7ffaad267c1b in ??? (ntdll.dll)
error: unable to hash 'README': Unexpected
```
But `PENDING` seems to be an error that should not have occurred.
## About
On [ziggit](https://ziggit.dev/t/zig-fetch-failed-if-target-project-contains-symlink/16275?u=verafahn)