-
Notifications
You must be signed in to change notification settings - Fork 116
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
Building for Wasm "error: unable to spawn mkdir: FileNotFound" #86
Comments
ok i figured out that line 94 in the |
|
Hi, I'm encountering the same error. This is my first time using Zig. zig build -Dtarget=wasm32-emscripten --sysroot "C:\emsdk\upstream\emscripten" I get the following error: install
└─ run C:\emsdk\upstream\emscripten\emcc.bat
└─ run mkdir failure
error: unable to spawn mkdir: FileNotFound
Build Summary: 5/8 steps succeeded; 1 failed (disable with --summary none)
install transitive failure
└─ run C:\emsdk\upstream\emscripten\emcc.bat transitive failure
└─ run mkdir failure
error: the following build command failed with exit code 1:
C:\zig-raylib-game\.zig-cache\o\0c522e1745d6b40bc64b3b0e8b6eeb98\build.exe C:\zig\zig-windows-x86_64-0.13.0\zig.exe C:\zig-raylib-game C:\zig-raylib-game\.zig-cache C:\Users\[username]\AppData\Local\zig --seed 0xbb3af7ea -Za21555bea8f8d4b9 -Dtarget=wasm32-emscripten --sysroot C:\emsdk\upstream\emscripten My workaround is to copy the .{
.name = "project_name",
.version = "0.0.1",
.dependencies = .{
.@"raylib-zig" = .{ .path = "libs/raylib-zig" },
},
.paths = .{""},
} In // line 94 // const mkdir_command = b.addSystemCommand(&[_][]const u8{ "mkdir", "-p", emccOutputDir });
// line 104 // emcc_command.step.dependOn(&mkdir_command.step); Then, I manually call mkdir -p zig-out/htmlout I have no idea why I kind of wish I had seen JoeRocky's answer sooner. I spent a week tinkering with raylib-zig to finally get it to work. It was already a reported issue. 😅 |
So, I did some research and I think mkdir is only available inside try b.build_root.handle.makePath(emccOutputDir); I'm not sure if this is the right way of doing things in Zig, but hey, it works. |
Hello, I'm trying to build my raylib-zig project, that is working fine if I build it for my OS (Windows), to wasm.
When I run
zig build -Dtarget=wasm32-emscripten --sysroot C:\emsdk\upstream\emscripten
i get the following error:I also ran
just to make sure but it didnt help...
The text was updated successfully, but these errors were encountered: