Skip to content

failed to run zig fmt on windows #7654

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

Closed
wsdjeg opened this issue Jan 2, 2021 · 4 comments
Closed

failed to run zig fmt on windows #7654

wsdjeg opened this issue Jan 2, 2021 · 4 comments
Labels
bug Observed behavior contradicts documented or intended behavior os-windows zig fmt
Milestone

Comments

@wsdjeg
Copy link

wsdjeg commented Jan 2, 2021

I am using latest version of zig, downloaded from https://ziglang.org/builds/zig-windows-x86_64-0.7.1+dfacac916.zip

the version is:

C:\Users\wsdjeg\Desktop>zig version
0.7.1+dfacac916

the test file is:

const std = @import("std");

pub fn main() !void {
    const stdout = std.io.getStdOut().writer();
    try stdout.print("Hello, {}!\n", .{"world"});
}

the result of zig run, zig test and zig fmt is:

C:\Users\wsdjeg\Desktop>zig run test.zig
Hello, world!

C:\Users\wsdjeg\Desktop>zig fmt test.zig
error: unable to open 'test.zig': error.Unexpected

C:\Users\wsdjeg\Desktop>zig test test.zig
Semantic Analysis [785/1153] No tests to run.

there is no extra useful information for debug this issue.

@rohlem
Copy link
Contributor

rohlem commented Jan 2, 2021

What Windows version did you run this on? I get the same result on Windows 7 SP1 (*), though it worked when I last used it on newest Windows 10 (about 2 weeks ago).
Compatibility with / support for versions before Windows 10 is desired in general, but less commonly tested.

(*) even with #7379 EDIT: only applied to my standard library; I didn't check whether rebuilding zig.exe (which I can't comfortably do atm) might have helped.

@andrewrk andrewrk added bug Observed behavior contradicts documented or intended behavior os-windows labels Jan 3, 2021
@andrewrk andrewrk added this to the 0.8.0 milestone Jan 3, 2021
@wsdjeg
Copy link
Author

wsdjeg commented Jan 3, 2021

I am using win 7, the result of ver is:

C:\Users\wsdjeg\.SpaceVim>ver

Microsoft Windows [版本 6.1.7601]

@rohlem
Copy link
Contributor

rohlem commented Jan 12, 2021

zig fmt seems to work for me (same version / ver output) in newest builds, now that #7379 has landed in the compiler itself.
(With the exception of ".." in relative paths, which I assume is pending on #7664 .)

@andrewrk andrewrk modified the milestones: 0.8.0, 0.8.1 Jun 4, 2021
@andrewrk andrewrk modified the milestones: 0.8.1, 0.9.1 Aug 31, 2021
@andrewrk andrewrk modified the milestones: 0.9.1, 0.9.0 Nov 20, 2021
@andrewrk andrewrk modified the milestones: 0.9.0, 0.9.1 Nov 30, 2021
@andrewrk andrewrk modified the milestones: 0.9.1, 0.10.0 Feb 3, 2022
@andrewrk
Copy link
Member

I believe this is fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior os-windows zig fmt
Projects
None yet
Development

No branches or pull requests

3 participants