commit:     c9c2bcc619c6ff60e452205f94ae26d4afd44d82
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  3 15:34:08 2019 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Sep  3 15:36:23 2019 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c9c2bcc6

Revert "_doebuild_path: Optimize PATH in ebuild environment."

This reverts commit 7cb7196fe8aa668e76437a8a4500a7bcb9fd3c75.
Since binary and installed packages have persistent PATH
settings in environment.bz2, using realpath on PATH components
can break binary and installed package phases if the symlink
layout is somehow modified. Therefore, the implications of
changes like this need to be considered very carefully.

Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/package/ebuild/doebuild.py | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/lib/portage/package/ebuild/doebuild.py 
b/lib/portage/package/ebuild/doebuild.py
index 66e294d51..584ff798b 100644
--- a/lib/portage/package/ebuild/doebuild.py
+++ b/lib/portage/package/ebuild/doebuild.py
@@ -5,7 +5,6 @@ from __future__ import unicode_literals
 
 __all__ = ['doebuild', 'doebuild_environment', 'spawn', 'spawnebuild']
 
-import collections
 import grp
 import gzip
 import errno
@@ -255,14 +254,7 @@ def _doebuild_path(settings, eapi=None):
                                path.append(x_abs)
 
        path.extend(rootpath)
-
-       # Canonicalize paths and avoid duplicates when some directories
-       # (e.g. bin and sbin) are merged.
-       real_path = collections.OrderedDict()
-       for x in path:
-               real_path.setdefault(os.path.realpath(x), None)
-
-       settings["PATH"] = ":".join(real_path)
+       settings["PATH"] = ":".join(path)
 
 def doebuild_environment(myebuild, mydo, myroot=None, settings=None,
        debug=False, use_cache=None, db=None):

Reply via email to