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

Bug 892876

Summary: Prefix RAP bootstrap fails at stage 1 on CHOST=aarch64-unknown-linux-gnu: No prefix/linux/arm64 profile
Product: Gentoo/Alt Reporter: Yuan Liao (Leo3418) <liaoyuan>
Component: Prefix SupportAssignee: Gentoo Prefix <prefix>
Status: RESOLVED FIXED    
Severity: normal CC: b.e.droge, chewi, flow, kenneth.hoste, railwaycat
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: ARM64   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/30568
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Compressed stage1.log

Description Yuan Liao (Leo3418) 2023-02-02 02:48:49 UTC
Created attachment 849666 [details]
Compressed stage1.log

Synopsis:

After the recent Prefix cross-compiling changes, the bootstrap-prefix.sh script fails on Linux ARM64 hosts at stage1, just before Portage is set up.  The cause seems to be the lack of a prefix/linux/arm64 profile in ::gentoo.


bootstrap-prefix.sh output:

...
OK!  I'm going to give it a try, this is what I have collected sofar:
  EPREFIX=/home/leo/gentoo
  CHOST=aarch64-unknown-linux-gnu
  PATH=/home/leo/gentoo/usr/bin:/home/leo/gentoo/bin:/home/leo/gentoo/tmp/usr/bin:/home/leo/gentoo/tmp/bin:/home/leo/gentoo/tmp/usr/local/bin:/usr/bin:/bin
  MAKEOPTS=-j3
...
* Fetching portage-latest.tar.bz2
...
2023-02-02 01:55:22 (19.2 MB/s) - ‘portage-latest.tar.bz2’ saved [48271596/48271
596]                                                                            
                                                                                
* Unpacking, this may take a while
* Setting up some guessed defaults
* Your profile is set to /home/leo/gentoo/var/db/repos/gentoo/profiles/default/l
inux/arm64/17.0/prefix/kernel-3.2+.
* Your profile is set to /home/leo/gentoo/var/db/repos/gentoo/profiles/prefix/li
nux/arm64.
./bootstrap-prefix.sh: line 511: /home/leo/gentoo/tmp/etc/portage/make.profile/p
ackage.use: No such file or directory
./bootstrap-prefix.sh: line 524: /home/leo/gentoo/tmp/etc/portage/make.profile/p
ackage.unmask: No such file or directory 
./bootstrap-prefix.sh: line 532: /home/leo/gentoo/tmp/etc/portage/make.profile/p
ackage.use: No such file or directory

Note that two "Your profile is set to ..." lines showed up.  The second one seemed to be the offender.


Prefix dir-tree state upon failure:

$ ls -l ~/gentoo/tmp/etc/portage
total 8
drwxrwxr-x 2 leo leo 4096 Feb  2 01:55 make.conf
lrwxrwxrwx 1 leo leo   64 Feb  2 01:55 make.profile -> /home/leo/gentoo/var/db/repos/gentoo/profiles/prefix/linux/arm64

$ ls -l ~/gentoo/var/db/repos/gentoo/profiles/prefix/linux
total 56
drwxr-xr-x 2 leo leo 4096 Feb  2 00:40 amd64
drwxr-xr-x 2 leo leo 4096 Feb  2 00:40 arm
-rw-r--r-- 1 leo leo    2 Aug  9  2015 eapi
-rw-r--r-- 1 leo leo 1151 Jul  1  2019 make.defaults
-rw-r--r-- 1 leo leo  309 Oct 10  2019 package.mask
-rw-r--r-- 1 leo leo  245 Sep 21  2021 package.use.mask
-rw-r--r-- 1 leo leo  258 Feb 28  2017 packages
-rw-r--r-- 1 leo leo    3 Feb 27  2016 parent
drwxr-xr-x 2 leo leo 4096 Feb  2 00:40 ppc64
drwxr-xr-x 2 leo leo 4096 Feb  2 00:40 ppc64le
-rw-r--r-- 1 leo leo 1514 Mar  4  2021 profile.bashrc
drwxr-xr-x 2 leo leo 4096 Feb  2 00:40 riscv
-rw-r--r-- 1 leo leo  245 Jul  1  2019 use.mask
drwxr-xr-x 2 leo leo 4096 Feb  2 00:40 x86

No 'arm64' under ${EPREFIX}/var/db/repos/gentoo/profiles/prefix/linux.


bootstrap-prefix.sh version:
https://gitweb.gentoo.org/repo/proj/prefix.git/tree/scripts/bootstrap-prefix.sh?id=1e10173683711f9c2d6d5b93ac6462d274459510

First commit where the failure can be reproduced:
a627ff5554f4efb061d1ce261a248efb5e9d7e59


Host environment:

$ uname -a
Linux gentoo-prefix 5.15.0-1027-oracle #33-Ubuntu SMP Fri Jan 6 16:30:16 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux

$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/aarch64-linux-gnu/11/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 11.3.0-1ubuntu1~22.04' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=aarch64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=aarch64-linux-gnu --host=aarch64-linux-gnu --target=aarch64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-serialization=2
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04)
Comment 1 sinxccc 2023-03-07 01:01:19 UTC
I can reproduce this issue on the latest Asahi linux with m1 mac.
Comment 2 Bob Dröge 2023-03-07 09:20:50 UTC
I was running into the same issue on a Graviton2 CPU in AWS, but I could fix it by creating an arm64 profile after it failed:

${EPREFIX}/var/db/repos/gentoo/profiles/prefix/linux/arm64

This directory should contain:

$ cat ${EPREFIX}/var/db/repos/gentoo/profiles/prefix/linux/arm64/eapi 
5

$ cat ${EPREFIX}/var/db/repos/gentoo/profiles/prefix/linux/arm64/parent 
../../../default/linux/arm64/17.0
..

$ cat ${EPREFIX}/var/db/repos/gentoo/profiles/prefix/linux/arm64/make.defaults 
# Copyright 1999-2018 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

ACCEPT_KEYWORDS="arm64 ~arm64"

# Not sure if this is required as well, seems to be the default:
# CHOST=aarch64-unknown-linux-gnu

Then just run the bootstrap script again and it should continue.
Comment 3 Larry the Git Cow gentoo-dev 2023-04-12 14:05:57 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6afb91b375211aad29916d091ac962d272fe6e48

commit 6afb91b375211aad29916d091ac962d272fe6e48
Author:     Bob Dröge <b.e.droge@rug.nl>
AuthorDate: 2023-04-12 07:42:44 +0000
Commit:     Guilherme Amadio <amadio@gentoo.org>
CommitDate: 2023-04-12 14:05:20 +0000

    profiles/prefix/linux: add arm64 profile
    
    Closes: https://bugs.gentoo.org/892876
    Closes: https://github.com/gentoo/gentoo/pull/30568
    
    Signed-off-by: Bob Dröge <b.e.droge@rug.nl>
    Signed-off-by: Guilherme Amadio <amadio@gentoo.org>

 profiles/prefix/linux/arm64/eapi          | 1 +
 profiles/prefix/linux/arm64/make.defaults | 7 +++++++
 profiles/prefix/linux/arm64/parent        | 2 ++
 3 files changed, 10 insertions(+)