Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 792273 - app-portage/portage-utils: qmerge: sys-apps/portage-3.0.18 can not be merged (KeyError: 'ED')
Summary: app-portage/portage-utils: qmerge: sys-apps/portage-3.0.18 can not be merged ...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Unclassified (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Fabian Groffen
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-26 16:48 UTC by Joakim Tjernlund
Modified: 2021-07-06 07:03 UTC (History)
1 user (show)

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 Joakim Tjernlund 2021-05-26 16:48:11 UTC
qmerge (from portage-utils) yields this error when binary merging:

qmerge -OK sys-apps/portage
[R] sys-apps/portage-3.0.18
 * Checking for suitable kernel configuration options...
 [ ok ]
 * Using python3.8 in global scope
FEATURES variable contains unknown value(s): disabled
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/var/tmp/qmerge/sys-apps/portage-3.0.18/image/usr/lib/python3.8/site-packages/portage/_compat_upgrade/default_locations.py", line 93, in <module>
    main()
  File "/var/tmp/qmerge/sys-apps/portage-3.0.18/image/usr/lib/python3.8/site-packages/portage/_compat_upgrade/default_locations.py", line 63, in main
    config_path = os.path.join(os.environ['ED'], GLOBAL_CONFIG_PATH.lstrip(os.sep), 'make.globals')
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'ED'

Seems binary portage pkgs require env. var ED to be present when it is merged
as a binary package.
Comment 1 Joakim Tjernlund 2021-05-26 16:51:13 UTC
Also, this printout:
  FEATURES variable contains unknown value(s): disabled
could be improved a bit by adding what the unknown value(s) are.
Comment 2 Ionen Wolkens gentoo-dev 2021-05-27 07:51:57 UTC
Attaching `emerge --info portage-utils` may be useful too.

My guess is that you are still using /usr/portage (or some other legacy setting) which triggers portage's compat script that (indeed) expect ED to exist. Otherwise it works fine.
Comment 3 Joakim Tjernlund 2021-05-27 11:27:58 UTC
(In reply to Ionen Wolkens from comment #2)
> Attaching `emerge --info portage-utils` may be useful too.
> 
> My guess is that you are still using /usr/portage (or some other legacy
> setting) which triggers portage's compat script that (indeed) expect ED to
> exist. Otherwise it works fine.

Yes, I am using legacy /usr/portage here.
The question is whether portage if PMS allows usage of ED here?
Comment 4 Fabian Groffen gentoo-dev 2021-05-27 11:30:47 UTC
think we should check if we actually dump ED into the env in qmerge
Comment 5 Joakim Tjernlund 2021-05-27 12:07:06 UTC
(In reply to Fabian Groffen from comment #4)
> think we should check if we actually dump ED into the env in qmerge

I don't think so. I can workaround this bug with ED=/ qmerge ...
Comment 6 Joakim Tjernlund 2021-05-27 12:36:32 UTC
(In reply to Joakim Tjernlund from comment #5)
> (In reply to Fabian Groffen from comment #4)
> > think we should check if we actually dump ED into the env in qmerge
> 
> I don't think so. I can workaround this bug with ED=/ qmerge ...

According to https://dev.gentoo.org/~ulm/pms/head/pms.html, ED
is defined in src_install, pkg_preinst and pkg_postinst so
I guess qmerge need to add ED but I can see that ED is already defined as:
"ED=\"${D%%/}/${EPREFIX%%/}/\"

Looks like SYSROOT, ESYSROOT, BROOT too?
Comment 7 Fabian Groffen gentoo-dev 2021-06-10 06:24:43 UTC
I think it's worth a try to export the variables here.
Comment 8 Larry the Git Cow gentoo-dev 2021-06-14 09:34:15 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=f1cf942274c47dce50bbaff45d41a8a83102e3fd

commit f1cf942274c47dce50bbaff45d41a8a83102e3fd
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-06-14 09:32:02 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-06-14 09:32:02 +0000

    qmerge: once over to make better/more use of libq/tree
    
    - unify best_version and grab_binpkg_info, into single function using
      tree_match_atom to benefit from cache and abstract any particulars
    - default to install action when no action given
    - unmerge previous package on merge upgrade again
    - possibly fix bug #792273 by exporting vars
    
    Bug: https://bugs.gentoo.org/792273
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 qmerge.c                                           | 782 ++++++++-------------
 tests/qmerge/dotest                                |  52 +-
 tests/qmerge/packages/Packages                     |  13 +
 .../qmerge/packages/sys-devel/qmerge-test-2.0.tbz2 | Bin 0 -> 7334 bytes
 4 files changed, 356 insertions(+), 491 deletions(-)
Comment 9 Larry the Git Cow gentoo-dev 2021-07-06 07:03:19 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65b5ac4b8140f7ff1ab5c27af5c690288ec1419b

commit 65b5ac4b8140f7ff1ab5c27af5c690288ec1419b
Author:     Fabian Groffen <grobian@gentoo.org>
AuthorDate: 2021-07-06 07:03:02 +0000
Commit:     Fabian Groffen <grobian@gentoo.org>
CommitDate: 2021-07-06 07:03:15 +0000

    app-portage/portage-utils-0.92: version bump + cleanup
    
    Closes: https://bugs.gentoo.org/792273
    Closes: https://bugs.gentoo.org/791571
    Closes: https://bugs.gentoo.org/787089
    Closes: https://bugs.gentoo.org/769929
    Closes: https://bugs.gentoo.org/757540
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: Fabian Groffen <grobian@gentoo.org>

 app-portage/portage-utils/Manifest                 |  3 +-
 .../portage-utils/portage-utils-0.90.1.ebuild      | 67 ----------------------
 ...utils-0.91.ebuild => portage-utils-0.92.ebuild} |  0
 3 files changed, 1 insertion(+), 69 deletions(-)