Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 880675 - cuda.eclass: cuda_gccdir() broken by GCC dir scheme change
Summary: cuda.eclass: cuda_gccdir() broken by GCC dir scheme change
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal blocker
Assignee: Gentoo Science Related Packages
URL:
Whiteboard:
Keywords: PATCH
: 877305 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-11-10 01:06 UTC by Ștefan Talpalaru
Modified: 2022-11-22 20:52 UTC (History)
4 users (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 Ștefan Talpalaru 2022-11-10 01:06:44 UTC
Current output (ends up in NVCCFLAGS, breaking each and every ebuild using this eclass):

--compiler-bindir "/usr/*pc-linux-gnu/gcc-bin/11.3*"

Actual directory:

/usr/x86_64-pc-linux-gnu/gcc-bin/11

Fix:

--- /usr/portage/eclass/cuda.eclass	2022-03-24 05:26:01.000000000 +0100
+++ ../../eclass/cuda.eclass	2022-11-10 01:45:50.828346926 +0100
@@ -87,7 +87,7 @@
 	# Try the current gcc version first
 	ver=$(gcc-version)
 	if [[ -n "${ver}" ]] && [[ ${vers} =~ ${ver} ]]; then
-		dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver}*/ )
+		dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver%.*}*/ )
 		gcc_bindir="${dirs[${#dirs[@]}-1]}"
 	fi
 
@@ -96,14 +96,14 @@
 		ver=$(ver_cut 1-2 "${ver##*sys-devel/gcc-}")
 
 		if [[ -n "${ver}" ]] && [[ ${vers} =~ ${ver} ]]; then
-			dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver}*/ )
+			dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver%.*}*/ )
 			gcc_bindir="${dirs[${#dirs[@]}-1]}"
 		fi
 	fi
 
 	for ver in ${vers}; do
 		if has_version "=sys-devel/gcc-${ver}*"; then
-			dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver}*/ )
+			dirs=( ${EPREFIX}/usr/*pc-linux-gnu/gcc-bin/${ver%.*}*/ )
 			gcc_bindir="${dirs[${#dirs[@]}-1]}"
 		fi
 	done


Reproducible: Always
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-11-10 05:23:14 UTC
*** Bug 877305 has been marked as a duplicate of this bug. ***
Comment 2 Larry the Git Cow gentoo-dev 2022-11-22 20:52:05 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3313fb4c7829d383aa6596092c41c377905e711d

commit 3313fb4c7829d383aa6596092c41c377905e711d
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-22 20:48:38 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-22 20:51:38 +0000

    cuda.eclass: adapt for newer GCC paths (major version only)
    
    Bug: https://bugs.gentoo.org/865835
    Closes: https://bugs.gentoo.org/880675
    Signed-off-by: Sam James <sam@gentoo.org>

 eclass/cuda.eclass | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14ccbc70d9497a95ba3d093863af2ce2a6702f33

commit 14ccbc70d9497a95ba3d093863af2ce2a6702f33
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2022-11-22 20:48:08 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-11-22 20:51:37 +0000

    dev-util/nvidia-cuda-toolkit: allow new GCC paths for 10.x, 11.x
    
    Bug: https://bugs.gentoo.org/865835
    Bug: https://bugs.gentoo.org/880675
    Signed-off-by: Sam James <sam@gentoo.org>

 ...da-toolkit-11.7.0-r2.ebuild => nvidia-cuda-toolkit-11.7.0-r3.ebuild} | 2 +-
 ...da-toolkit-11.8.0-r1.ebuild => nvidia-cuda-toolkit-11.8.0-r2.ebuild} | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)