Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 909628 - bootstrap-prefix.sh picks unpatched bash-5.1 already removed from tree which fails under MAKEOPTS=-j8 due to a race condition
Summary: bootstrap-prefix.sh picks unpatched bash-5.1 already removed from tree which ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-07-04 11:57 UTC by Martin Mokrejš
Modified: 2024-01-14 05:22 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
stage1.log.bz2 (stage1.log.txt.bz2,111.31 KB, application/octet-stream)
2023-07-31 12:11 UTC, Martin Mokrejš
Details
stage2.log.txt.bz2 (stage2.log.txt.bz2,1.30 KB, application/octet-stream)
2023-07-31 12:12 UTC, Martin Mokrejš
Details
bash-5.1.log (bash-5.1.log.txt,164.95 KB, text/plain)
2023-07-31 13:26 UTC, Martin Mokrejš
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Mokrejš 2023-07-04 11:57:51 UTC
Hi,
  I picked stable amd64 during bootstrap-prefix.sh but it picked sys-devel/gnuconfig-20230121::gentoo which then dies because I ended up with bash-4.3 installed instead (as recorded in stage1.log).

!!! BINPKG_COMPRESS unsupported zstd. Missing package: app-arch/zstd
These are the packages that would be merged, in order:

[ebuild  N     ] sys-devel/gnuconfig-20230121::gentoo  70 KiB

Total: 1 package (1 new), Size of downloads: 70 KiB

>>> Verifying ebuild manifests


>>> Emerging (1 of 1) sys-devel/gnuconfig-20230121::gentoo
Warning: File compression unsupported zstd. Missing package: app-arch/zstd
 * ERROR: sys-devel/gnuconfig-20230121::gentoo failed (clean phase):
 *   >=bash-5.0 is required
 * 
 * Call stack:
 *   ebuild.sh, line 54:  Called __check_bash_version
 *   ebuild.sh, line 35:  Called die
 * The specific snippet of code:
 *              die ">=bash-${maj}.${min} is required"
 * 
 * If you need support, post the output of `emerge --info '=sys-devel/gnuconfig-20230121::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-devel/gnuconfig-20230121::gentoo'`.
$foo/gentoo/tmp/usr/lib/portage/bin/isolated-functions.sh: line 207: $foo/gentoo/tmp/var/tmp/portage/sys-devel/gnuconfig-20230121/.die_hooks: No such file or directory
 * Working directory: '$foo/gentoo'
 * S: ''
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
 * The ebuild phase 'die_hooks' has been aborted since PORTAGE_BUILDDIR
 * does not exist: '$foo/gentoo/tmp/var/tmp/portage/sys-
 * devel/gnuconfig-20230121'

>>> Failed to emerge sys-devel/gnuconfig-20230121
 * Messages for package sys-devel/gnuconfig-20230121:



Odd!  Running
  $foo/gentoo/bin/bash bootstrap-prefix.sh "$foo/gentoo" stage2
