Hide Forgot
The subject more or less explains it: set -o pipefail in tools/Makefile.in causes the build to fail with (for example) the dash shell. Autotools uses /bin/sh which is presumed to be POSIX compatible, but not (much) more. I see workarounds for this in other places, like test/lib/aux.sh:test -n "$BASH" && set -euE -o pipefail so presumably this one remaining instance is just an oversight.
lvm2 building basically depends on bash & gcc. If there is anyone who wants to provide global patch fixing all the 'bashism' everywhere - it might be pushed upstream if the code will behave in the same way.
(In reply to Zdenek Kabelac from comment #1) > lvm2 building basically depends on bash & gcc. > That's a valid choice, but in that case, can you set SHELL=bash rather than using /bin/sh and just praying that it points to bash?
Please provide tested patch - so it can be considered for upstreaming.
Created attachment 1677380 [details] 0001-tools-Makefile.in-only-set-o-pipefail-if-the-shell-i.patch
Created attachment 1677381 [details] 0002-tools-Makefile.in-use-printf-instead-of-non-portable.patch I had to fix a few "echo" calls after guarding "set -o pipefail" behind a bash test, too. The resulting command-count.h and command-lines-input.h are unchanged for me.
Fixed with different solution to avoid using pipe - which is hard to catch when it fail without 'set -o pipefail' https://listman.redhat.com/archives/lvm-devel/2023-February/024582.html Will likely go upstream with lvm2 2.03.19 with some more MuslC/dash fixes as well.