Closed Sahnvour closed 4 years ago
why is that needed?
Nevermind, I was persuaded I needed it at one point but apparently that was a mistake on my end.
Encountered again why I thought cache off is needed :
$ zig run --main-pkg-path . --pkg-begin app benchmarks/rand/main.zig --pkg-end --release-fast -lc bench.zig -- C:\dev\install\zig
Unable to open C:\dev\Zig\gotta-go-fast\benchmarks\std-hash-map\main.zig
: file not found
$ zig run --main-pkg-path . --pkg-begin app benchmarks/rand/main.zig --pkg-end --release-fast -lc bench.zig --cache off -- C:\dev\install\zig
{"samples_taken":15,"wall_time":{"median":703211300,"mean":703258923,"min":703119600,"max":703518900},"utime":{"median":0,"mean":0,"min":0,"max":0},"stime":{"median":0,"mean":0,"min":0,"max":0},"maxrss":0}
not sure why --cache off is relevant here. Is there a newline in the file path?
There's no new line, and until --cache off is used (as in the second command), it appears the build executable is not remade and then tries to compile an old file that doesn't exist anymore (just switched branches). Sorry, that wasn't very explicit.
It's probably a silly error but I just don't see it.
Hmmmm this potentially looks like package arguments not being properly added to the cache hash. That's a big deal, we have to fix it, we can't just suggest to turn the cache off!
main.zig
does it, and it's very much needed :)