openwrt / packages

Community maintained packages for OpenWrt. Documentation for submitting pull requests is in CONTRIBUTING.md
GNU General Public License v2.0
4.01k stars 3.48k forks source link

lvm2: build fails when /bin/sh on the host system is dash #16822

Open paper42 opened 3 years ago

paper42 commented 3 years ago

Issue template (remove lines from top till here)

Maintainer: @dangowrt Environment: aarch64, Turris MOX, OpenWrt 21.02

Description: When /bin/dash on the host system points to dash instead of bash, the build fails, because lvm2 tries to run set -o pipefail which is not supported in dash. dash is the default /bin/sh at least in Ubuntu, Debian and Void (where I found it), so I think this should be fixed.

    [CC] vdo/vdo.c
    [AR] liblvm-internal.a
/home/michal/nic/build-mox-hbd/build/staging_dir/toolchain-aarch64_cortex-a53_gcc-8.4.0_musl/lib/gcc/aarch64-openwrt-linux-musl/8.4.0/../../../../aarch64-openwrt-linux-musl/bin/ar: creating liblvm-internal.a
make[4]: Leaving directory '/home/michal/nic/build-mox-hbd/build/build_dir/target-aarch64_cortex-a53_musl/lvm2-normal/LVM2.2.03.11/lib'
make -C tools
make[4]: Entering directory '/home/michal/nic/build-mox-hbd/build/build_dir/target-aarch64_cortex-a53_musl/lvm2-normal/LVM2.2.03.11/tools'
    [GEN] command-lines-input.h
/bin/sh: 1: set: Illegal option -o pipefail
    [CC] commands.h
make[4]: *** No rule to make target 'command-lines-input.h', needed by 'command.o'.  Stop.
make[4]: Leaving directory '/home/michal/nic/build-mox-hbd/build/build_dir/target-aarch64_cortex-a53_musl/lvm2-normal/LVM2.2.03.11/tools'
make[3]: *** [make.tmpl:348: tools] Error 2
make[3]: Leaving directory '/home/michal/nic/build-mox-hbd/build/build_dir/target-aarch64_cortex-a53_musl/lvm2-normal/LVM2.2.03.11'
make[2]: *** [Makefile:163: /home/michal/nic/build-mox-hbd/build/build_dir/target-aarch64_cortex-a53_musl/lvm2-normal/LVM2.2.03.11/.built] Error 2
make[2]: Leaving directory '/home/michal/nic/build-mox-hbd/build/feeds/packages/utils/lvm2'
time: package/feeds/packages/lvm2/normal/compile#37.51#6.68#56.15
    ERROR: package/feeds/packages/lvm2 failed to build (build variant: normal).
make[1]: *** [package/Makefile:114: package/feeds/packages/lvm2/compile] Error 1
make[1]: Leaving directory '/home/michal/nic/build-mox-hbd/build'
make: *** [/home/michal/nic/build-mox-hbd/build/include/toplevel.mk:230: package/dockerd/compile] Error 2
micmac1 commented 3 years ago

Works fine to build here. Debian 11. In 21.02 SDK. Did you install bash? It's a build requirement as per this link. My /bin/sh points to dash as well.

paper42 commented 3 years ago

Works fine to build here. Debian 11. In 21.02 SDK. Did you install bash? It's a build requirement as per this link. My /bin/sh points to dash as well.

I have bash installed on this system, changing the /bin/sh symlink to point to bash instead of dash makes this work.

%: dash -c "set -o pipefail"
dash: 1: set: Illegal option -o pipefail
%: bash -c "set -o pipefail"
%: ash -c "set -o pipefail"
%: sh -c "set -o pipefail"
%: loksh -c "set -o pipefail"
%: mksh -c "set -o pipefail"

I also tested running this command on Ubuntu and it also failed.