Bug 212469 - 'make debug' fails on the repository root if ccache is installed on mac after r262147
Summary: 'make debug' fails on the repository root if ccache is installed on mac after...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Keith Rollin
URL:
Keywords: InRadar
Depends on: 209890
Blocks:
  Show dependency treegraph
 
Reported: 2020-05-28 08:26 PDT by Tetsuharu Ohzeki
Modified: 2020-10-14 11:03 PDT (History)
7 users (show)

See Also:


Attachments
Patch (1.53 KB, patch)
2020-05-28 09:10 PDT, Tetsuharu Ohzeki
no flags Details | Formatted Diff | Diff
Patch (2.04 KB, patch)
2020-10-13 21:39 PDT, Keith Rollin
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tetsuharu Ohzeki 2020-05-28 08:26:43 PDT
* After https://trac.webkit.org/changeset/262182/webkit (bug 209890), `make debug` or `make release` fails on the repository root if ccache is installed on the machine.
* If the machine did not install ccache, it works well.
* This problem is not reproduce with `Tools/Scripts/build-webkit --debug`


## Environment

* macOS 10.15.5
* XCode 11.5
* Build for macOS on macOS
Comment 1 Tetsuharu Ohzeki 2020-05-28 08:32:34 PDT
the log with `make debug`

```
../Tools/Scripts/set-webkit-configuration --debug
perl ../Tools/Scripts/copy-webkitlibraries-to-product-directory
../../Tools/Scripts/set-webkit-configuration --debug
( if [[ -t 1 ]]; then COLOR_DIAGNOSTICS_ARG="COLOR_DIAGNOSTICS=YES"; fi; xcodebuild  `perl -I../../Tools/Scripts -Mwebkitdirs -e 'print XcodeOptionString()' -- ` ${COLOR_DIAGNOSTICS_ARG}  WK_USE_CCACHE=YES -UseNewBuildSystem=YES USE_NEW_BUILD_SYSTEM=YES GCC_PREPROCESSOR_DEFINITIONS=' $(inherited)' | ../../Tools/Scripts/filter-build-webkit && exit ${PIPESTATUS[0]} )
Command line invocation:
User defaults from command line:
^Cmake[2]: *** [debug] Interrupt: 2
make[1]: *** [debug] Interrupt: 2
make: *** [debug] Interrupt: 2


tetsuharu@macbookpro-15-2017:/Volumes/Source/webkit %  rm -rf WebKitBuild                                                                       (git:master)

tetsuharu@macbookpro-15-2017:/Volumes/Source/webkit %  rm -rf WebKitBuild                                                                       (git:master)

tetsuharu@macbookpro-15-2017:/Volumes/Source/webkit %  make debug                                                                               (git:master)
../Tools/Scripts/set-webkit-configuration --debug
perl ../Tools/Scripts/copy-webkitlibraries-to-product-directory
../../Tools/Scripts/set-webkit-configuration --debug
( if [[ -t 1 ]]; then COLOR_DIAGNOSTICS_ARG="COLOR_DIAGNOSTICS=YES"; fi; xcodebuild  `perl -I../../Tools/Scripts -Mwebkitdirs -e 'print XcodeOptionString()' -- ` ${COLOR_DIAGNOSTICS_ARG}  WK_USE_CCACHE=YES -UseNewBuildSystem=YES USE_NEW_BUILD_SYSTEM=YES GCC_PREPROCESSOR_DEFINITIONS=' $(inherited)' | ../../Tools/Scripts/filter-build-webkit && exit ${PIPESTATUS[0]} )
Command line invocation:
User defaults from command line:
note: Using new build system
note: Planning build
note: Constructing build description
CreateBuildDirectory /Volumes/Source/webkit/WebKitBuild (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/bmalloc.hmap (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/bmalloc-own-target-headers.hmap (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/all-product-headers.yaml (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/bmalloc-generated-files.hmap (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/bmalloc-all-non-framework-target-headers.hmap (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/bmalloc-project-headers.hmap (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/bmalloc-all-target-headers.hmap (in target 'bmalloc' from project 'bmalloc')
CompileC Scavenger.o
/Volumes/Source/webkit/Source/bmalloc/../../Tools/ccache/ccache-wrapper: line 26: ccache: command not found
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
Command CompileC failed with a nonzero exit code
CompileC bmalloc.o
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
WriteAuxiliaryFile /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/Objects-normal/x86_64/bmalloc.LinkFileList (in target 'bmalloc' from project 'bmalloc')
CompileC Zone.o
/Volumes/Source/webkit/Source/bmalloc/../../Tools/ccache/ccache-wrapper: line 26: ccache: command not found
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
CompileC ProcessCheck.o
/Volumes/Source/webkit/Source/bmalloc/../../Tools/ccache/ccache-wrapper: line 26: ccache: command not found
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
CompileC PerProcess.o
/Volumes/Source/webkit/Source/bmalloc/../../Tools/ccache/ccache-wrapper: line 26: ccache: command not found
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
Command CompileC failed with a nonzero exit code
CompileC ObjectType.o
/Volumes/Source/webkit/Source/bmalloc/../../Tools/ccache/ccache-wrapper: line 26: ccache: command not found
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
CompileC ObjectTypeTable.o
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
CompileC Mutex.o
warning: Could not read serialized diagnostics file: Cannot Load File: Failed to open diagnostics file (in target 'bmalloc' from project 'bmalloc')
** BUILD FAILED **


The following build commands failed:
	CompileC /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/Objects-normal/x86_64/Scavenger.o /Volumes/Source/webkit/Source/bmalloc/bmalloc/Scavenger.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
	CompileC /Volumes/Source/webkit/WebKitBuild/bmalloc.build/Debug/bmalloc.build/Objects-normal/x86_64/PerProcess.o /Volumes/Source/webkit/Source/bmalloc/bmalloc/PerProcess.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(2 failures)
make[2]: *** [debug] Error 65
make[1]: *** [debug] Error 2
make: *** [debug] Error 2

```
Comment 2 Tetsuharu Ohzeki 2020-05-28 09:10:47 PDT
Created attachment 400470 [details]
Patch