failed! :(  Details might be found in the build log:
  (no build logs found?!?)
I have no clue, really.  Please find friendly folks in #gentoo-prefix on
irc.gentoo.org, gentoo-alt@lists.gentoo.org mailing list, or file a bug
at bugs.gentoo.org under Gentoo/Alt, Prefix Support.
Remember you might find some clues in $foo/gentoo/stage2.log

  CHOST:     x86_64-pc-linux-gnu
  IDENT:     x86_64-rap-linux-debian11
$

Either older gnuconfig should be selected or bash-5 stabilized on ::Prefix.
Comment 1 Martin Mokrejš 2023-07-04 12:22:47 UTC
Even if I pick ~amd64 during installation the bootstrap-prefix.sh installs bash-4.3.
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-28 08:10:55 UTC
Need the full log.
Comment 3 Martin Mokrejš 2023-07-31 12:11:47 UTC
Created attachment 866716 [details]
stage1.log.bz2
Comment 4 Martin Mokrejš 2023-07-31 12:12:21 UTC
Created attachment 866717 [details]
stage2.log.txt.bz2
Comment 5 Martin Mokrejš 2023-07-31 13:06:29 UTC
I re-tried now and it still happens:

I used MAKEOPTS=-j64 but 

Here is the error causing bash-4.3 being installed because 5.1 failed to install:

gcc -DPROGRAM='"bash"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"linux-gnu"' -DCONF_MACHTYPE='"x86_64-pc-linux-gnu"' -DCONF_VENDOR='"pc"' -DLOCALEDIR='"/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/tmp/usr/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib  -DSYS_BASHRC=\"/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/etc/bash/bashrc\" 			-DSYS_BASH_LOGOUT=\"/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/etc/bash/bash_logout\" 		 -g -O2 -Wno-parentheses -Wno-format-security   -rdynamic -g -O2 -Wno-parentheses -Wno-format-security   -rdynamic -g -O2 -Wno-parentheses -Wno-format-security  -o mksignames mksignames.o buildsignames.o 
bashline.c:65:10: fatal error: builtins/builtext.h: No such file or directory
   65 | #include "builtins/builtext.h"  /* for read_builtin */
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:100: bashline.o] Chyba 1
make: *** Waiting for unfinished jobs…
/bin/sh ./psize.sh > pipesize.h
gcc -rdynamic -g -O2 -Wno-parentheses -Wno-format-security -rdynamic -g -O2 -Wno-parentheses -Wno-format-security  -o mkbuiltins mkbuiltins.o -ldl 
./mkbuiltins -externfile builtext.h -structfile builtins.c \
    -noproduction -D .   ./alias.def ./bind.def ./break.def ./builtin.def ./caller.def ./cd.def ./colon.def ./command.def ./declare.def ./echo.def ./enable.def ./eval.def ./getopts.def ./exec.def ./exit.def ./fc.def ./fg_bg.def ./hash.def ./help.def ./history.def ./jobs.def ./kill.def ./let.def ./read.def ./return.def ./set.def ./setattr.def ./shift.def ./source.def ./suspend.def ./test.def ./times.def ./trap.def ./type.def ./ulimit.def ./umask.def ./wait.def ./reserved.def ./pushd.def ./shopt.def ./printf.def ./complete.def ./mapfile.def
make[1]: Opouští se adresář „/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/var/tmp/bash-5.1/bash-5.1/builtins“
gcc  -DHAVE_CONFIG_H -DSHELL  -I/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/var/tmp/bash-5.1/bash-5.1 -I..  -DSYS_BASHRC=\"/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/etc/bash/bashrc\" 			-DSYS_BASH_LOGOUT=\"/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/etc/bash/bash_logout\" 		 -g -O2 -Wno-parentheses -Wno-format-security man2html.o -o man2html -ldl 		
make[1]: Opouští se adresář „/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/var/tmp/bash-5.1/bash-5.1/support“
make[1]: Opouští se adresář „/auto/vestec1-elixir/projects/biocev/mmokrejs/gentoo/var/tmp/bash-5.1/bash-5.1/builtins“
* Bootstrapping 
* Fetching bash-4.3.tar.xz
wget --no-check-certificate http://distfiles.gentoo.org/distfiles/bash-4.3.tar.xz
--2023-07-31 14:26:38--  http://distfiles.gentoo.org/distfiles/bash-4.3.tar.xz
Comment 6 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2023-07-31 13:10:13 UTC
hm, is this because it's trying to use readline and that's failing..
Comment 7 Martin Mokrejš 2023-07-31 13:17:45 UTC
See https://lists.gnu.org/archive/html/bug-bash/2020-12/msg00051.html

Meanwhile I am trying MAKEOPTS=-j1 .

Then I will check if the patch https://gitweb.gentoo.org/repo/gentoo.git/tree/app-shells/bash/files/bash-5.1-parallel_make.patch?id=4c2ebbf4b8bc660beb98cc2d845c73375d6e4f50 was not lost in the wild over the years.
Comment 8 Martin Mokrejš 2023-07-31 13:26:10 UTC
Created attachment 866719 [details]
bash-5.1.log

MAKEOPTS=-j1 works around the bug (sorry for the cs_CZ LOCALE)
Comment 9 Martin Mokrejš 2023-07-31 13:38:26 UTC
By default bootstrap-prefix.sh set MAKEOPTS=-j8 and it already triggered the bug, reproducibly.

Gentoo::Prefix should use patched bash-5.1 or more recent patched version of e.g. app-shells/bash-5.2_p15-r6. Why was unpatched 5.1 picked at all?
Comment 10 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2024-01-14 05:22:06 UTC
This ended up being fixed in bug 921535.