onekey-sec/unblob

devenv tasks test fails on aarch64 Linux

qkaiser opened this issue · 3 comments

Our Build Nix workflow is failing with these exceptions when built for aarch64 Linux :

nix build -L --option system aarch64-linux --extra-platforms aarch64-linux .#packages.aarch64-linux.devenv
--snip--
devenv> test tasks::test::test_dependency_failure ... ok
devenv> test tasks::test::test_nonexistent_script ... FAILED
devenv> test tasks::test::test_shell_escape ... ok
devenv> test tasks::test::test_inputs_outputs ... ok
devenv> test tasks::test::test_status_without_command ... ok
devenv> test tasks::test::test_task_name ... ok
devenv> test tasks::test::test_tasks_cycle ... ok
devenv> test tasks::test::test_status ... ok
devenv> test tasks::test::test_basic_tasks ... ok
devenv> test tasks::test::test_before_tasks ... ok
devenv> failures:
devenv> ---- tasks::test::test_nonexistent_script stdout ----
devenv> thread 'tasks::test::test_nonexistent_script' panicked at devenv/src/tasks.rs:1106:9:
devenv> assertion failed: `(left matches right)`
devenv> Diff < left / right > :
devenv> <[
devenv> <    (
devenv> <        "myapp:task_1",
devenv> <        Completed(
devenv> <            Failed(
devenv> <                3.552045ms,
devenv> <                TaskFailure {
devenv> <                    stdout: [],
devenv> <                    stderr: [],
devenv> <                    error: "Task exited with status: exit status: 127",
devenv> <                },
devenv> <            ),
devenv> <        ),
devenv> <    ),
devenv> <]
devenv> >[(task_1,
devenv> >TaskStatus::Completed(TaskCompleted::Failed(_, TaskFailure {
devenv> >stdout: _, stderr: _, error })))]
devenv> >if
devenv> >error == "No such file or directory (os error 2)" && task_1 == "myapp:task_1"
devenv> note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
devenv> failures:
devenv>     tasks::test::test_nonexistent_script
devenv> test result: FAILED. 14 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.68s
devenv> error: test failed, to rerun pass `-p devenv --lib`
error: builder for '/nix/store/q5id3zg5526rwna2f44l70dcn2r3ir4h-devenv-1.3.drv' failed with exit code 101;
       last 10 log lines:
       >
       > note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       >
       >
       > failures:
       >     tasks::test::test_nonexistent_script
       >
       > test result: FAILED. 14 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 1.68s
       >
       > error: test failed, to rerun pass `-p devenv --lib`
       For full logs, run 'nix log /nix/store/q5id3zg5526rwna2f44l70dcn2r3ir4h-devenv-1.3.drv'.

There's no mention of this on the devenv issue tracker. Not sure if the problem is coming from devenv or the action runner itself.

In a nutshell, a task with an inexistent script should raise a "No such file or directory (os error 2)" error message, but it raises "Task exited with status: exit status: 127" instead on aarch64.

127 being the status code for command not found.

@vlaci I think it should be reported to devenv, right ?

In a nutshell, a task with an inexistent script should raise a "No such file or directory (os error 2)" error message, but it raises "Task exited with status: exit status: 127" instead on aarch64.

127 being the status code for command not found.

@vlaci I think it should be reported to devenv, right ?

Devenv's using an old pinned nixpkgs, so the issue won't pop-up for regular users.

I've made a PoC to allow updating it, which was picked up by the maintainers there cachix/devenv#1489

Unfortunately there are other cases, where it doesn't work correctly. I look into it.

The more interesting part is, how the build passed before and why does it fail now? 🤔

EDIT: I see it didn't work before, it was not a required status check 🤦

Nevertheless, added a workaround at cb09f38