public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:prefix commit in: lib/_emerge/
@ 2020-12-03  7:43 Fabian Groffen
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Groffen @ 2020-12-03  7:43 UTC (permalink / raw
  To: gentoo-commits

commit:     38794780d573792ba92166291f9bf24b6a6c25aa
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  3 07:40:44 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Dec  3 07:40:44 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=38794780

EbuildPhase: filter unresolved soname deps from host system in Prefix

Libs like libc.so.1, libnsl.so.1, libsocket.so.1 etc. all come from the
host system, and cannot be provided by a package (unless we hack up a
VDB entry).  So, when operating under Prefix, check unresolved libs in
the host system.

Caveats:
- we don't check whether the endianness/bits match, anything that has
  the same name is fine
- we can also include libs that we shouldn't use, e.g. libxml2.so

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 lib/_emerge/EbuildPhase.py | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index e4c0428a6..6d08d88d1 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -27,6 +27,8 @@ from portage.util._async.AsyncTaskFuture import AsyncTaskFuture
 from portage.util._async.BuildLogger import BuildLogger
 from portage.util.futures import asyncio
 from portage.util.futures.executor.fork import ForkExecutor
+# PREFIX LOCAL
+from portage.const import EPREFIX
 
 try:
 	from portage.xml.metadata import MetaDataXML
@@ -505,6 +507,22 @@ class _PostPhaseCommands(CompositeTask):
 
 		unresolved = _get_unresolved_soname_deps(os.path.join(self.settings['PORTAGE_BUILDDIR'], 'build-info'), all_provides)
 
+		# BEGIN PREFIX LOCAL
+		if EPREFIX != "" and unresolved:
+			# in prefix, consider the host libs for any unresolved libs,
+			# so we kill warnings about missing libc.so.1, etc.
+			for obj, libs in list(unresolved):
+				unresolved.remove((obj, libs))
+				libs=list(libs)
+				for lib in list(libs):
+					for path in ['/lib64', '/lib/64', '/lib']:
+						if os.path.exists(os.path.join(path, lib)):
+							libs.remove(lib)
+							break
+				if len(libs) > 0:
+					unresolved.add((obj, tuple(libs)))
+		# END PREFIX LOCAL
+
 		if unresolved:
 			unresolved.sort()
 			qa_msg = ["QA Notice: Unresolved soname dependencies:"]


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: lib/_emerge/
@ 2020-12-04 15:42 Fabian Groffen
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Groffen @ 2020-12-04 15:42 UTC (permalink / raw
  To: gentoo-commits

commit:     51fca1db10a0c9f86713ee12b46cc29c4fb9fa3f
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Fri Dec  4 15:41:06 2020 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Fri Dec  4 15:41:06 2020 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=51fca1db

EbuildPhase: also look in /usr/lib paths for missing sonames

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 lib/_emerge/EbuildPhase.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/_emerge/EbuildPhase.py b/lib/_emerge/EbuildPhase.py
index 6d08d88d1..496db33ec 100644
--- a/lib/_emerge/EbuildPhase.py
+++ b/lib/_emerge/EbuildPhase.py
@@ -515,12 +515,13 @@ class _PostPhaseCommands(CompositeTask):
 				unresolved.remove((obj, libs))
 				libs=list(libs)
 				for lib in list(libs):
-					for path in ['/lib64', '/lib/64', '/lib']:
+					for path in ['/lib64', '/lib/64', '/lib', \
+							'/usr/lib64', '/usr/lib/64', '/usr/lib']:
 						if os.path.exists(os.path.join(path, lib)):
 							libs.remove(lib)
 							break
 				if len(libs) > 0:
-					unresolved.add((obj, tuple(libs)))
+					unresolved.append((obj, tuple(libs)))
 		# END PREFIX LOCAL
 
 		if unresolved:


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/portage:prefix commit in: lib/_emerge/
@ 2022-07-31 12:25 Fabian Groffen
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Groffen @ 2022-07-31 12:25 UTC (permalink / raw
  To: gentoo-commits

commit:     b4acbf4935bfa8162304444fde8448629ac4a839
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 31 12:22:42 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Jul 31 12:22:42 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=b4acbf49

lib/_emerge/actions.py: drop custom clang identification

drop this bit, because:
- there are no native Clang toolchains in use in Prefix currently
- it isn't guaranteed to be correct
- we can just rely on PATH because this isn't anything but cosmetics
- it is cosmetics, it isn't necessary for Prefix to operate correctly
- it is disputed to be correct in the first place:
  https://github.com/gentoo/portage/pull/876

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 lib/_emerge/actions.py | 40 ++--------------------------------------
 1 file changed, 2 insertions(+), 38 deletions(-)

diff --git a/lib/_emerge/actions.py b/lib/_emerge/actions.py
index bf00133e8..e2f3f2ccf 100644
--- a/lib/_emerge/actions.py
+++ b/lib/_emerge/actions.py
@@ -36,7 +36,6 @@ from portage import shutil
 from portage import _encodings, _unicode_decode
 from portage.binrepo.config import BinRepoConfigLoader
 from portage.const import BINREPOS_CONF_FILE, _DEPCLEAN_LIB_CHECK_DEFAULT
-from portage.const import EPREFIX
 from portage.dbapi.dep_expand import dep_expand
 from portage.dbapi._expand_new_virt import expand_new_virt
 from portage.dbapi.IndexedPortdb import IndexedPortdb
@@ -2951,19 +2950,6 @@ def getgccversion(chost=None):
     gcc_ver_command = ["gcc", "-dumpversion"]
     gcc_ver_prefix = "gcc-"
 
-    # BEGIN PREFIX LOCAL: accept clang as system compiler too
-    clang_ver_command = ['clang', '--version']
-    clang_ver_prefix = 'clang-'
-
-    ubinpath = os.path.join('/', portage.const.EPREFIX, 'usr', 'bin')
-
-    def getclangversion(output):
-        version = re.search('clang version ([0-9.]+) ', output)
-        if version:
-            return version.group(1)
-        return "unknown"
-    # END PREFIX LOCAL
-
     gcc_not_found_error = red(
         "!!! No gcc found. You probably need to 'source /etc/profile'\n"
         + "!!! to update the environment of this terminal and possibly\n"
@@ -2972,10 +2958,8 @@ def getgccversion(chost=None):
 
     if chost:
         try:
-            # PREFIX LOCAL: use ubinpath
             proc = subprocess.Popen(
-                [ubinpath + "/" + "gcc-config", "-c"],
-                stdout=subprocess.PIPE, stderr=subprocess.STDOUT
+                ["gcc-config", "-c"], stdout=subprocess.PIPE, stderr=subprocess.STDOUT
             )
         except OSError:
             myoutput = None
@@ -2987,10 +2971,8 @@ def getgccversion(chost=None):
             return myoutput.replace(chost + "-", gcc_ver_prefix, 1)
 
         try:
-            # PREFIX LOCAL: use ubinpath
             proc = subprocess.Popen(
-                [ubinpath + "/" + chost + "-" + gcc_ver_command[0]]
-                + gcc_ver_command[1:],
+                [chost + "-" + gcc_ver_command[0]] + gcc_ver_command[1:],
                 stdout=subprocess.PIPE,
                 stderr=subprocess.STDOUT,
             )
@@ -3003,24 +2985,6 @@ def getgccversion(chost=None):
         if mystatus == os.EX_OK:
             return gcc_ver_prefix + myoutput
 
-        # BEGIN PREFIX LOCAL: try Clang
-        try:
-            proc = subprocess.Popen(
-                [ubinpath + "/" + chost + "-" + clang_ver_command[0]]
-                + clang_ver_command[1:],
-                stdout=subprocess.PIPE,
-                stderr=subprocess.STDOUT,
-            )
-        except OSError:
-            myoutput = None
-            mystatus = 1
-        else:
-            myoutput = _unicode_decode(proc.communicate()[0]).rstrip("\n")
-            mystatus = proc.wait()
-        if mystatus == os.EX_OK:
-            return clang_ver_prefix + getclangversion(myoutput)
-        # END PREFIX LOCAL
-
     try:
         proc = subprocess.Popen(
             gcc_ver_command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-31 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-03  7:43 [gentoo-commits] proj/portage:prefix commit in: lib/_emerge/ Fabian Groffen
  -- strict thread matches above, loose matches on Subject: below --
2020-12-04 15:42 Fabian Groffen
2022-07-31 12:25 Fabian Groffen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox