-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
zig fmt failure in Window Subsystem for Linux #2481
Comments
I'd be happy to take a crack at writing an MR for any of this, but again this is literally my first day using zig 😄 ! |
The lack of You could add a case to |
The set of syscalls available isn't consistent; for example some architectures only have the newer syscall. I've been meaning to audit this commit: 4a8c992 but haven't done it yet - will do it with #2380. |
Microsoft is going to be shipping a Linux kernel with full system call support in their next version of WSL. This issue might be made obsolete once that ships. https://devblogs.microsoft.com/commandline/announcing-wsl-2/ |
I'm new to zig so this may be doing something stupid, but it appears that
zig fmt
has an issue when running within WSL.System Config:
Windows 10 Version 10.0.17134 Build 17134
Running Ubuntu 18.04.1 via WSL
with a basic hello-world file:
V 0.4.0
V latest
Zig fmt is producing a cache file which appears to contain the desired contents alongside the file:
I've done some initial debugging by adding the following snippet in os.zig:
which tells me that the error number is
38
.Which is apparently:
After some digging it appears that os/linux.zig is using
renameat(2)
which is not implemented on WSL. According to this other issue yuk7/ArchWSL#5I do not know enough about the POSIX standards to tell if Zig is using a syscall which should not be expected to be universal across all Linux instances, or if WSL is out of spec (I suspect that latter).
I'm new to Zig, but it seems reasonable that following changes could be made:
The text was updated successfully, but these errors were encountered: