-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows does not allow symlinks by default, resulting in some packages unable to be unpacked correctly #17652
Comments
Doesn't reproduce for me using |
…s to reduce first-time compile-time. Resolves #110 Resolves #117 (I did however decide to use static linking, I had some issues with dynamic linking) Also getting closer to #118 Additionally this avoids the problem caused by ziglang/zig#17652 since harfbuzz is precompiled.
Weird. Maybe it only happens with certain user permissions or something like that? |
Could they try using a newer version of Zig? There were some symlink and tar related PRs merged recently |
Zig does support symlinks on Windows, and the package manager supports them correctly as well. The problem is the OS does not allow them without a setting being toggled. In this use case, Here are two ways for the situation to be resolved:
|
Just to add something on top of that, a quick fix if someone encounters this issue is to enable Developer Mode. I had the |
Putting aside harfbuzz and the current implementation in the Zig build system... I suspect it would still be a problem even if the hash was calculated before the package was extracted to ensure the package matched what the maintainer expects: if the files are needed then skipping them would break the Windows build, while copying would imply the maintainer should supply a max depth to limit infinite loops. Symlinks are not enabled on Windows by default because it is a security issue for the platform. Specifically, app developers and even the OS devs often do not have symlinks in mind. Giving users (or yourself) the permission to create symlinks can open up your dev machine to some rare attacks per the warning in the docs. I am developing and building on a Windows machine and can actively reproduce this issue with libxml2. Specifically when consuming zig-build-libxml2: .dependencies = .{
.libxml2 = .{
.url = "https://github.com/ianprime0509/zig-build-libxml2/archive/4d1b7db156b0e7a19127c652adefdf27799770ab.tar.gz",
.hash = "122011b13203141cc965cfe6b070ffb5a8835eb906bb2cfd4650dbc17574e6e36fd5",
},
},
Edit: I'm running a recent master branch build, 0.12.0-dev.2208+4debd4338. |
Throwing this idea out there and acknowledging it's probably bad / would possibly lead to annoying/bad quirks/errors but: |
thank you so much i love u |
Proposed solution: #22350 |
|
Zig Version
zig-windows-x86_64-0.12.0-dev.983+78f2ae7f2
Steps to Reproduce and Observed Behavior
Download my project on windows:
https://github.com/PixelGuys/Cubyz/tree/0c2d309f2af7e66fdb99bb5dac2a2237635151aa
(Sorry for just dumping the entire project here. I don't own windows, so sadly I couldn't create a minimal reproducible. So I only have a report from a user who stumbled over the error)
Run it with
zig build run
orrun.bat
(this one automatically downloads the right zig version)Observe the following error:
Expected Behavior
Zig should support packages that contain symlinks. It works fine on Linux by the way.
If it is impossible to create symlinks on windows without permissions, then zig should at least use a workaround, like replacing the symlink file with a copy of the original or something like that.
The text was updated successfully, but these errors were encountered: