Issue description
I think #3983 broke the Zig 0.12.0 build. If I pass --sysroot with an absolute path I now get
thread 637865 panic: sub_path is expected to be relative to the build root, but was this absolute path: '/home/lilith/Developer/emsdk/upstream/emscripten/cache/sysroot/include'. It is best avoid absolute paths, but if you must, it is supported by LazyPath.cwd_relative
If I pass --sysroot with relative paths
thread 637149 panic: reached unreachable code
/home/lilith/.zigup/cache/0.12.0/files/lib/std/debug.zig:403:14: 0x10b5bfd in assert (build)
if (!ok) unreachable; // assertion failure
^
/home/lilith/.zigup/cache/0.12.0/files/lib/std/fs.zig:280:11: 0x10f0b3a in openDirAbsolute (build)
assert(path.isAbsolute(absolute_path));
^
due to the std.fs.openAbsoluteDir verifying that a path is absolute or not. I think the changes in #3983 are well intended but are maybe too soon. Upgrading to Zig 0.13.0 when it is released will likely require more work than just changing one line...
I have a commit in a fork I am happy to PR that just reverts the change in #3983. I have tested it and it seems to work fine.
Edit: to suggest a compromise, one could also use something other than openAbsoluteDir to keep some version compat with newer 0.13.0-dev releases.
Environment
Cloned master branch and built with Zig version 0.12.0 with
zig build -Dtarget=wasm32-emscripten --sysroot "/home/lilith/Developer/emsdk/upstream/emscripten"
Issue description
I think #3983 broke the Zig 0.12.0 build. If I pass
--sysrootwith an absolute path I now getIf I pass
--sysrootwith relative pathsdue to the
std.fs.openAbsoluteDirverifying that a path is absolute or not. I think the changes in #3983 are well intended but are maybe too soon. Upgrading to Zig 0.13.0 when it is released will likely require more work than just changing one line...I have a commit in a fork I am happy to PR that just reverts the change in #3983. I have tested it and it seems to work fine.
Edit: to suggest a compromise, one could also use something other than
openAbsoluteDirto keep some version compat with newer 0.13.0-dev releases.Environment
Cloned master branch and built with Zig version 0.12.0 with