It seems that Elrond is assuming that the CWD is the root of the project as running zig build from, for example, the exercises directory results in this:
Output
~/git/ziglings/exercises main
❯ zig build
[... snip ...]
Progress: [>-----------------------------------------------------------] 1/115
Compiling 001_hello.zig...
Checking 001_hello.zig...
error: failed to check cache: 'exercises/001_hello.zig' file_hash FileNotFound
[... snip ...]
Edit exercises/001_hello.zig and run 'zig build' again.
ziglings
└run exe elrond failure
[... snip ...]
While when run from the root of the project:
Output
❯ /Users/perry/git/zig/stage3/bin/zig build
[... snip ...]
Progress: [>-----------------------------------------------------------] 1/115
Compiling 001_hello.zig...
Checking 001_hello.zig...
/Users/perry/git/zig/stage3/lib/zig/std/start.zig:750:43: error: 'main' is not marked 'pub'
const fn_info = @typeInfo(@TypeOf(root.main)).@"fn";
~~~~^~~~~
exercises/001_hello.zig:19:1: note: declared here
fn main() void {
^~~~~~~~~~~~~~
/Users/perry/git/zig/stage3/lib/zig/std/start.zig:692:20: note: called inline here
return callMain(argv[0..argc], env_block);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/perry/git/zig/stage3/lib/zig/std/start.zig:644:38: note: called inline here
std.process.exit(callMainWithArgs(argc, argv, envp));
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
referenced by:
_start: /Users/perry/git/zig/stage3/lib/zig/std/start.zig:523:40
comptime: /Users/perry/git/zig/stage3/lib/zig/std/start.zig:86:67
2 reference(s) hidden; use '-freference-trace=4' to see all references
[... snip ...]
Edit exercises/001_hello.zig and run 'zig build' again.
ziglings
└run exe elrond failure
[... snip ...]
(The specific use-case that I found this affecting was in emacs where zig-mode will run zig build in the directory of whatever file you're currently in when using M-x zig-compile.)
It seems that Elrond is assuming that the CWD is the root of the project as running `zig build` from, for example, the exercises directory results in this:
<details>
<summary>Output</summary>
```
~/git/ziglings/exercises main
❯ zig build
[... snip ...]
Progress: [>-----------------------------------------------------------] 1/115
Compiling 001_hello.zig...
Checking 001_hello.zig...
error: failed to check cache: 'exercises/001_hello.zig' file_hash FileNotFound
[... snip ...]
Edit exercises/001_hello.zig and run 'zig build' again.
ziglings
└run exe elrond failure
[... snip ...]
```
</details>
While when run from the root of the project:
<details>
<summary>Output</summary>
```
❯ /Users/perry/git/zig/stage3/bin/zig build
[... snip ...]
Progress: [>-----------------------------------------------------------] 1/115
Compiling 001_hello.zig...
Checking 001_hello.zig...
/Users/perry/git/zig/stage3/lib/zig/std/start.zig:750:43: error: 'main' is not marked 'pub'
const fn_info = @typeInfo(@TypeOf(root.main)).@"fn";
~~~~^~~~~
exercises/001_hello.zig:19:1: note: declared here
fn main() void {
^~~~~~~~~~~~~~
/Users/perry/git/zig/stage3/lib/zig/std/start.zig:692:20: note: called inline here
return callMain(argv[0..argc], env_block);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/perry/git/zig/stage3/lib/zig/std/start.zig:644:38: note: called inline here
std.process.exit(callMainWithArgs(argc, argv, envp));
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
referenced by:
_start: /Users/perry/git/zig/stage3/lib/zig/std/start.zig:523:40
comptime: /Users/perry/git/zig/stage3/lib/zig/std/start.zig:86:67
2 reference(s) hidden; use '-freference-trace=4' to see all references
[... snip ...]
Edit exercises/001_hello.zig and run 'zig build' again.
ziglings
└run exe elrond failure
[... snip ...]
```
</details>
(The specific use-case that I found this affecting was in emacs where zig-mode will run zig build in the directory of whatever file you're currently in when using `M-x zig-compile`.)