adhoc patch
Comment 3 Tetsuharu Ohzeki 2020-05-28 09:15:37 PDT
Originally, bug 197020 introduced that enabling ccache automatically with Makefile.
Comment 4 Tetsuharu Ohzeki 2020-05-28 09:40:42 PDT
I'm not sure about XCBuild's cleverness on incremental build.

To be honest, I'm not confident whether enabling ccache with XCBuild is nice or not. Thus my patch is just workaround on the environment installed ccache.
Comment 5 Keith Rollin 2020-05-29 10:49:55 PDT
I'm reverting the use of XCBuild for now. I'll keep this issue in mind when we try to re-enable it. In that context, I don't think we need this patch right now.
Comment 6 Tetsuharu Ohzeki 2020-05-29 11:17:09 PDT
(In reply to Keith Rollin from comment #5)
> I'm reverting the use of XCBuild for now. I'll keep this issue in mind when
> we try to re-enable it. In that context, I don't think we need this patch
> right now.

Ah, I see. Thank you for your review.
Comment 7 Keith Rollin 2020-08-12 22:40:36 PDT
The problem here is that XCBuild removes /usr/local/bin from the PATH. I'm checking to see if that's intentional.
Comment 8 Keith Rollin 2020-10-13 21:35:09 PDT
Rather than taking the approach of Ohzeki-san's original patch (which disables ccache under XCBuild), I'll try to look for it in a few well-known places when under XCBuild (or any time `which ccache` can't find anything). If not found, we'll fall back to compiling regularly.
Comment 9 Radar WebKit Bug Importer 2020-10-13 21:35:39 PDT
<rdar://problem/70278783>
Comment 10 Keith Rollin 2020-10-13 21:39:42 PDT
Created attachment 411298 [details]
Patch
Comment 11 David Kilzer (:ddkilzer) 2020-10-14 08:37:21 PDT
Comment on attachment 411298 [details]
Patch

r=me
Comment 12 EWS 2020-10-14 11:03:40 PDT
Committed r268475: <https://trac.webkit.org/changeset/268475>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 411298 [details].