Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 627726 - llvm.eclass: PATH prepending overrides ccache/distcc/etc. for clang
Summary: llvm.eclass: PATH prepending overrides ccache/distcc/etc. for clang
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Eclasses (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-12 21:27 UTC by Michał Górny
Modified: 2020-05-28 11:41 UTC (History)
2 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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-08-12 21:27:46 UTC
Since we're prepending the LLVM path which can contain clang executables, we're overriding the wrappers Portage creates for ccache/distcc/icecc. Might be worthwhile to look into supporting that somehow.

Also, if someone uses unversioned clang in CC/CXX, we might enforce an older clang version.
Comment 1 Larry the Git Cow gentoo-dev 2020-03-30 11:46:09 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0dc9c1d46d3e318a84af8fc89c9037915fa237d0

commit 0dc9c1d46d3e318a84af8fc89c9037915fa237d0
Author:     Thomas Deutschmann <whissi@gentoo.org>
AuthorDate: 2020-03-29 21:10:29 +0000
Commit:     Thomas Deutschmann <whissi@gentoo.org>
CommitDate: 2020-03-30 11:45:09 +0000

    www-client/firefox: fix PATH for FEATURES=ccache/distcc
    
    Bug: https://bugs.gentoo.org/627726
    Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>

 www-client/firefox/firefox-68.6.0-r2.ebuild | 24 ++++++++++++++++++++++++
 www-client/firefox/firefox-74.0-r2.ebuild   | 24 ++++++++++++++++++++++++
 2 files changed, 48 insertions(+)
Comment 2 Arfrever Frehtes Taifersar Arahesis 2020-05-26 06:19:41 UTC
I think that good solution would be to insert /usr/lib/llvm/${llvm_slot}/bin not at the beginning of PATH, but directly before first element, which is any of the following:

  /usr/lib/llvm/*/bin
  $(realpath /usr/lib/llvm)/*/bin

(With ${BROOT}, ${ESYSROOT}, ${EPREFIX} as appropriate.)

Support for no longer existing sys-devel/llvm:0, which was using /usr/bin, can be dropped.
Comment 3 Arfrever Frehtes Taifersar Arahesis 2020-05-26 06:32:20 UTC
Also probably llvm_pkg_setup() should call get_llvm_prefix() with -b option in EAPI >= 7.
Comment 4 Larry the Git Cow gentoo-dev 2020-05-28 11:41:26 UTC
The bug has been closed via the following commit(s):

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

commit f1e8874cc2de2055c3a07f7faf0c78d723106d06
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2020-05-26 07:41:40 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2020-05-28 11:41:22 +0000

    llvm.eclass: Fix prepending LLVM path before system paths
    
    Do not prepend LLVM path before system path, in particular before
    ccache/distcc paths.  Instead, prepend it before the first LLVM version
    found in PATH, or append to the end if no LLVM is found in PATH.
    
    Closes: https://bugs.gentoo.org/627726
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 eclass/llvm.eclass   | 25 +++++++++++++++++++++++--
 eclass/tests/llvm.sh | 16 ++++++++--------
 2 files changed, 31 insertions(+), 10 deletions(-)