rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.79k stars 314 forks source link

Strip ccache from "arguments" in compilation database #369

Closed d closed 3 years ago

d commented 3 years ago

Describe the bug I have a Makefile project (Postgres) where I've configured with CC="ccache clang-11" CXX="ccache clang++-11" and bear produces a compilation database that uses ccache as the command name. A snippet of such compilation database looks like the following:

  {
    "arguments": [
      "/usr/bin/ccache",
      "clang-11",
      "-Wall",
      "-Wmissing-prototypes",
      "-Wpointer-arith",
      "-Werror=vla",
      "-Wendif-labels",
      "-Wmissing-format-attribute",
      "-Wformat-security",
      "-fno-strict-aliasing",
      "-fwrapv",
      "-Wno-unused-command-line-argument",
      "-g",
      "-O0",
      "-Werror=uninitialized",
      "-Werror=implicit-function-declaration",
      "-DFRONTEND",
      "-I.",
      "-I../../src/common",
      "-I../../src/include",
      "-D_GNU_SOURCE",
      "-I/home/pivotal/.opt/xerces/include",
      "-DVAL_CONFIGURE=\"'--cache-file' 'clang11.cache' '--enable-depend' '--enable-debug' '--enable-cassert' '--enable-orca' '--with-openssl' '--disable-gpfdist' '--disable-gpcloud' '--disable-pxf' '--without-libcurl' '--with-libs=/home/pivotal/.opt/xerces/lib' '--with-includes=/home/pivotal/.opt/xerces/include' 'CC=ccache clang-11' 'CXX=ccache clang++-11' 'CFLAGS=-O0' 'CXXFLAGS=-O0' 'LDFLAGS=-fuse-ld=lld' 'PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig'\"",
      "-DVAL_CC=\"ccache clang-11\"",
      "-DVAL_CPPFLAGS=\"-D_GNU_SOURCE -I/home/pivotal/.opt/xerces/include\"",
      "-DVAL_CFLAGS=\"-Wall -Wmissing-prototypes -Wpointer-arith -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -Wno-unused-command-line-argument -g -O0 -Werror=uninitialized -Werror=implicit-function-declaration\"",
      "-DVAL_CFLAGS_SL=\"-fPIC\"",
      "-DVAL_LDFLAGS=\"-fuse-ld=lld -L/home/pivotal/.opt/xerces/lib -Wl,--as-needed -Wl,-rpath,'/usr/local/gpdb/lib',--enable-new-dtags\"",
      "-DVAL_LDFLAGS_EX=\"\"",
      "-DVAL_LDFLAGS_SL=\"\"",
      "-DVAL_LIBS=\"-lpgcommon -lpgport -lpthread -lxerces-c -lbz2 -lrt -lssl -lcrypto -lz -lreadline -lrt -lcrypt -ldl -lm  -lzstd\"",
      "-c",
      "-o",
      "base64.o",
      "base64.c"
    ],
    "directory": "/home/pivotal/src/pvtl/gpdb/src/common",
    "file": "/home/pivotal/src/pvtl/gpdb/src/common/base64.c",
    "output": "/home/pivotal/src/pvtl/gpdb/src/common/base64.o"

To Reproduce

  1. Create a small file cc.cc with content: int main(){}
  2. bear -- make CXX="ccache clang++-11" cc.o
  3. cat compile_commands.json

Actual behavior

[
  {
    "arguments": [
      "/usr/bin/ccache",
      "clang++-11",
      "-c",
      "-o",
      "cc.o",
      "cc.cc"
    ],
    "directory": "/tmp/tmp.vPnYUAQe7g",
    "file": "/tmp/tmp.vPnYUAQe7g/cc.cc",
    "output": "/tmp/tmp.vPnYUAQe7g/cc.o"
  }
]

Expected behavior

[
  {
    "arguments": [
      "clang++-11",
      "-c",
      "-o",
      "cc.o",
      "cc.cc"
    ],
    "directory": "/tmp/tmp.vPnYUAQe7g",
    "file": "/tmp/tmp.vPnYUAQe7g/cc.cc",
    "output": "/tmp/tmp.vPnYUAQe7g/cc.o"
  }
]

Environment:

Context Such a compilation database is actually not usable in CLion as the command is not a compiler. Bear used to strip away the ccache wrapper, but we seem to have changed behavior here. Would you take patches? Where should I start?

Additional context

[20:08:12.885847, wr, 737437, ppid: 737432] succeeded with: 0
[20:08:12.885935, el, 737437] lib.cc; on_unload
[20:08:12.887308, ic, 737432] Process wait request: done. [pid: 737437]
[20:08:12.887420, ic, 737432] Running command. [Exited with 0]
[20:08:12.887445, ic, 737432] Stopping gRPC server.
[20:08:12.887799, ic, 737432] succeeded with: 0
[20:08:12.889098, br, 737431] Process wait request: done. [pid: 737432]
[20:08:12.889178, br, 737431] Running intercept finished. [Exited with 0]
[20:08:12.889600, br, 737431] Process spawned. [pid: 737465, command: [/usr/bin/citnames, --input, compile_commands.sqlite3, --output, compile_commands.json, --run-checks, --verbose]]
[20:08:12.889684, br, 737431] Process wait requested. [pid: 737465]
[20:08:12.898409, cs, 737465] citnames: 3.0.8
[20:08:12.898476, cs, 737465] arguments: ["/usr/bin/citnames", "--input", "compile_commands.sqlite3", "--output", "compile_commands.json", "--run-checks", "--verbose"]
[20:08:12.898499, cs, 737465] environment: ["COLORTERM=truecolor", "DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1001/bus", "DEFAULTS_PATH=/usr/share/gconf/ubuntu-xorg.default.path", "DESKTOP_MODE=1", "DESKTOP_SESSION=ubuntu-xorg", "DISPLAY=:0", "EDITOR=gvim -f", "GDMSESSION=ubuntu-xorg", "GNOME_DESKTOP_SESSION_ID=this-is-deprecated", "GNOME_SHELL_SESSION_MODE=ubuntu", "GNOME_TERMINAL_SCREEN=/org/gnome/Terminal/screen/5b8e417d_21b6_4549_8945_d88f17826b16", "GNOME_TERMINAL_SERVICE=:1.152", "GPG_AGENT_INFO=/run/user/1001/gnupg/S.gpg-agent:0:1", "GTK2_MODULES=overlay-scrollbar", "GTK_MODULES=gail:atk-bridge", "HOME=/home/pivotal", "IM_CONFIG_PHASE=1", "LANG=en_US.UTF-8", "LOGNAME=pivotal", "LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:", "MANDATORY_PATH=/usr/share/gconf/ubuntu-xorg.mandatory.path", "PATH=/home/pivotal/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin", "PWD=/tmp/tmp.vPnYUAQe7g", "QT_ACCESSIBILITY=1", "QT_IM_MODULE=ibus", "QT_QPA_PLATFORMTHEME=appmenu-qt5", "SESSION_MANAGER=local/jzhang-Precision-5520:@/tmp/.ICE-unix/11638,unix/jzhang-Precision-5520:/tmp/.ICE-unix/11638", "SHELL=/bin/bash", "SHLVL=1", "SSH_AGENT_LAUNCHER=gnome-keyring", "SSH_AUTH_SOCK=/run/user/1001/keyring/ssh", "TERM=xterm-256color", "USER=pivotal", "USERNAME=pivotal", "VTE_VERSION=6203", "WINDOWPATH=3", "XAUTHORITY=/run/user/1001/gdm/Xauthority", "XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu-xorg:/etc/xdg", "XDG_CURRENT_DESKTOP=ubuntu:GNOME", "XDG_DATA_DIRS=/usr/share/ubuntu-xorg:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/var/lib/snapd/desktop", "XDG_MENU_PREFIX=gnome-", "XDG_RUNTIME_DIR=/run/user/1001", "XDG_SESSION_CLASS=user", "XDG_SESSION_DESKTOP=ubuntu-xorg", "XDG_SESSION_TYPE=x11", "XMODIFIERS=@im=ibus"]
[20:08:12.898521, cs, 737465] sysname: Linux
[20:08:12.898527, cs, 737465] release: 5.11.0-13-generic
[20:08:12.898532, cs, 737465] version: #14-Ubuntu SMP Fri Mar 19 16:55:27 UTC 2021
[20:08:12.898537, cs, 737465] machine: x86_64
[20:08:12.898545, cs, 737465] arguments parsed: {program: /usr/bin/citnames, arguments: [{--input: [compile_commands.sqlite3]}, {--output: [compile_commands.json]}, {--run-checks: []}, {--verbose: []}]}
[20:08:12.898630, cs, 737465] Configuration: {"compilation":null,"output":{"content":{"include_only_existing_source":true},"format":{"command_as_array":true,"drop_output_field":false}}}
[20:08:12.900983, cs, 737465] [pid: 737442] execution: {"executable":"/usr/bin/make","arguments":["make","CXX=ccache clang++-11","cc.o"],"workingDir":"/tmp/tmp.vPnYUAQe7g","environment":{"SHELL":"/bin/bash","PATH":"/home/pivotal/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin","XDG_CURRENT_DESKTOP":"ubuntu:GNOME","QT_ACCESSIBILITY":"1","XDG_DATA_DIRS":"/usr/share/ubuntu-xorg:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/var/lib/snapd/desktop","GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","GTK2_MODULES":"overlay-scrollbar","DESKTOP_MODE":"1","XDG_SESSION_TYPE":"x11","INTERCEPT_VERBOSE":"true","XDG_SESSION_CLASS":"user","QT_QPA_PLATFORMTHEME":"appmenu-qt5","INTERCEPT_REPORT_DESTINATION":"127.0.0.1:34431","GNOME_SHELL_SESSION_MODE":"ubuntu","GNOME_TERMINAL_SERVICE":":1.152","SESSION_MANAGER":"local/jzhang-Precision-5520:@/tmp/.ICE-unix/11638,unix/jzhang-Precision-5520:/tmp/.ICE-unix/11638","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","XMODIFIERS":"@im=ibus","GTK_MODULES":"gail:atk-bridge","IM_CONFIG_PHASE":"1","XDG_RUNTIME_DIR":"/run/user/1001","GPG_AGENT_INFO":"/run/user/1001/gnupg/S.gpg-agent:0:1","EDITOR":"gvim -f","SSH_AGENT_LAUNCHER":"gnome-keyring","USERNAME":"pivotal","LD_PRELOAD":"/usr/lib/x86_64-linux-gnu/bear/libexec.so","GNOME_TERMINAL_SCREEN":"/org/gnome/Terminal/screen/5b8e417d_21b6_4549_8945_d88f17826b16","LOGNAME":"pivotal","SSH_AUTH_SOCK":"/run/user/1001/keyring/ssh","VTE_VERSION":"6203","HOME":"/home/pivotal","COLORTERM":"truecolor","GDMSESSION":"ubuntu-xorg","TERM":"xterm-256color","XDG_MENU_PREFIX":"gnome-","INTERCEPT_REPORT_COMMAND":"/usr/lib/x86_64-linux-gnu/bear/wrapper","WINDOWPATH":"3","XAUTHORITY":"/run/user/1001/gdm/Xauthority","SHLVL":"1","QT_IM_MODULE":"ibus","LS_COLORS":"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:","DISPLAY":":0","LANG":"en_US.UTF-8","PWD":"/tmp/tmp.vPnYUAQe7g","USER":"pivotal","DEFAULTS_PATH":"/usr/share/gconf/ubuntu-xorg.default.path","DESKTOP_SESSION":"ubuntu-xorg","MANDATORY_PATH":"/usr/share/gconf/ubuntu-xorg.mandatory.path","XDG_CONFIG_DIRS":"/etc/xdg/xdg-ubuntu-xorg:/etc/xdg","XDG_SESSION_DESKTOP":"ubuntu-xorg"}}
[20:08:12.901723, cs, 737465] [pid: 737442] failed: No tools recognize this execution.
[20:08:12.901844, cs, 737465] [pid: 737447] execution: {"executable":"/usr/bin/ccache","arguments":["ccache","clang++-11","-c","-o","cc.o","cc.cc"],"workingDir":"/tmp/tmp.vPnYUAQe7g","environment":{"GNOME_DESKTOP_SESSION_ID":"this-is-deprecated","GTK2_MODULES":"overlay-scrollbar","DESKTOP_MODE":"1","XDG_SESSION_TYPE":"x11","INTERCEPT_VERBOSE":"true","XDG_SESSION_CLASS":"user","QT_QPA_PLATFORMTHEME":"appmenu-qt5","INTERCEPT_REPORT_DESTINATION":"127.0.0.1:34431","GNOME_SHELL_SESSION_MODE":"ubuntu","GNOME_TERMINAL_SERVICE":":1.152","SESSION_MANAGER":"local/jzhang-Precision-5520:@/tmp/.ICE-unix/11638,unix/jzhang-Precision-5520:/tmp/.ICE-unix/11638","DBUS_SESSION_BUS_ADDRESS":"unix:path=/run/user/1001/bus","XMODIFIERS":"@im=ibus","GTK_MODULES":"gail:atk-bridge","IM_CONFIG_PHASE":"1","XDG_RUNTIME_DIR":"/run/user/1001","MFLAGS":"","GPG_AGENT_INFO":"/run/user/1001/gnupg/S.gpg-agent:0:1","EDITOR":"gvim -f","SSH_AGENT_LAUNCHER":"gnome-keyring","USERNAME":"pivotal","LD_PRELOAD":"/usr/lib/x86_64-linux-gnu/bear/libexec.so","GNOME_TERMINAL_SCREEN":"/org/gnome/Terminal/screen/5b8e417d_21b6_4549_8945_d88f17826b16","LOGNAME":"pivotal","MAKEFLAGS":" -- CXX=ccache\\ clang++-11","CXX":"ccache clang++-11","SSH_AUTH_SOCK":"/run/user/1001/keyring/ssh","VTE_VERSION":"6203","HOME":"/home/pivotal","COLORTERM":"truecolor","XDG_MENU_PREFIX":"gnome-","GDMSESSION":"ubuntu-xorg","TERM":"xterm-256color","INTERCEPT_REPORT_COMMAND":"/usr/lib/x86_64-linux-gnu/bear/wrapper","XAUTHORITY":"/run/user/1001/gdm/Xauthority","WINDOWPATH":"3","SHLVL":"1","QT_IM_MODULE":"ibus","LS_COLORS":"rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:","DISPLAY":":0","MAKEOVERRIDES":"${-*-command-variables-*-}","LANG":"en_US.UTF-8","PWD":"/tmp/tmp.vPnYUAQe7g","USER":"pivotal","DEFAULTS_PATH":"/usr/share/gconf/ubuntu-xorg.default.path","DESKTOP_SESSION":"ubuntu-xorg","MANDATORY_PATH":"/usr/share/gconf/ubuntu-xorg.mandatory.path","XDG_CONFIG_DIRS":"/etc/xdg/xdg-ubuntu-xorg:/etc/xdg","MAKELEVEL":"1","XDG_SESSION_DESKTOP":"ubuntu-xorg","SHELL":"/bin/bash","MAKE_TERMERR":"/dev/pts/0","PATH":"/home/pivotal/.rbenv/shims:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin","MAKE_TERMOUT":"/dev/pts/0","XDG_CURRENT_DESKTOP":"ubuntu:GNOME","QT_ACCESSIBILITY":"1","XDG_DATA_DIRS":"/usr/share/ubuntu-xorg:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop:/var/lib/snapd/desktop"}}
[20:08:12.901870, cs, 737465] [pid: 737447] recognized with: distcc
[20:08:12.901915, cs, 737465] [pid: 737447] recognized as: [Compile { source: "/tmp/tmp.vPnYUAQe7g/cc.cc", output: "/tmp/tmp.vPnYUAQe7g/cc.o", flags: [/usr/bin/ccache, clang++-11, -c, -o, cc.o, cc.cc] }]
[20:08:12.901960, cs, 737465] compilation entries created. [size: 1]
[20:08:12.901968, cs, 737465] compilation entries to output. [size: 1]
[20:08:12.902108, cs, 737465] compilation entries written. [size: 1]
[20:08:12.902155, cs, 737465] succeeded with: 0
[20:08:12.902828, br, 737431] Process wait request: done. [pid: 737465]
[20:08:12.902880, br, 737431] Running citnames finished. [Exited with 0]
[20:08:12.902961, br, 737431] succeeded with: 0
rizsotto commented 3 years ago

Thanks @d for the report. Quick questions,

d commented 3 years ago
  • Do you expect that Bear always strips the ccache away from the result? Or it could be scenarios when it is useful to have it?

I do want to always strip it. My main uses of the compilation database are:

  1. clang tooling: this is ok, Clang has hard coded detection of "ccache"
  2. CLion: this is not quite OK. Interesting to see JetBrains sponsoring this project though
rizsotto commented 3 years ago

Thanks for the feedback. I'll try to make the change for the next release.

JetBrains supports open source projects by giving licenses to their tools. (I would not call it "sponsoring".) Neither I have been contacted from JetBrain to work on particular feature of Bear... But you can support the project if you like it via GitHub. ;)