Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 942970 - app-admin/eselect-1.4.27-r1 does not mark the active custom profile with PORTAGE_CONFIGROOT
Summary: app-admin/eselect-1.4.27-r1 does not mark the active custom profile with PORT...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2024-11-07 06:30 UTC by dE
Modified: 2024-11-18 06:05 UTC (History)
3 users (show)

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


Attachments
eselect profile output in various situations (chroot and with PORTAGE_CONFIGROOT) (eselect_profiles_output.txt,9.62 KB, text/plain)
2024-11-07 06:31 UTC, dE
Details
stdout and err of bash -vx /usr/bin/eselect profile list (eselect.txt,212.24 KB, text/plain)
2024-11-11 04:15 UTC, dE
Details
patch for get_repo_path() (get_repo_path-root.patch,490 bytes, patch)
2024-11-11 16:20 UTC, Ulrich Müller
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description dE 2024-11-07 06:30:34 UTC
I've used custom profiles with PORTAGE_CONFIGROOT. Additionally, the host machine also has identical profiles installed, but the selected profile is different from PORTAGE_CONFIGROOT.

eselect profile list lists all the custom profiles in PORTAGE_CONFIGROOT, but does not show which one is active (no * is present anywhere).

Reproducible: Always




Portage 3.0.65 (python 3.12.6-final-0, !../custom-profiles-gentoo/profiles/mypc/, gcc-14, glibc-2.39-r6, 6.10.7-gentoo-gentoo-dist x86_64)
=================================================================
System uname: Linux-6.10.7-gentoo-gentoo-dist-x86_64-AMD_Ryzen_5_PRO_2600_Six-Core_Processor-with-glibc2.39
KiB Mem:    16300452 total,   9443312 free
KiB Swap:          0 total,         0 free
Head commit of repository oubliette: dd3a60bb2ba6afa8de4b2ceb2ddcdf2425270e35

Timestamp of repository gentoo: Sun, 20 Oct 2024 00:45:00 +0000
sh bash 5.2_p37
ld GNU ld (Gentoo 2.42 p6) 2.42.0
ccache version 4.10.1 [enabled]
app-misc/pax-utils:        1.3.7::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/make:            4.4.1-r1::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0::gentoo
dev-lang/python:           3.11.10_p1::gentoo, 3.12.6_p4::gentoo
dev-lang/rust:             1.81.0::gentoo
dev-util/ccache:           4.10.1::gentoo
sys-apps/baselayout:       2.15::gentoo
sys-apps/sandbox:          2.39::gentoo
sys-apps/systemd:          255.11::gentoo
sys-devel/binutils:        2.42-r2::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/clang:           15.0.7-r3::gentoo
sys-devel/gcc:             14.2.1_p20240921::gentoo
sys-devel/gcc-config:      2.11::gentoo
sys-devel/lld:             15.0.7::gentoo
sys-devel/llvm:            15.0.7-r3::gentoo
sys-kernel/linux-headers:  6.6-r1::gentoo (virtual/os-headers)
sys-libs/glibc:            2.39-r6::gentoo
Repositories:

custom-profiles
    location: /etc/custom-profiles-gentoo
    masters: gentoo
    volatile: True

