Skip to content
New issue

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

bazel-complete fails due to ccache #21978

Closed
waarmond opened this issue Apr 11, 2024 · 1 comment
Closed

bazel-complete fails due to ccache #21978

waarmond opened this issue Apr 11, 2024 · 1 comment
Labels
team-Performance Issues for Performance teams type: bug untriaged

Comments

@waarmond
Copy link

waarmond commented Apr 11, 2024

Description of the bug:

The bazel-complete.bash step at my 7.1.1 build (Python 3.10, Arch-derivative) fails due to a read-only ccache folder.
Disabling !ccache had no effect on the build:

INFO: Analyzed target //scripts:bazel-complete.bash (485 packages loaded, 10582 targets configured).
ERROR: ./bazel/src/src/main/tools/BUILD:3:10: Compiling src/main/tools/daemonize.c [for tool] failed: (Exit 1): gcc failed: error executing CppCompile command (from target //src/main/tools:daemonize) /usr/lib/ccache/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections ... (remaining 23 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
ccache: error: Failed to create temporary file for ~/.ccache/tmp/daemonize.stdout: Read-only file system

Next build - strings.cc first:
Compiling src/main/cpp/util/strings.cc [..] ccache: error: Failed to create temporary file for ~/.ccache/tmp/strings.stdout: Read-only file system

As far as I know ccache 4.0 has made stored and fetched object files read-only. When I override this with chmod -R 777 it is sadly getting changed back.

Which category does this issue belong to?

No response

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

./compile.sh
./output/bazel build scripts:bazel-complete.bash

Which operating system are you running Bazel on?

ArchLinux

What is the output of bazel info release?

N/A: build issue

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

using bazel-7.1.1-dist.zip

Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

No response

@satyanandak satyanandak added the team-Rules-CPP Issues for C++ rules label Apr 12, 2024
@comius comius added team-Performance Issues for Performance teams and removed team-Rules-CPP Issues for C++ rules labels May 3, 2024
@tjgq
Copy link
Contributor

tjgq commented May 14, 2024

There's nothing in Bazel that uses ccache. My guess is that you have ccache enabled through an environment variable, but it doesn't work because Bazel runs the C compiler in a sandboxed environment, where the location ccache wants to output to isn't writable.

Can you try building with ccache disabled?

@tjgq tjgq closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Performance Issues for Performance teams type: bug untriaged
Projects
None yet
Development

No branches or pull requests

6 participants