zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit 4521456f66122c6348ef6980ae1eecdb94f4f110 (tree)
parent e42f83825f1473661700f89ffd3060013261d605
Author: Motiejus Jakštys <motiejus@uber.com>
Date:   Mon, 19 Sep 2022 16:24:07 +0300

zig cc: emit to a.out if outpath is unspecified

If `-o` is not specified for `zig cc` for linking, it should emit the
`a.out` (or equivalent) to the current directory. So then this:

    $ zig cc test.c

Should result in `./a.out`.

If directory is omitted from `Compilation.EmitLoc`, it will default to
the cache directory later in the compilation chain, which will result
in `a.out` missing in the current directory.

If we specify the directory to `Compilation.EmitLoc`, it will be
handled, allegedly, correctly.

Fixes #12858

Diffstat:
Msrc/main.zig | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/main.zig b/src/main.zig @@ -2613,7 +2613,7 @@ fn buildOutputType( } }, .yes_a_out => Compilation.EmitLoc{ - .directory = null, + .directory = .{ .path = null, .handle = fs.cwd() }, .basename = a_out_basename, }, };