oubliette
    location: /var/db/repos/oubliette
    sync-type: git
    sync-uri: https://github.com/nabbi/oubliette-overlay
    masters: gentoo
    priority: 50
    volatile: False

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo
    priority: 100
    volatile: True

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=12288 -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -ftree-loop-distribution -O3 -pipe -flto=1 -fuse-linker-plugin -ffat-lto-objects"
CHOST="x86_64-mypc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php8.2/ext-active/ /etc/php/cgi-php8.2/ext-active/ /etc/php/cli-php8.2/ext-active/ /etc/php/fpm-php8.2/ext-active/ /etc/php/phpdbg-php8.2/ext-active/ /etc/revdep-rebuild /etc/sandbox.d"
CXXFLAGS="-march=alderlake -mabm -mno-cldemote -mno-kl -mno-pconfig -mno-sgx -mno-widekl -mshstk --param=l1-cache-line-size=64 --param=l1-cache-size=48 --param=l2-cache-size=12288 -fomit-frame-pointer -floop-interchange -floop-strip-mine -floop-block -fgraphite-identity -ftree-loop-distribution -O3 -pipe -flto=1 -fuse-linker-plugin -ffat-lto-objects"
DISTDIR="/var/cache/distfiles/"
EMERGE_DEFAULT_OPTS="--with-bdeps=n --complete-graph --binpkg-respect-use=y --binpkg-changed-deps=n --changed-deps=n --rebuild-if-new-slot=y --load-average 8"
ENV_UNSET="ABI_X86 ACCEPT_LICENSE APACHE2_MODULES APACHE2_MPMS CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE GOBIN GOPATH L10N NGINX_MODULES_HTTP PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT VIDEO_CARDS XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR XDG_STATE_HOME"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live candy ccache config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://mirror.leaseweb.com/gentoo/ http://mirror.csclub.uwaterloo.ca/gentoo-distfiles/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs"
LEX="flex"
MAKEOPTS="-j12"
PKGDIR="/var/cache/binpkgs-mypc"
PORTAGE_CONFIGROOT="/usr/x86_64-mypc-linux-gnu/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/tmp"
SHELL="/bin/bash"
USE="a52 aac acpi adns alsa alt-svc amd64 amrenc asm asyncns atm avif bluetooth branding bzip2 cairo cet crypt custom-cflags dav1d dbus declarative dri dts dv dvbpsi editorconfig eglfs enca encode exif faad fdk ffmpeg flac fontconfig gif gles2 gles2-only glslang gmp gstreamer gui heif http2 iconv idn ipv6 jit jpeg jpeg2k jpegxl kde kf6compat lame libdrm libinput libnotify libsamplerate libtirpc lto mad man matroska mikmod minimal mmap modplug mp3 mp4 mpeg mprisi multilib natspec ncurses networkmanager offensive ogg opencl opengl openmp opus orc pam pcre pdf pgo plasma png policykit ppds pulseaudio qml qt6 quicktime raw readline seccomp smp sound spell ssl startup-notification strip svg svt-av1 symlink system-png systemd taglib tcmalloc test-rust theora threads tiff tls-compression truetype twolame uchardet udev udisks unicode upower usb v4l vaapi verify-sig vorbis vpx vulkan wallpaper-metadata wayland webp widgets wxwidgets x264 x265 xft xvid zlib" ABI_X86="64" ADA_TARGET="gcc_12" APACHE2_MODULES="unixd authn_core authz_core authz_host access_compat alias auth_basic authn_file log_config mime log_config proxy proxy_http rewrite proxy_balancer lbmethod_bybusyness lbmethod_byrequests lbmethod_bytraffic lbmethod_heartbeat slotmem_shm env cache dir cgid headers proxy_connect http2 allowmethods auth_digest actions" APACHE2_MPMS="event" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="pc efi-64" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en-US en" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LIBREOFFICE_EXTENSIONS="nlpsolver pdfimport" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="access fastcgi gzip gzip_static limit_req rewrite upstream_check proxy" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_11 python3_12" QEMU_SOFTMMU_TARGETS="x86_64" RUBY_TARGETS="ruby32" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 dE 2024-11-07 06:31:22 UTC
Created attachment 908043 [details]
eselect profile output in various situations (chroot and with PORTAGE_CONFIGROOT)
Comment 2 Mike Gilbert gentoo-dev 2024-11-07 15:59:04 UTC
eselect-profile isn't technically a Portage component. Re-assigning.
Comment 3 Ulrich Müller gentoo-dev 2024-11-07 18:18:24 UTC
Can you attach the output of the following command please (for the PORTAGE_CONFIGROOT case):

$ bash -vx /usr/bin/eselect profile list 2>&1
Comment 4 dE 2024-11-11 04:15:37 UTC
Created attachment 908442 [details]
stdout and err of bash -vx /usr/bin/eselect profile list
Comment 5 Ulrich Müller gentoo-dev 2024-11-11 06:51:37 UTC
+++ portageq get_repo_path /usr/x86_64-mypc-linux-gnu/ gentoo custom-profiles oubliette
[...]
++ desc=/etc/custom-profiles-gentoo/profiles/profiles.desc

So the custom-profiles repository is located in /etc/custom-profiles-gentoo, correct?

+ MAKE_PROFILE=/usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
+ [[ -e /usr/x86_64-mypc-linux-gnu/etc/make.profile ]]
++ canonicalise /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
++ realpath /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
+ active=/usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc

But the /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile symlink points to /usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc which is a different location?

What am I missing here?
Comment 6 Ulrich Müller gentoo-dev 2024-11-11 16:20:47 UTC
Created attachment 908474 [details, diff]
patch for get_repo_path()

We have discussed this in #gentoo-portage. Apparently "portageq get_repo_path" doesn't output an absolute path, but a path relative to ${ROOT}.

