Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 932598

Summary: Prefix: insufficient bootstrap checks / bootstrap is brittle
Product: Gentoo/Alt Reporter: Matt Jolly <kangie>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: CONFIRMED ---    
Severity: normal CC: eschwartz
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=932600
Whiteboard:
Package list:
Runtime testing required: ---

Description Matt Jolly gentoo-dev 2024-05-24 06:10:05 UTC
I have been attempting to bootstrap Prefix on SLES 12 SP5.

It has become clear that the existing prefix-bootstrap script does not appropriately sanity check the environment to ensure that things _can_ be bootstrapped.

A few packages that I have run into issues with:

- automake: the version in SLES 12 SP5 is one point release too old. I had to download and compile a later version of automake so that `sed` could compile.
- gettext: The version in SLES 12 SP5 is one point release too old to compile dev-libs/libgpg-error. I have not yet worked around this but I will need to compile something and stick it in ~/local/bin and prefix that to additional PATHs.
- GCC: To compile a modern version of GCC (i.e. any of the in-tree versions) you need a GCC that supports -std=c++11. As it turns out the SLES base image that I'm working off includes `gcc` but not `g++` - this should have been detected upon script initialisation, not when GCC failed to bootstrap!

Proposed solution(s):

- Implement some basic sanity checks in the initial stages of the bootstrap process. This should be clearly output in the build log, including found version, path, and required version. This list should be short, but include compilers and essential build/bootstrap tools.
- Automatically bootstrap tools like 'automake', 'gettext', etc. if the system versions are too old.
- Identify the _absolute minimum_ requirements to bootstrap a modern compiler and come up with a path to building intermediate compilers as necessary, beginning with only than a basic C compiler (with well defined version reqs)
Comment 1 Larry the Git Cow gentoo-dev 2024-05-24 06:13:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8bdb31ed5381d8d37c372758bb4c877260f28ab8

commit 8bdb31ed5381d8d37c372758bb4c877260f28ab8
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2024-05-24 06:11:21 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2024-05-24 06:11:21 +0000

    dev-libs/libgpg-error: drop need for eautoreconf
    
    Prefix doesn't bootstrap gettext so autopoint run as part of autoreconf fails.
    
    Changes:
    * We can replace the need for patch with a stub script which always exits w/ 0.
    * Update the sed for Solaris to work on both configure.ac & configure
      (while it does assume /bin/sh is a suitable shell, the old fix did too,
      as the case statement would fallback to it, so this is functionally equivalent).
    
    Bug: https://bugs.gentoo.org/932598
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-libs/libgpg-error/libgpg-error-1.49.ebuild | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
Comment 2 Fabian Groffen gentoo-dev 2024-05-24 10:38:30 UTC
Yes bootstrap is very brittle.  Perhaps one day we can start from a stage3 to simply re-compile into the final EPREFIX.  That said, I thought there was a check and warning or two about having to install g++ if you don't have it.  Perhaps this was removed when I cleaned this up because a c++11 compiler is now required, and without it you cannot do anything but going through GCC-5, for which there is a bootstrap path (wired to ppc-macos for the moment, but perhaps we can use it here?)
Comment 3 Eli Schwartz gentoo-dev 2024-05-24 14:47:54 UTC
> - Identify the _absolute minimum_ requirements to bootstrap a modern
> compiler and come up with a path to building intermediate compilers as
> necessary, beginning with only than a basic C compiler (with well defined
> version reqs)

So basically, guix and mescc? :D