Skip to content
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

Compiler subcommands go Kaboom with directory argument #1693

Closed
hryx opened this Issue Oct 31, 2018 · 0 comments

Comments

Projects
None yet
2 participants
@hryx
Copy link
Contributor

hryx commented Oct 31, 2018

...In various spectacular ways!

These all happen with stage1 compiler version 0.3.0+ca71373d on Linux.

Apologies if this issue is too broad; I can split it up if needed. And I would be glad to provide more detail or help in other ways.


Unreachable with zig run:

$ zig run .
unreachable: /deps/zig/src/os.cpp:os_file_read:1983
fish: “zig run .” terminated by signal SIGABRT (Abort)

$ zig run $HOME
unreachable: /deps/zig/src/os.cpp:os_file_read:1983
fish: “zig run $HOME” terminated by signal SIGABRT (Abort)

zig run treats a directory as a file:

$ zig run /etc
Unable to check cache: file not found

Subcommands other than zig run have reasonable errors...

$ zig test .
unable to open '<my CWD>': file system error

$ zig build-exe .
unable to open '<my CWD>': file system error

...but here, they interpret an absolute path as relative:

$ zig test /etc
unable to open '<my CWD>/etc': file not found

$ zig build-exe /etc
unable to open '<my CWD>/etc': file not found

For all compile subcommands, using / as an argument causes zig to hang indefinitely:

$ zig run /
(hangs for a long time, causing my hair to turn grey)

$ zig test /
(zig and I both wait for Godot, having a literary gunfight to pass the time)

$ zig build-exe /
(my hair turns back to blonde, which is strange because I wasn't blonde to being with)

@andrewrk andrewrk added this to the 0.4.0 milestone Oct 31, 2018

andrewrk added a commit that referenced this issue Nov 27, 2018

stage1: better file path handling
 * better message printed when cache hash fails
 * better handling of '/' as root source file
 * os_path_split parses '/' and '/a' correctly

closes #1693
closes #1746
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.