Please test if attached patch for profile.eselect fixes the problem.
Comment 7 James Le Cuirot gentoo-dev 2024-11-11 16:40:22 UTC
(In reply to Ulrich Müller from comment #5)
> So the custom-profiles repository is located in /etc/custom-profiles-gentoo,
> correct?
> 
> + MAKE_PROFILE=/usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> + [[ -e /usr/x86_64-mypc-linux-gnu/etc/make.profile ]]
> ++ canonicalise /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> ++ realpath /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> + active=/usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc
> 
> But the /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile symlink points
> to /usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc which
> is a different location?

That seems wrong indeed. Does it work if you manually set the symlink to /etc/custom-profiles-gentoo/profiles/mypc? How did it end up like this in the first place?
Comment 8 dE 2024-11-12 09:13:39 UTC
(In reply to Ulrich Müller from comment #5)
> +++ portageq get_repo_path /usr/x86_64-mypc-linux-gnu/ gentoo
> custom-profiles oubliette
> [...]
> ++ desc=/etc/custom-profiles-gentoo/profiles/profiles.desc
> 
> So the custom-profiles repository is located in /etc/custom-profiles-gentoo,
> correct?
> 
> + MAKE_PROFILE=/usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> + [[ -e /usr/x86_64-mypc-linux-gnu/etc/make.profile ]]
> ++ canonicalise /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> ++ realpath /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> + active=/usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc
> 
> But the /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile symlink points
> to /usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc which
> is a different location?
> 
> What am I missing here?

Both the systems in /usr/x86_64-mypc-linux-gnu/ and / (i.e. host) have identical custom profiles.
ls -l /etc/portage/make.profile
lrwxrwxrwx 1 root root 49 Sep 27 18:10 /etc/portage/make.profile -> ../custom-profiles-gentoo/profiles/myWorkstation/

ls -l /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
lrwxrwxrwx 1 root root 40 Aug 10 16:55 /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile -> ../custom-profiles-gentoo/profiles/mypc/
Comment 9 dE 2024-11-12 09:14:17 UTC
(In reply to James Le Cuirot from comment #7)
> (In reply to Ulrich Müller from comment #5)
> > So the custom-profiles repository is located in /etc/custom-profiles-gentoo,
> > correct?
> > 
> > + MAKE_PROFILE=/usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> > + [[ -e /usr/x86_64-mypc-linux-gnu/etc/make.profile ]]
> > ++ canonicalise /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> > ++ realpath /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> > + active=/usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc
> > 
> > But the /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile symlink points
> > to /usr/x86_64-mypc-linux-gnu/etc/custom-profiles-gentoo/profiles/mypc which
> > is a different location?
> 
> That seems wrong indeed. Does it work if you manually set the symlink to
> /etc/custom-profiles-gentoo/profiles/mypc? How did it end up like this in
> the first place?

I never made the symlink manually. I always used eselect profile.
Comment 10 Ulrich Müller gentoo-dev 2024-11-12 09:24:48 UTC
(In reply to dE from comment #8)
> Both the systems in /usr/x86_64-mypc-linux-gnu/ and / (i.e. host) have
> identical custom profiles.
> ls -l /etc/portage/make.profile
> lrwxrwxrwx 1 root root 49 Sep 27 18:10 /etc/portage/make.profile ->
> ../custom-profiles-gentoo/profiles/myWorkstation/
> 
> ls -l /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile
> lrwxrwxrwx 1 root root 40 Aug 10 16:55
> /usr/x86_64-mypc-linux-gnu/etc/portage/make.profile ->
> ../custom-profiles-gentoo/profiles/mypc/

(In reply to dE from comment #9)
> I never made the symlink manually. I always used eselect profile.

With ROOT=/usr/x86_64-mypc-linux-gnu (or eselect --root=...), I suppose? Because I don't see how PORTAGE_CONFIGROOT alone could account for this.
Comment 11 dE 2024-11-13 04:52:43 UTC
Yes, ROOT is always set along with PORTAGE_CONFIGROOT.
Comment 12 Ulrich Müller gentoo-dev 2024-11-13 08:02:51 UTC
(In reply to Ulrich Müller from comment #6)
> Created attachment 908474 [details, diff] [details, diff]
> patch for get_repo_path()
> 
> We have discussed this in #gentoo-portage. Apparently "portageq
> get_repo_path" doesn't output an absolute path, but a path relative to
> ${ROOT}.
> 
> Please test if attached patch for profile.eselect fixes the problem.

So does this patch fix the problem for you?
Comment 13 dE 2024-11-18 03:11:39 UTC
Yes.
Comment 14 Larry the Git Cow gentoo-dev 2024-11-18 05:52:02 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/eselect.git/commit/?id=5af3344ced5dae1396b0d4d5e51481863621b2dc

commit 5af3344ced5dae1396b0d4d5e51481863621b2dc
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2024-11-13 20:09:49 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2024-11-13 20:09:49 +0000

    Fix repository path with nonempty ROOT in profile module
    
    * modules/profile.eselect (get_repo_path): Prefix the portageq
    output with ROOT. Bug 942970.
    
    Bug: https://bugs.gentoo.org/942970
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 ChangeLog               | 3 +++
 modules/profile.eselect | 5 ++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
Comment 15 Larry the Git Cow gentoo-dev 2024-11-18 06:05:45 UTC
The bug has been closed via the following commit(s):

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

commit dd216fe5c28e48b7a26d410b8c585fa2592539da
Author:     Ulrich Müller <ulm@gentoo.org>
AuthorDate: 2024-11-18 06:02:54 +0000
Commit:     Ulrich Müller <ulm@gentoo.org>
CommitDate: 2024-11-18 06:04:25 +0000

    app-admin/eselect: add 1.4.28
    
    Closes: https://bugs.gentoo.org/942970
    Signed-off-by: Ulrich Müller <ulm@gentoo.org>

 app-admin/eselect/Manifest              |  1 +
 app-admin/eselect/eselect-1.4.28.ebuild | 61 +++++++++++++++++++++++++++++++++
 2 files changed, 62 insertions(+)