Skip to content
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

Running test on darling emulator fails with "Invalid argument" #7

Open
Ultra-Code opened this issue Dec 16, 2024 · 0 comments
Open

Comments

@Ultra-Code
Copy link
Collaborator

Extracted from #3 as reported by @ikks

$ zig build test -fdarling -Dtarget=x86_64-macos --verbose
/home/igor/playground/zig/zig-linux-x86_64-0.13.0/zig build-lib -fno-llvm -fno-lld -cflags -pthread -std=c23 -- /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mdb.c /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/midl.c -fno-strip -fno-sanitize-c -ODebug -target x86_64-macos -mcpu baseline -I /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb -D_XOPEN_SOURCE=600 -D_DARWIN_C_SOURCE= -Mroot -lc --cache-dir /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache --global-cache-dir /home/igor/.cache/zig --name lmdb -static -fno-lto --listen=- 
/home/igor/playground/zig/zig-linux-x86_64-0.13.0/zig build-exe -fno-lld -cflags -pthread -std=c17 -Wno-format -Wno-implicit-function-declaration -- /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest.c /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/af5309c5268b3016e41e0df6a099fb40/liblmdb.a -fno-sanitize-c -ODebug -target x86_64-macos -mcpu baseline -I /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb -I /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/d926581394ea455c2cfb25b410d07bd3 -Mroot -lc --cache-dir /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache --global-cache-dir /home/igor/.cache/zig --name mtest --listen=- 
/home/igor/playground/zig/zig-linux-x86_64-0.13.0/zig build-exe -fno-lld -cflags -pthread -std=c17 -Wno-format -Wno-implicit-function-declaration -- /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest3.c /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/af5309c5268b3016e41e0df6a099fb40/liblmdb.a -fno-sanitize-c -ODebug -target x86_64-macos -mcpu baseline -I /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb -I /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/d926581394ea455c2cfb25b410d07bd3 -Mroot -lc --cache-dir /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache --global-cache-dir /home/igor/.cache/zig --name mtest3 --listen=- 
/home/igor/playground/zig/zig-linux-x86_64-0.13.0/zig build-exe -fno-lld -cflags -pthread -std=c17 -Wno-format -Wno-implicit-function-declaration -- /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest2.c /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/af5309c5268b3016e41e0df6a099fb40/liblmdb.a -fno-sanitize-c -ODebug -target x86_64-macos -mcpu baseline -I /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb -I /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/d926581394ea455c2cfb25b410d07bd3 -Mroot -lc --cache-dir /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache --global-cache-dir /home/igor/.cache/zig --name mtest2 --listen=- 
/home/igor/playground/zig/zig-linux-x86_64-0.13.0/zig build-exe -fno-lld -cflags -pthread -std=c17 -Wno-format -Wno-implicit-function-declaration -- /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest5.c /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/af5309c5268b3016e41e0df6a099fb40/liblmdb.a -fno-sanitize-c -ODebug -target x86_64-macos -mcpu baseline -I /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb -I /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/d926581394ea455c2cfb25b410d07bd3 -Mroot -lc --cache-dir /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache --global-cache-dir /home/igor/.cache/zig --name mtest5 --listen=- 
/home/igor/playground/zig/zig-linux-x86_64-0.13.0/zig build-exe -fno-lld -cflags -pthread -std=c17 -Wno-format -Wno-implicit-function-declaration -- /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest4.c /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/af5309c5268b3016e41e0df6a099fb40/liblmdb.a -fno-sanitize-c -ODebug -target x86_64-macos -mcpu baseline -I /home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb -I /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/d926581394ea455c2cfb25b410d07bd3 -Mroot -lc --cache-dir /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache --global-cache-dir /home/igor/.cache/zig --name mtest4 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/05bcdd135085d51953865d4916b5f74b && /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/05bcdd135085d51953865d4916b5f74b/mtest2 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/10108c92fc6788c52269092bb506ba6f && /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/10108c92fc6788c52269092bb506ba6f/mtest --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/00b36cde7f4215889213353bf32613ad && /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/00b36cde7f4215889213353bf32613ad/mtest3 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/568382e0eaab2540dae61717dff39f57 && /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/568382e0eaab2540dae61717dff39f57/mtest5 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/10108c92fc6788c52269092bb506ba6f && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/10108c92fc6788c52269092bb506ba6f/mtest --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/05bcdd135085d51953865d4916b5f74b && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/05bcdd135085d51953865d4916b5f74b/mtest2 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/dfa4aebb5462e4d39725ce36c3cb117b && /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/dfa4aebb5462e4d39725ce36c3cb117b/mtest4 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/568382e0eaab2540dae61717dff39f57 && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/568382e0eaab2540dae61717dff39f57/mtest5 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/00b36cde7f4215889213353bf32613ad && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/00b36cde7f4215889213353bf32613ad/mtest3 --listen=- 
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/dfa4aebb5462e4d39725ce36c3cb117b && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/dfa4aebb5462e4d39725ce36c3cb117b/mtest4 --listen=- 
test
└─ run mtest2 failure
/home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest2.c:53: mdb_env_open(env, "./testdb", MDB_FIXEDMAP|MDB_NOSYNC, 0664): Invalid argument
error: the following command exited with code 1 (expected exited with code 0):
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/05bcdd135085d51953865d4916b5f74b && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/05bcdd135085d51953865d4916b5f74b/mtest2 --listen=- 
test
└─ run mtest4 failure
/home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest4.c:53: mdb_env_open(env, "./testdb", MDB_FIXEDMAP|MDB_NOSYNC, 0664): Invalid argument
error: the following command exited with code 1 (expected exited with code 0):
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/dfa4aebb5462e4d39725ce36c3cb117b && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/dfa4aebb5462e4d39725ce36c3cb117b/mtest4 --listen=- 
test
└─ run mtest failure
/home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest.c:50: mdb_env_open(env, "./testdb", MDB_FIXEDMAP , 0664): Invalid argument
error: the following command exited with code 1 (expected exited with code 0):
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/10108c92fc6788c52269092bb506ba6f && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/10108c92fc6788c52269092bb506ba6f/mtest --listen=- 
test
└─ run mtest5 failure
/home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest5.c:55: mdb_env_open(env, "./testdb", MDB_FIXEDMAP|MDB_NOSYNC, 0664): Invalid argument
error: the following command exited with code 1 (expected exited with code 0):
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/568382e0eaab2540dae61717dff39f57 && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/568382e0eaab2540dae61717dff39f57/mtest5 --listen=- 
test
└─ run mtest3 failure
/home/igor/.cache/zig/p/12205c0f7d4ad44b671cf89a7793aafa31ba4739f01b706313e4eadc944b734bd224/libraries/liblmdb/mtest3.c:55: mdb_env_open(env, "./testdb", MDB_FIXEDMAP|MDB_NOSYNC, 0664): Invalid argument
error: the following command exited with code 1 (expected exited with code 0):
cd /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/00b36cde7f4215889213353bf32613ad && darling /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/00b36cde7f4215889213353bf32613ad/mtest3 --listen=- 
Build Summary: 12/18 steps succeeded; 5 failed (disable with --summary none)
test transitive failure
├─ run mtest failure
├─ run mtest2 failure
├─ run mtest3 failure
├─ run mtest4 failure
└─ run mtest5 failure
error: the following build command failed with exit code 1:
/home/igor/playground/zig/lmdb-options/acbtu/.zig-cache/o/9c06fcce885bd4b49f2c310ec8dde17a/build /home/igor/playground/zig/zig-linux-x86_64-0.13.0/zig /home/igor/playground/zig/lmdb-options/acbtu /home/igor/playground/zig/lmdb-options/acbtu/.zig-cache /home/igor/.cache/zig --seed 0x78927385 -Zfb0b5f51d28c7661 test -fdarling -Dtarget=x86_64-macos --verbose

Though the tests run fine on MacOs in CI they fail under darling

With my early debuging I have noticed a few cases where installing and running the test work the first time but then consecutive runs fail with the "Invalid argument" error

Ultra-Code added a commit that referenced this issue Dec 16, 2024
* Run build tools on windows also to help catch regressions

* Overhaul and modularize build.zig

Also ensure one can build on and for windows
Awaiting testing to ensure test run on windows

resolves #3

* tools: disable mplay tool

It isn't cross compilable to windows due to the use of sys/wait.h
which is a posix system header

It also doesn't compile on musl libc because mplay modifies stdin and
stdout which are const in musl libc

The darling issue has been splited from #3 into #7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant