Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 655860 - =sys-apps/portage-2.3.36 breaks has_version ROOT support
Summary: =sys-apps/portage-2.3.36 breaks has_version ROOT support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS, REGRESSION
Depends on:
Blocks: 651804
  Show dependency tree
 
Reported: 2018-05-16 12:21 UTC by Alexis Ballier
Modified: 2018-05-16 22:52 UTC (History)
1 user (show)

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


Attachments
Patch (0001-phase-helpers.sh-make-ROOT-has_version-work-again.patch,893 bytes, patch)
2018-05-16 16:54 UTC, Mike Gilbert
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Ballier gentoo-dev 2018-05-16 12:21:55 UTC
'ROOT=/ has_version' behavior seems to have changed in a non backwards compatible way.

autotools.eclass relies on this. I've pushed [ed0e36e7b664078c7b7f2c346ea377f7537385f8] to use proper arguments to has_version in newer eapis, but EAPIs 0-4 are broken.

As such, e.g. =app-text/lv-4.51-r3 being EAPI 4 breaks when ROOT!=/
Comment 1 Mike Gilbert gentoo-dev 2018-05-16 16:24:49 UTC
I did some quick tests with portage master:

ROOT=/ has_version works in EAPI 0, 1, and 2.

ROOT=/ has_version does not seem to work in EAPI 3, 4, 5, 6.
Comment 2 Mike Gilbert gentoo-dev 2018-05-16 16:39:28 UTC
This behavior probably changed with 43b6be7423aaebee26e4659d580a9a17b4fde01e.

The old code did this:

> local atom eroot host_root=false root=${ROOT}
> 
> ...
> 
> if ___eapi_has_prefix_variables; then
>         # [[ ${root} == / ]] would be ambiguous here,
>         # since both prefixes can share root=/ while
>         # having different EPREFIX offsets.
>         if ${host_root} ; then
>                 eroot=${root%/}${PORTAGE_OVERRIDE_EPREFIX}/
>         else
>                 eroot=${root%/}${EPREFIX}/
>         fi
> else
>         eroot=${root}
> fi

eroot is then passed to the IPC daemon or portageq.

Note that EROOT is not used here; eroot is always derived from ROOT.

The new code does this:

> case ${root_arg} in
>     "") if ___eapi_has_prefix_variables; then
>             root=${EROOT}
>         else
>             root=${ROOT}
>         fi ;;

root is then passed to the IPC daemon or portageq.

When we call ROOT=... has_version, EROOT is not recomputed with the new code, and so root gets the old value.
Comment 3 Larry the Git Cow gentoo-dev 2018-05-16 16:53:02 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=9abebd3e6aae049d2eb9c8039453d7f187bca00f

commit 9abebd3e6aae049d2eb9c8039453d7f187bca00f
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-05-16 16:48:16 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-05-16 16:51:39 +0000

    phase-helpers.sh: fix ROOT overrides for has/best_version (bug 655860)
    
    Since it's common for code to override the ROOT variable, use
    ${ROOT%/}/${EPREFIX} instead of ${EROOT}. Thanks to Mike Gilbert
    <floppym@gentoo.org> for finding the cause.
    
    Fixes: 43b6be7423aa ("phase-helpers.sh: Implement -r|-d|-b options for best/has_version")
    Bug: https://bugs.gentoo.org/655860

 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Comment 4 Mike Gilbert gentoo-dev 2018-05-16 16:54:27 UTC
Created attachment 531856 [details, diff]
Patch
Comment 5 Larry the Git Cow gentoo-dev 2018-05-16 22:52:03 UTC
The bug has been closed via the following commit(s):

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

commit 7342b2e991aeafe00d0a5e0275342fe134944997
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2018-05-16 22:30:03 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2018-05-16 22:51:56 +0000

    sys-apps/portage: version bump to 2.3.37
    
      #654390 - use asyncio's default event loop
      #655414 - fix has/best_version for cross-prefix portageq
      #655860 - fix ROOT overrides for has/best_version
    
    Closes: https://bugs.gentoo.org/655860
    Package-Manager: Portage-2.3.37, Repoman-2.3.9

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-2.3.37.ebuild | 284 +++++++++++++++++++++++++++++++++
 2 files changed, 285 insertions(+)