Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 830858 - sys-devel/binutils-config: add explicit --root option
Summary: sys-devel/binutils-config: add explicit --root option
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: package-manager-specific-env-vars-usage
  Show dependency tree
 
Reported: 2022-01-09 16:16 UTC by Arfrever Frehtes Taifersar Arahesis
Modified: 2022-01-14 14:42 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 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.