We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cc toolchain is not correctly generated when using ccache with clang, while ccache with gcc works.
chenhao@chenhao:~/bazel-ccache$ cat WORKSPACE chenhao@chenhao:~/bazel-ccache$ cat BUILD cc_binary( name = "hello", srcs = ["hello.cc"], ) chenhao@chenhao:~/bazel-ccache$ cat hello.cc int main() { return 0; } chenhao@chenhao:~/bazel-ccache$ ls -alh tools total 8.0K drwxrwxr-x 2 chenhao chenhao 4.0K May 19 20:08 . drwxrwxr-x 3 chenhao chenhao 4.0K May 19 20:10 .. lrwxrwxrwx 1 chenhao chenhao 15 May 19 20:08 clang-12 -> /usr/bin/ccache lrwxrwxrwx 1 chenhao chenhao 15 May 19 20:08 gcc-10 -> /usr/bin/ccache chenhao@chenhao:~/bazel-ccache$ which ccache /usr/bin/ccache chenhao@chenhao:~/bazel-ccache$ which clang-12 /usr/bin/clang-12 chenhao@chenhao:~/bazel-ccache$ which gcc-10 /usr/bin/gcc-10 chenhao@chenhao:~/bazel-ccache$ CC=$(pwd)/tools/gcc-10 bazel build --sandbox_writable_path=$HOME/.ccache :all INFO: Analyzed target //:hello (1 packages loaded, 12 targets configured). INFO: Found 1 target... Target //:hello up-to-date: bazel-bin/hello INFO: Elapsed time: 1.512s, Critical Path: 0.04s INFO: 3 processes: 2 internal, 1 linux-sandbox. INFO: Build completed successfully, 3 total actions chenhao@chenhao:~/bazel-ccache$ CC=$(pwd)/tools/clang-12 bazel build --sandbox_writable_path=$HOME/.ccache :all INFO: Analyzed target //:hello (1 packages loaded, 12 targets configured). INFO: Found 1 target... ERROR: /home/chenhao/bazel-ccache/BUILD:1:10: Compiling hello.cc failed: (Exit 1): ccache failed: error executing command /usr/bin/ccache -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer '-std=c++0x' -MD ... (remaining 21 arguments skipped) Use --sandbox_debug to see verbose messages from the sandbox /usr/bin/ccache: invalid option -- 'U' Usage: ccache [options] ...
Ubuntu 20.04
bazel info release
release 5.1.0. I also tried other 5.x and the latest 6.0-pre, all broken. 4.x does not have this issue.
I don't specify the rules_cc version by myself. My WORKSPACE is empty.
See the "bugs" section
The text was updated successfully, but these errors were encountered:
Generate ccache wrapper scripts instead of symlink
af99a3f
Tested with Bazel 5.2. It is a workaround for issue bazelbuild/rules_cc#130
8849886
883a1bf
Generate ccache wrapper scripts instead of symlink (#39)
fee58b9
No branches or pull requests
Description of the problem / feature request:
cc toolchain is not correctly generated when using ccache with clang, while ccache with gcc works.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
What operating system are you running Bazel on?
Ubuntu 20.04
What's the output of
bazel info release
?release 5.1.0. I also tried other 5.x and the latest 6.0-pre, all broken. 4.x does not have this issue.
What version of rules_cc do you use? Can you paste the workspace rule used to fetch rules_cc? What other relevant dependencies does your project have?
I don't specify the rules_cc version by myself. My WORKSPACE is empty.
What Bazel options do you use to trigger the issue? What C++ toolchain do you use?
See the "bugs" section
The text was updated successfully, but these errors were encountered: