Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 953996 - ROOT/--root support in sys-apps/portage-3.0.67 (and prior) ignores environment variables
Summary: ROOT/--root support in sys-apps/portage-3.0.67 (and prior) ignores environmen...
Status: UNCONFIRMED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-18 16:50 UTC by Stuart Shelton
Modified: 2025-04-18 17:33 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2025-04-18 16:50:28 UTC
If the ROOT environment-variable is set to anything other than '/' or if the '--root=<path>' command-line argument is passed to 'emerge', then all other environment-variables seem to be silently ignored.

At the very least, ACCEPT_LICENSE and USE no longer have any effect.

For example:

```
# ACCEPT_LICENSE='*' USE='-nls -python -cramfs -io-uring' emerge -ekpv --color=n sys-libs/zlib 

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 0.85 s (backtrack: 0/100).

[binary   R    ] virtual/libiconv-0-r2-2::gentoo  0 KiB
…
[binary   R    ] sys-libs/gdbm-1.24-2:0/6::gentoo  USE="berkdb readline -nls -static-libs -test -verify-sig" 0 KiB
…
[binary   R    ] app-alternatives/gzip-1-2::gentoo  USE="reference (split-usr) -pigz" 0 KiB

Total: 24 packages (24 reinstalls, 24 binaries), Size of downloads: 0 KiB

# ACCEPT_LICENSE='*' USE='-nls -python -cramfs -io-uring' ROOT=/mnt/root/ emerge -ekpv --color=n sys-libs/zlib

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 3.44 s (backtrack: 0/100).

[binary   R    ] virtual/libintl-0-r2-2::gentoo  0 KiB
…
[ebuild   R    ] sys-libs/gdbm-1.24:0/6::gentoo  USE="berkdb nls* readline -static-libs -test -verify-sig" 0 KiB
…
[binary   R    ] sys-auth/pambase-20240128-2::gentoo  USE="caps mktemp nullok pwquality yescrypt -debug -elogind -gnome-keyring -homed -minimal (-pam_krb5) (-pam_ssh) -passwdqc -pwhistory -securetty (-selinux) -sha512 (-sssd) -systemd" 0 KiB
[ebuild   R    ] sys-apps/shadow-4.14.8:0/4::srcshelton  USE="acl audit nls* pam (split-usr) xattr -cracklib (-selinux) (-skey) -su -systemd -verify-sig" 0 KiB

Total: 201 packages (32 new, 1 in new slot, 168 reinstalls, 143 binaries), Size of downloads: 16648 KiB

!!! The following installed packages are masked:
- dev-python/sphinxcontrib-jquery-4.1::gentoo (masked by: 0BSD license(s))
A copy of the '0BSD' license is located at '/var/db/repo/gentoo/licenses/0BSD'.

- app-containers/skopeo-1.18.0::srcshelton (masked by: CC-BY-SA-4.0 license(s))
A copy of the 'CC-BY-SA-4.0' license is located at '/var/db/repo/gentoo/licenses/CC-BY-SA-4.0'.

For more information, see the MASKED PACKAGES section in the emerge
man page or refer to the Gentoo Handbook.

```

In this (real-world) example, /mnt/root was tested either being empty, or with /mnt/root/etc/portage only populated identically to the root-system, and with and without SYSROOT/--sysroot set to either '/' or '/mnt/root' - none of which seemed to affect the situation.

Note that in the second case, with ROOT, ACCEPT_LICENSE, and USE set the licence exemptions are not applied as-per the end of the output, and 'emerge' thinks that it needs to install 201 packages rather than 24 even though '-e' was passed in both cases, at least partially because the more restricted USE flags haven't seen applied (N.B. the 'nls' flag on sys-libs/gdbm, for example).