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

Bug 956741

Summary: [Future EAPI] USE=other-sysroot for when SYSROOT != /
Product: Gentoo Hosted Projects Reporter: James Le Cuirot <chewi>
Component: PMS/EAPIAssignee: Package Manager Specification <pms>
Status: CONFIRMED ---    
Severity: normal CC: esigra
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=951515
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 174380    

Description James Le Cuirot gentoo-dev 2025-05-28 11:33:09 UTC
The old EAPI 5-hdepend had a USE flag called targetroot for when ROOT != /. This wasn't a very good name for the flag, and the condition was too broad. We need a flag that allows a package to conditionally BDEPEND on itself, but BDEPEND applies to the src_* phases while ROOT applies to the pkg_* phases.

I am therefore proposing a flag with a slightly different name and condition. The name is tentatively other-sysroot, but I am open to other suggestions. The condition would be SYSROOT != /. The flag would be implicit.

It is to be used for cases like llvm-core/clang where we need the same package to be present on the build host in order to cross-compile it. The ebuild currently calls "has_version -b" with "die" as a workaround.

We did not take or adapt USE=targetroot from EAPI 5-hdepend when working on EAPI 7 because we had hoped to make do with temporary builds for the build host as part of the target host build. Sometimes this does work, but it's not practical for cases like llvm-core/clang, and even when it does work, it's often quite awkward. With this new USE flag, developers should use whichever approach feels best.

I have not chosen CBUILD != CHOST (tc-is-cross-compiler) as the condition because you should generally not try to directly execute binaries built for the SYSROOT even when the tuple is the same. SYSROOT might have a newer glibc or otherwise require different libraries.

There is one exception to this. I considered whether the condition should be ESYSROOT != BROOT. This would make it trigger during cross-prefix builds. I don't think it should because cross-prefix binaries should be directly executable without issue.
Comment 1 James Le Cuirot gentoo-dev 2025-05-28 13:39:20 UTC
After some discussion in #gentoo-pms, we've agreed to have crossdev set this flag instead, at least for the time being. Maybe we can make it part of the spec later.