fosslinux / live-bootstrap

Use of a Linux initramfs to fully automate the bootstrapping process
482 stars 32 forks source link

Random failure in bwrap mode with 8 cores in automake-1.15.1 ("no POSIX shell found") #365

Closed Googulator closed 8 months ago

Googulator commented 8 months ago

In bwrap mode with 8 cores, I occasionally (about 1 in 10 runs) get this failure:

automake-1.15.1: configuring source.
checking whether make supports nested variables... yes
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether ln -s works... yes
checking for perl... /usr/bin/perl
checking for tex... no
checking for yacc... no
checking for byacc... no
checking for bison... bison -y
checking for lex... lex
checking whether autoconf is installed... yes
checking whether autoconf works... yes
checking whether autoconf is recent enough... yes
checking whether ln works... yes
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for fgrep... /usr/bin/grep -F
configure: will now look for a sturdy POSIX shell, for our testsuite
checking for sh... /usr/bin/sh
checking for sh5... no
checking for dash... no
checking for ash... no
checking for bash... /usr/bin/bash
checking for zsh... no
checking for ksh... no
checking for pdksh... no
checking whether /usr/bin/sh supports $(cmd)... yes
checking whether /usr/bin/sh supports $((expr))... yes
checking whether /usr/bin/sh supports ${#var}... no
checking whether /usr/bin/bash supports $(cmd)... yes
checking whether /usr/bin/bash supports $((expr))... yes
checking whether /usr/bin/bash supports ${#var}... no
configure: error: in `/steps/automake-1.15.1/build/automake-1.15.1':
configure: error: no POSIX shell found that is good enough to be used in our testsuite
See `config.log' for more details
Subprocess error 1
ABORTING HARD
Subprocess error 1
ABORTING HARD
Subprocess error 1
ABORTING HARD
Subprocess error
ABORTING HARD
Bootstrapping failed
Googulator commented 8 months ago

For reference, this is the shell check from a successful run:

configure: will now look for a sturdy POSIX shell, for our testsuite
checking for sh... /usr/bin/sh
checking for sh5... no
checking for dash... no
checking for ash... no
checking for bash... /usr/bin/bash
checking for zsh... no
checking for ksh... no
checking for pdksh... no
checking whether /usr/bin/sh supports $(cmd)... yes
checking whether /usr/bin/sh supports $((expr))... yes
checking whether /usr/bin/sh supports ${var#glob} and ${var%glob}... yes
checking whether /usr/bin/sh preserves exit traps with "set -e"... yes
checking whether /usr/bin/sh can define exit traps in a shell function... yes
checking whether /usr/bin/sh corrupts stderr with "set -x"... no
checking whether /usr/bin/sh can return early from "dot-sourced" files... yes
checking whether /usr/bin/sh supports "test -e"... yes
configure: shell /usr/bin/sh is good enough, stop looking
configure: will use /usr/bin/sh as the testsuite shell

The ${#var} check (which fails in the failure case) isn't even performed. Weird.

Googulator commented 8 months ago

Looks like shellcheck-bypass.patch is somehow ignored in failed runs.

fosslinux commented 8 months ago

A useful diagnostic here would be a log with set -x. I doubt this has anything to do with parallelism and might be some other machine specific thing... but that's my gut!

Googulator commented 8 months ago

so like this:

AUTORECONF=autoreconf-2.69 AUTOM4TE=autom4te-2.69 AUTOHEADER=autoheader-2.69 AUTOCONF=autoconf-2.69 bash -x ./configure --prefix="${PREFIX}"
Googulator commented 8 months ago

from default_src_prepare:

    if test -d "${patch_dir}"; then
        if ls "${patch_dir}"/*.patch >/dev/null 2>&1; then
            for p in "${patch_dir}"/*.patch; do
                echo "Applying patch: ${p}"
                patch -Np0 < "${p}"
            done
        fi
    fi

Could this be yet another globbing bug, similar to the one seen in WSL2?

Googulator commented 8 months ago

Should be fixed by https://github.com/fosslinux/live-bootstrap/commit/f4c1b488d6a5bc91ca394c15fcabf9e7ff5b00e9