Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 647214

Summary: net-libs/serf: fails to compile with clang due to Gentoo clang location
Product: Gentoo Linux Reporter: Fabian Groffen <grobian>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED WONTFIX    
Severity: normal CC: grobian
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Fabian Groffen gentoo-dev 2018-02-10 10:47:54 UTC
scons: Reading SConscript files ...
Checking for GNU-compatible C compiler...no
scons: done reading SConscript files.
scons: Building targets ...
x86_64-apple-darwin14-clang -o context.os -c -march=native -O2 -pipe -fPIC -DNDEBUG -DDARWIN -DSIGPROCMASK_SETS_THREAD_MASK -I. -I/Users/fabian/Gentoo-10.10/usr/include/apr-1 -I/Users/fabian/Gentoo-10.10/usr/include context.c
sh: x86_64-apple-darwin14-clang: file not found
scons: *** [context.os] Error 127
scons: building terminated because of errors.

% which x86_64-apple-darwin14-clang
/Users/fabian/Gentoo-10.10/usr/lib/llvm/5/bin/x86_64-apple-darwin14-clang

Note that clang/llvm maintainer decided to put the compiler in usr/lib/llvm/<ver>/bin, and put that location in PATH.

scons by default wipes the environment, resulting in this problem.

Doing the following as per the scons docs, makes the build start and run correctly for me:

--- SConstruct.orig     2018-02-10 11:40:46.000000000 +0100
+++ SConstruct  2018-02-10 11:46:40.000000000 +0100
@@ -158,6 +158,7 @@
 env = Environment(variables=opts,
                   tools=('default', 'textfile',),
                   CPPPATH=['.', ],
+                                 ENV = {'PATH' : os.environ['PATH']},
                   )
 
 
Please advice: can I add this patch for 1.3.9, or do you see another way to get scons to find the compiler here.  Thanks.
Comment 1 Wil Reichert 2018-04-02 21:28:40 UTC
also builds if you pass the entire path e.g.

scons CC=/usr/lib/llvm/6/bin/clang

but your approach seems better. The PATH exposed to builds is portage specific & shouldn't have any extra cruft. Your patch tests fine on my system.
Comment 2 Arfrever Frehtes Taifersar Arahesis 2018-04-03 02:57:31 UTC
Could you firstly send the patch to upstream?
Comment 3 Fabian Groffen gentoo-dev 2023-05-04 20:12:56 UTC
who needs serf/svn nowadays