Closed kamidev closed 2 years ago
Running 'zig build test' from root of Mach repo fails with the same error.
By the way, the sysaudio tests pass on an Intel Mac.
Tests now pass on M1 Mac using latest versions of Zig and Mach. The same test output is produced by 'stage1 build test' from root and in the project directory.
➜ sysaudio git:(main) ✗ git log -1 | tee
commit 6eaacde4443cb25e17715d15778914ebf33ec066
Author: PiergiorgioZagaria <pgiorgio.zagaria@gmail.com>
Date: Thu Jul 28 12:24:11 2022 +0200
gamemode: Add linux_gamemode_is_active field to Platform
➜ sysaudio git:(main) ✗ stage1 version
0.10.0-dev.3369+fdaf9c40d
➜ sysaudio git:(main) ✗ stage1 build test
All 2 tests passed.
Test [6/6] test "requestDevice behavior: invalid id"... SKIP
5 passed; 1 skipped; 0 failed.
The same test fails again using the latest zig, see session below. Running 'zig build test' from root directory fails the same way.
Also beware that there is a known linker problem that can cause very high RAM usage building on MacOS. This has been fixed on a branch but is not yet merged to zig master.
➜ sysaudio git:(main) ✗ stage1 version
0.10.0-dev.3395+ff125db53
➜ sysaudio git:(main) ✗ git log -1 | tee
commit 0b187c44dbb38fe26be5fd365664cbebe57687a3
Author: Casey Banner <kcbanner@gmail.com>
Date: Sun Jul 31 16:56:13 2022 -0400
glfw: add shared option which builds glfw into its own shared library (#442)
* Add shared option which builds glfw into it's own shared library
* glfw: separate shared test build step
* glfw: cleanup shared linking
Signed-off-by: Stephen Gutekanst <stephen@hexops.com>
Co-authored-by: Stephen Gutekanst <stephen@hexops.com>
➜ sysaudio git:(main) ✗ stage1 build test
All 2 tests passed.
Test [3/6] test "connect to device from descriptor"... FAIL (DeviceUnavailable)
/Users/jonas/src/zig/mach/sysaudio/src/soundio.zig:114:21: 0x1008ae30b in soundio.requestDevice (sysaudio-tests)
return if (switch (config.mode.?) {
^
/Users/jonas/src/zig/mach/sysaudio/src/main.zig:59:5: 0x1008ab63f in requestDevice (sysaudio-tests)
return self.backend.requestDevice(config);
^
/Users/jonas/src/zig/mach/sysaudio/src/main.zig:93:15: 0x1008a8ce7 in test "connect to device from descriptor" (sysaudio-tests)
const d = try a.requestDevice(device_desc);
^
Test [6/6] test "requestDevice behavior: invalid id"... SKIP
4 passed; 1 skipped; 1 failed.
The following command exited with error code 1 (expected 0):
cd /Users/jonas/src/zig/mach/sysaudio && /Users/jonas/src/zig/mach/sysaudio/zig-cache/o/b66320cfcfda09f701c1e44cbf00a1f1/sysaudio-tests /Users/jonas/src/zig/zig/build/stage1/bin/zig
error: UnexpectedExitCode
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/os.zig:2749:19: 0x104b4f77f in std.os.mkdiratZ (build)
.EXIST => return error.PathAlreadyExists,
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/os.zig:2709:9: 0x104b4f603 in std.os.mkdirat (build)
return mkdiratZ(dir_fd, &sub_dir_path_c, mode);
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/fs.zig:1332:9: 0x104b4f48f in std.fs.Dir.makeDir (build)
try os.mkdirat(self.fd, sub_path, default_new_dir_mode);
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/build/RunStep.zig:277:17: 0x104bac8cb in std.build.RunStep.runCommand (build)
return error.UnexpectedExitCode;
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/build/RunStep.zig:183:5: 0x104b99703 in std.build.RunStep.make (build)
try runCommand(
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/build.zig:3648:9: 0x104b4fd8b in std.build.Step.make (build)
try self.makeFn(self);
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/build.zig:508:9: 0x104b4ef13 in std.build.Builder.makeOneStep (build)
try s.make();
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/build.zig:502:17: 0x104b4ee87 in std.build.Builder.makeOneStep (build)
return err;
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/std/build.zig:463:13: 0x104b4337b in std.build.Builder.make (build)
try self.makeOneStep(s);
^
/Users/jonas/src/zig/zig/build/stage1/lib/zig/build_runner.zig:213:21: 0x104b3ee23 in main (build)
else => return err,
^
This is pure speculation. But Mach runs tests in a fairly topdown fashion from the root level 'build.zig'. A series of build steps are run in sequence and should be independent of each other. What if that chain of build steps uses too much initialized information as parameters? Could it be made simpler?
tests still fails when running zig build test
in sysaudio/
. it's surly a problem with me zig
Apple M1 Max. macOS Version 12.5 (Build 21G72) Zig stage1 version 0.10.0-dev.3361