Bug 5832 - re-enable of ccache in packaging(RHEL) breaks build when ccache not available
re-enable of ccache in packaging(RHEL) breaks build when ccache not available
Status: RESOLVED FIXED
Product: Samba 3.2
Classification: Unclassified
Component: Build environment
3.2.4
x86 Linux
: P3 normal
: ---
Assigned To: Samba Bugzilla Account
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-18 01:47 UTC by D.L. Meyer
Modified: 2009-05-13 03:18 UTC (History)
0 users

See Also:


Attachments
patch to /packaging/RHEL/samba.spec to enable use of ccache without breaking build when not present... (904 bytes, patch)
2008-10-18 01:55 UTC, D.L. Meyer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description D.L. Meyer 2008-10-18 01:47:43 UTC
The re-enabling of the ccache setup (done between 3.2.2 & 3.2.4) is faulty in that it tries to actually execute ccache to see if it is installed.   When it is not installed, this triggers an rpmbuild failure and exit.

The following patch should correctly sense the presence of ccache and enable its use, while still allowing the build to continue on systems where it is not present:

-----------------------------------------------
--- packaging/RHEL/samba.spec.original	2008-09-18 06:43:37.000000000 -0500
+++ packaging/RHEL/samba.spec	2008-10-18 01:28:58.000000000 -0500
@@ -122,8 +122,9 @@
 # RPM_OPT_FLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
 
 ## check for ccache
- ccache -h 2>&1 > /dev/null
-if [ $? -eq 0 ]; then
+# ccache -h 2>&1 > /dev/null
+#if [ $? -eq 0 ]; then
+if [ "$(which ccache 2> /dev/null)" != "" ]; then
 	CC="ccache gcc"
 else
 	CC="gcc"
-----------------------------------------------
Comment 1 D.L. Meyer 2008-10-18 01:55:10 UTC
Created attachment 3679 [details]
patch to /packaging/RHEL/samba.spec to enable use of ccache without breaking build when not present...

added equivalent mods to samba.spec.tmpl
Comment 2 D.L. Meyer 2008-10-18 22:54:03 UTC
This problem is also found in the samba-3.3.0pre2 source tarball, and the patch above works equally well on the 3.3.0pre2 as it does on 3.2.4.
Comment 3 Karolin Seeger 2009-05-13 03:18:42 UTC
Fixed with 42e0cb8c0 in master.
Will be included in 3.2.12 and 3.3.5.

Thanks for reporting and providing the patch!