Skip to content

avoid pipe in dune#8

Merged
hannesm merged 1 commit into
mirage:zarith-1.14from
hannesm:zarith-1.14
Jun 16, 2026
Merged

avoid pipe in dune#8
hannesm merged 1 commit into
mirage:zarith-1.14from
hannesm:zarith-1.14

Conversation

@hannesm

@hannesm hannesm commented Jun 15, 2026

Copy link
Copy Markdown
Member

I got since I updated the OS of our reproducible build infrastructure sporadic but way too often an exit 141 pointing to this dune stanza:

546.839s:#=== ERROR while compiling mirage-unikernel-mollymawk-hvt.0.0.1 ===============#
546.839s:# context              2.5.1 | freebsd/x86_64 |  | git://git.robur.coop/robur/unikernel-repo.git
546.839s:# path                 /tmp/orb-build
546.839s:# command              /usr/local/bin/gmake build
546.839s:# exit-code            2
546.839s:# env-file             /tmp/opam-root-43349/mirage-unikernel-mollymawk-hvt-43349-ad6023.env
546.839s:# output-file          /tmp/opam-root-43349/mirage-unikernel-mollymawk-hvt-43349-ad6023.out
546.839s:### output ###
546.839s:# dune build --profile release --root . ./dist
546.839s:# gmake[1]: Entering directory '/tmp/orb-build/_build/solo5/duniverse/mirage-solo5/lib/bindings'
546.839s:# ocamlfind -toolchain solo5 ocamlopt    -c -o clock_stubs.o clock_stubs.c
546.839s:# ocamlfind -toolchain solo5 ocamlopt    -c -o mm_stubs.o mm_stubs.c
546.839s:# ocamlfind -toolchain solo5 ocamlopt    -c -o main.o main.c
546.839s:# ar r libmirage-solo5_bindings.a clock_stubs.o mm_stubs.o main.o
546.839s:# gmake[1]: Leaving directory '/tmp/orb-build/_build/solo5/duniverse/mirage-solo5/lib/bindings'
546.839s:# ar: warning: creating libmirage-solo5_bindings.a
546.839s:# File "duniverse/Zarith/dune", lines 85-92, characters 0-146:
546.839s:# 85 | (rule
546.839s:# 86 |  (deps META)
546.839s:# 87 |  (action
546.839s:# 88 |   (with-stdout-to
546.839s:# 89 |    zarith_version.ml
546.839s:# 90 |    (progn
546.839s:# 91 |     (run echo "let")
546.839s:# 92 |     (bash "grep \"version\" META | head -1")))))
546.839s:# Context: solo5
546.839s:# Command exited with code 141.
546.839s:# File "duniverse/Zarith/dune", lines 85-92, characters 0-146:
546.839s:# 85 | (rule
546.839s:# 86 |  (deps META)
546.839s:# 87 |  (action
546.839s:# 88 |   (with-stdout-to
546.840s:# 89 |    zarith_version.ml
546.840s:# 90 |    (progn
546.840s:# 91 |     (run echo "let")
546.840s:# 92 |     (bash "grep \"version\" META | head -1")))))
546.840s:# Command exited with code 141.

From https://builds.robur.coop/job/mollymawk/build/d3976fa9-ad07-499d-ac8d-2d06e9c5a517/console as example

Now, reading up on 141, I figured the | head -1 may send a SIGPIPE to grep if it exited while grep is still running.... so why not remove the head -1 and use a grep expression that matches exactly one version = in the META file?

Well, please take a look and tell me what you think about it.

@hannesm hannesm merged commit 8af435f into mirage:zarith-1.14 Jun 16, 2026
0 of 2 checks passed
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

Successfully merging this pull request may close these issues.

1 participant