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

Bug 830858

Summary: sys-devel/binutils-config: add explicit --root option
Product: Gentoo Linux Reporter: Arfrever Frehtes Taifersar Arahesis <arfrever.fta>
Component: Current packagesAssignee: Gentoo Toolchain Maintainers <toolchain>
Status: UNCONFIRMED ---    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 830854    

Description Arfrever Frehtes Taifersar Arahesis 2022-01-09 16:16:49 UTC
sys-devel/binutils-config uses ROOT environmental variable.
This tool is usually used in sys-devel/binutils ebuilds, wherein at least part of solution will be needed.
See tracker for details.
Comment 1 SpanKY gentoo-dev 2022-01-13 07:37:29 UTC
respecting $ROOT is entirely expected & desired behavior

if you want to add a --root to explicitly set/override it, that's fine
Comment 2 Arfrever Frehtes Taifersar Arahesis 2022-01-13 19:29:04 UTC
Build systems of other packages may use ROOT for entirely different purposes (e.g. even custom path to 'root' tool from sci-physics/root).
Exporting of some other variables (especially A) causes even more widespread problems.
Future EAPI may stop exporting all Gentoo-specific variables for consistency. They will remain in ebuild environment as non-exported variables.

If you want that ${ROOT} information be passed to binutils-config through environmental variable, then sys-devel/binutils ebuilds can simply explicitly export ROOT (preferably in subshell):

> pkg_postinst() {
> 	(
> 		# Make sure this ${CTARGET} has a binutils version selected
> 		[[ -e ${EROOT}/etc/env.d/binutils/config-${CTARGET} ]] && return 0
> 		export ROOT
> 		binutils-config ${CTARGET}-${PV}
> 	)
> }

(And similarly in pkg_postrm().)
Comment 3 SpanKY gentoo-dev 2022-01-14 14:42:20 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #2)
> Build systems of other packages may use ROOT for entirely different purposes

other build systems don't matter.  they aren't running binutils-config or gcc-config.

> If you want that ${ROOT} information be passed to binutils-config through
> environmental variable, then sys-devel/binutils ebuilds

i didn't say the env var has to be used in the ebuilds.  that's why the bug is still open -- we can add a --root option for them.