1 |
commit: a41c0f8b9081dad610e6e82ab57a5adce30789ae |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Dec 13 08:04:55 2015 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Dec 20 17:38:49 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=a41c0f8b |
7 |
|
8 |
doebuild: Support finding lib* for ccache/distcc/icecc masquerade dir |
9 |
|
10 |
Gentoo ccache used to historically swap between storing its masquerade |
11 |
in 'lib' and $(get_libdir). To prevent breakage with any version of it, |
12 |
and prevent future breakages when other tools change places randomly |
13 |
try all three of $(get_libdir), 'lib' and 'libexec' looking for |
14 |
masquerade dir and use the one that's found. Additionally, warn if there |
15 |
is no masquerade dir. |
16 |
|
17 |
Fixes: https://bugs.gentoo.org/show_bug.cgi?id=567360 |
18 |
Reviewed-by: Zac Medico <zmedico <AT> gentoo.org> |
19 |
|
20 |
pym/portage/package/ebuild/doebuild.py | 27 ++++++++++++++++++--------- |
21 |
1 file changed, 18 insertions(+), 9 deletions(-) |
22 |
|
23 |
diff --git a/pym/portage/package/ebuild/doebuild.py b/pym/portage/package/ebuild/doebuild.py |
24 |
index ff8958e..a4d4d9f 100644 |
25 |
--- a/pym/portage/package/ebuild/doebuild.py |
26 |
+++ b/pym/portage/package/ebuild/doebuild.py |
27 |
@@ -466,7 +466,6 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, |
28 |
icecream = "icecream" in mysettings.features |
29 |
|
30 |
if ccache or distcc or icecream: |
31 |
- # Use default ABI libdir in accordance with bug #355283. |
32 |
libdir = None |
33 |
default_abi = mysettings.get("DEFAULT_ABI") |
34 |
if default_abi: |
35 |
@@ -474,17 +473,27 @@ def doebuild_environment(myebuild, mydo, myroot=None, settings=None, |
36 |
if not libdir: |
37 |
libdir = "lib" |
38 |
|
39 |
+ # The installation locations use to vary between versions... |
40 |
+ # Safer to look them up rather than assuming |
41 |
+ possible_libexecdirs = (libdir, "lib", "libexec") |
42 |
+ masquerades = [] |
43 |
if distcc: |
44 |
- mysettings["PATH"] = os.path.join(os.sep, eprefix_lstrip, |
45 |
- "usr", libdir, "distcc", "bin") + ":" + mysettings["PATH"] |
46 |
- |
47 |
+ masquerades.append("distcc") |
48 |
if icecream: |
49 |
- mysettings["PATH"] = os.path.join(os.sep, eprefix_lstrip, |
50 |
- "usr", 'libexec', "icecc", "bin") + ":" + mysettings["PATH"] |
51 |
- |
52 |
+ masquerades.append("icecc") |
53 |
if ccache: |
54 |
- mysettings["PATH"] = os.path.join(os.sep, eprefix_lstrip, |
55 |
- "usr", libdir, "ccache", "bin") + ":" + mysettings["PATH"] |
56 |
+ masquerades.append("ccache") |
57 |
+ |
58 |
+ for m in masquerades: |
59 |
+ for l in possible_libexecdirs: |
60 |
+ p = os.path.join(os.sep, eprefix_lstrip, |
61 |
+ "usr", l, m, "bin") |
62 |
+ if os.path.isdir(p): |
63 |
+ mysettings["PATH"] = p + ":" + mysettings["PATH"] |
64 |
+ break |
65 |
+ else: |
66 |
+ writemsg(("Warning: %s requested but no masquerade dir" |
67 |
+ + "can be found in /usr/lib*/%s/bin\n") % (m, m)) |
68 |
|
69 |
if 'MAKEOPTS' not in mysettings: |
70 |
nproc = get_cpu_count() |