Ticket #1325 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Cannot merge binary packages using distutils-r1.eclass

Reported by: chutz Owned by:
Priority: Sometime Milestone:
Component: clients/cave Version: 2.2.0
Keywords: Cc:
Blocked By: Blocking:
Distribution: N/A

Description

Trying to reinstall any binary package that depends on distutiles-r1.eclass (just tried dev-python/twisted-core and dev-python/twisted-web) fails with the error lower down in the postrm phase.

This is with paludis, and the error is triggered at the last line of distutils-r1_run_phase:

cd "${_DISTUTILS_INITIAL_CWD}" || diefunc "${FUNCNAME:-$0}" "$LINENO"

Specifically, the error is:

cd: /var/tmp/paludis/dev-python-twisted-core-13.2.0/work/TwistedCore-13.2.0: No such file or directory

Since r1.106 of distufils-r1.eclass ( http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/eclass/distutils-r1.eclass?r1=1.105&r2=1.106), the value of _DISTUTILS_INITIAL_CWD is set to $PWD, and the directory I see in the error message (used when building the package), does not exist when installing the binary package.

While PMS section 11.2 ( https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-12200011.2) does say that exported variables have to be preserved between invocations, I am not sure that this applies for PWD. PWD was already set by the shell, does the PM really have to override it, and set it to a value that is now irrelevant (it is a directory that does not even exist).

Fuller error message below:

>>> Running ebuild phases loadenv postrm as root:root...
>>> Starting builtin_loadenv
>>> Done builtin_loadenv
>>> Starting pkg_postrm
 * python2_7: running distutils-r1_run_phase twisted-r1_update_plugin_cache

Error:
  * In program cave perform install --hooks --managed-output --output-exclusivity with-others =dev-python/twisted-core-13.2.0:0::gg3-desktop-bin --destination installed --replacing =dev-python/twisted-core-13.2.0:0::installed --x-of-y 1 of 1:
  * When installing 'dev-python/twisted-core-13.2.0:0::gg3-desktop-bin' replacing { 'dev-python/twisted-core-13.2.0:0::installed' }:
  * When merging 'dev-python/twisted-core-13.2.0:0::gg3-desktop-bin' at '/var/tmp/paludis/dev-python-twisted-core-13.2.0/image' to VDB repository 'installed':
  * When uninstalling 'dev-python/twisted-core-13.2.0:0::installed' for an overwrite:
  * When running an ebuild command on 'dev-python/twisted-core-13.2.0:0::installed':
  * Uninstall failed for 'dev-python/twisted-core-13.2.0:0::installed' (paludis::ActionFailedError)

/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv: line 1970: cd: /var/tmp/paludis/dev-python-twisted-core-13.2.0/work/TwistedCore-13.2.0: No such file or directory

!!! ERROR in dev-python/twisted-core-13.2.0::gentoo:
!!! In distutils-r1_run_phase at line 1970
!!! (no message provided)

!!! Call stack:
!!!    * distutils-r1_run_phase (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:1970)
!!!    * _python_multibuild_wrapper (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:1157)
!!!    * _multibuild_run (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:4525)
!!!    * multibuild_foreach_variant (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:4527)
!!!    * python_foreach_impl (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:5624)
!!!    * _distutils-r1_run_foreach_impl (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:608)
!!!    * twisted-r1_pkg_postrm (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:6804)
!!!    * pkg_postrm (/var/tmp/paludis/dev-python-twisted-core-13.2.0-uninstall/temp/loadsaveenv:5006)
!!!    * ebuild_f_postrm (/usr/libexec/paludis/0/pkg_postrm.bash:43)
!!!    * ebuild_main (/usr/libexec/paludis/ebuild.bash:668)
!!!    * main (/usr/libexec/paludis/ebuild.bash:691)

diefunc: making ebuild PID 15963 exit with error
die trap: exiting with error.

Failed install to / for dev-python/twisted-core-13.2.0:0::gg3-desktop-bin replacing 13.2.0:0::installed

And here is the trivial patch, if it is acceptable.

The following changes since commit a982586c9ae5fc979d8f489a4b54c606feecf5b1:

  build: modernise use of AM_INIT_AUTOMAKE (2015-03-07 13:19:08 -0800)

are available in the git repository at:

  git://github.com/chutzimir/paludis.git do-not-reset-PWD

for you to fetch changes up to f9d85fd207e2950e8f3c71228efb038b256bb834:

  PWD is a special variable, we should leave its value alone (2015-03-10 00:40:35 +0900)

----------------------------------------------------------------
Georgi Georgiev (1):
      PWD is a special variable, we should leave its value alone

 paludis/repositories/e/ebuild/source_functions.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/paludis/repositories/e/ebuild/source_functions.bash b/paludis/repositories/e/ebuild/source_functions.bash
index 58b9327..5bfb251 100755
--- a/paludis/repositories/e/ebuild/source_functions.bash
+++ b/paludis/repositories/e/ebuild/source_functions.bash
@@ -37,7 +37,7 @@ ebuild_need_extglob()
 ebuild_safe_source()
 {
     set -- "${@}" '[^a-zA-Z_]*' '*[^a-zA-Z0-9_]*' \
-        EUID PPID UID FUNCNAME GROUPS SHELLOPTS BASHOPTS BASHPID IFS \
+        EUID PPID UID FUNCNAME GROUPS SHELLOPTS BASHOPTS BASHPID IFS PWD \
         'BASH_@(ARGC|ARGV|LINENO|SOURCE|VERSINFO|REMATCH)' \
         'BASH_COMPLETION?(_DIR)' 'bash+([0-9])?([a-z])' \
         EBUILD_KILL_PID PALUDIS_LOADSAVEENV_DIR PALUDIS_DO_NOTHING_SANDBOXY SANDBOX_ACTIVE \

Change History

comment:1 Changed 3 years ago by dleverton

  • Status changed from new to closed
  • Resolution set to fixed

Pushed to master, thanks.

Note: See TracTickets for help on using tickets.