You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently (Jun 2022) Hoff, whenever the nix-build step fails, the CI does not detect it and we are left with a green build ✔️ even though the build was supposed to be red ❌.
$ nix-build --no-out-link release.nix | cachix push channable-public
...
[11 of 12] Compiling WebInterface ( src/WebInterface.hs, dist/build/WebInterface.p_o ) 00:43
[12 of 12] Compiling Server ( src/Server.hs, dist/build/Server.p_o ) 00:45
dist/build/libHShoff-0.25.2-9YPwmF3FCRkEo14kDrjgdt-ghc8.10.4.a: hPutBuf: resource exhausted (No space left on device) 00:45
error: writing to file: No space left on device 00:45
Nothing to push. 00:45
Semaphore fails to detect this as although nix-build fails, cachix succeeds. The error code of a pipe is (normally) the error code of the last command. So we should try to break down the commands into two. Something like this:
Btw, thanks to @ReinierMaas for actually discovering that the build was broken in the first place. ... and to @maartenberg for suggesting cachix push channable $(nix-build ...) as an alternative fix. :-)
suggesting cachix push channable $(nix-build ...) as an alternative fix. :-)
I think cachix push channable $(nix-build ...) will still attempt to run the outer command (cachix ...) when the inner command (nix-build ...) fails.
So if we don't want to rely on the cachix command itself returning a non-zero exit code, I think this would fix it:
# This will return the exit code of the inner command
$ hoff_store_path=$(nix-build ...)# Thus, the pipeline will have failed before here if the nix-build was unsuccessful.
$ cachix push channable $hoff_store_path
Semaphore fails to detect this as although nix-build fails, cachix succeeds. The error code of a pipe is (normally) the error code of the last command.
You can also set -o pipefail to prevent errors from being masked.
Currently (Jun 2022) Hoff, whenever the
nix-build
step fails, the CI does not detect it and we are left with a green build ✔️ even though the build was supposed to be red ❌.Here is an example:
Green build:
All steps green:
Nice!
Actual result of the nix-build step:
Ohno! 😱
Here's the failing command and output section:
Semaphore fails to detect this as although
nix-build
fails,cachix
succeeds. The error code of a pipe is (normally) the error code of the last command. So we should try to break down the commands into two. Something like this:Issue present since 19 April 2022
The CI build was failing all along for two previous versions:
The issue has been here since 19 April 2022 after this merge with hash c4c2e38 PR #105.
The CI build was still okay on v0.24.0
The text was updated successfully, but these errors were encountered: