Skip to content

zig build config panic due to invalid object name on windows #194

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
bbodi opened this issue Nov 16, 2020 · 5 comments
Closed

zig build config panic due to invalid object name on windows #194

bbodi opened this issue Nov 16, 2020 · 5 comments

Comments

@bbodi
Copy link

bbodi commented Nov 16, 2020

Hi,

  • zig version: 0.7.0+6e2e747b0
  • zls version: bf4f653

Running zig build config run into panic on my machine due to a weird path name while it was looking for zig.exe.

Output:

Welcome to the ZLS configuration wizard! (insert mage emoji here)
Looking for 'zig' in PATH...
reached unreachable code
C:\Users\sharp\dev\zig\lib\zig\std\os\windows.zig:113:37: 0x7ff73e3afc59 in std.os.windows.OpenFile (build.obj)
            .OBJECT_NAME_INVALID => unreachable,
                                    ^
C:\Users\sharp\dev\zig\lib\zig\std\os.zig:4205:31: 0x7ff73e3d4bc0 in std.os.realpathW (build.obj)
                              ^
C:\Users\sharp\dev\zig\lib\zig\std\os.zig:4153:25: 0x7ff73e3beecd in std.os.realpath (build.obj)
        return realpathW(pathname_w.span(), out_buffer);
C:\Users\sharp\dev\zls\build.zig:39:75: 0x7ff73e3b9226 in [email protected] (build.obj)
            zig_exe_path = try std.mem.dupe(allocator, u8, std.os.realpath(full_path, &buf) catch continue);
                                                                          ^
        try self.makeFn(self);
                       ^
C:\Users\sharp\dev\zig\lib\zig\std\build.zig:435:19: 0x7ff73e3a94c8 in std.build.Builder::std.build.Builder.makeOneStep (build.obj)
        try s.make();
                  ^
C:\Users\sharp\dev\zig\lib\zig\std\build.zig:390:33: 0x7ff73e39e77f in std.build.Builder::std.build.Builder.make (build.obj)
            try self.makeOneStep(s);
                                ^
C:\Users\sharp\dev\zig\lib\zig\std\special\build_runner.zig:133:17: 0x7ff73e384694 in main (build.obj)
    builder.make(targets.span()) catch |err| {
                ^
C:\Users\sharp\dev\zig\lib\zig\std\start.zig:173:65: 0x7ff73e3819ae in std.start.WinStartup (build.obj)
    std.os.windows.kernel32.ExitProcess(initEventLoopAndCallMain());
                                                                ^
Unable to dump stack trace: FileNotFound
error: the following build command failed with exit code 2147483651:

I debugged and the problematic path was this: C:\Program Files (x86)\Gpg4win\..\GnuPG\bin\zig.exe

@cursey
Copy link

cursey commented Dec 14, 2020

I am also running into this issue. Exact same problematic path on my machine.

@jordanorelli
Copy link

hmm, I had this problem too, but with a different path, and I was able to debug it. Curiously, I actually went looking into issues because I'm having trouble getting this to build on Linux, but I got it to build on Windows just fine; I then tinkered to try to reproduce your error and was able to reproduce it.

I compiled zls just fine on windows by following the current provided instructions in the readme, reproduced here for posterity:

git clone --recurse-submodules https://github.com/zigtools/zls
cd zls
zig build -Drelease-safe
zig build config # Configure ZLS

This was using zig 0.7.1 from zls commit d5aa131 on Windows. I ran this successfully inside of git bash inside of terminal.exe.

I was also able to reproduce your bug, by doing the exact same thing ... in cmd.exe. Oddly, it does not work in cmd.exe, but DOES work in Git Bash.

I also debugged this and found a problematic search path: C:\Program Files (x86)\ChucK\/bin\zig.exe (related to ChucK). I'm not sure why the ChucK installer put a backwards slash in my path, I'll file that separately over on their project.

um, do you have a directory on your path that has a .. component in it? Try removing that. Alternatively, try running this inside of git bash.

I believe this is the related issue in zig itself: ziglang/zig#6044

This was referenced Mar 30, 2021
@tau-dev
Copy link
Contributor

tau-dev commented Mar 30, 2021

Does this still happen as of the latest commit?

@tau-dev
Copy link
Contributor

tau-dev commented Apr 1, 2021

I will try to repro this and #158 as soon as I get my installation of Windows running again.

@alexnask
Copy link
Member

alexnask commented Apr 3, 2021

Closed in #286, please reopen this if you still are facing issues.

@alexnask alexnask closed this as completed Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants