巴泽尔 无法创建临时文件
bazel Failed to create temporary file
我已经下载了包含 bazel 的 c++ 教程的 git 存储库,我正在尝试编译示例。执行命令bazel build //main:hello-world
时,出现以下错误:
ccache: error: Failed to create temporary file for /home/username/.ccache/tmp/tmp.cpp_stderr: Read-only file system
因此,我尝试了几种操作:sudo bazel
,将权限更改为/.ccache/tmp/文件夹,但没有一个有效。我怎样才能摆脱这个错误?
我在 fedora27 上工作。
此错误的原因是使用了 ccache 并且需要写访问权限 ~/.ccache。请参阅Ondrej的评论:Bazel使用ccache构建C++示例失败
使用 --sandbox_writable_path ~/.ccache 在不禁用沙盒功能的情况下修复了此问题。
使用选项 --strategy=CppCompile=standalone
解决:
bazel build //main:hello-world --strategy=CppCompile=standalone
相关文章:
- 终端不会为C++文件创建.exe文件吗
- 在C++代码中包含opencv时,使用ctypes创建.so文件
- 如何从头开始创建 avi 文件?
- 为什么当我们有常量引用时创建临时对象?
- 在安卓设备上找不到使用 QStandardPath 创建的文件
- 在VS Code中编译C / C ++时如何禁用自动创建EXE文件?
- 如何使用Windows API C++更改已创建的文件夹/目录安全权限
- 用于 Windows 写入临时文件的 mkstemp() 实现
- 如何为多个目录中的多个文件创建生成文件?
- 巴泽尔 无法创建临时文件
- 无法使用tmpfnam在C++中的Windows上创建临时文件
- 无法在所需目录中创建临时文件
- 创建临时文件:无法写入
- 从多个临时文件中创建引用
- SuperpoweredRecorder:不创建临时文件或录制任何音频
- Ofstream在Windows临时目录下创建一个文件
- 创建临时文件的多种方法:每种方法背后的情况是什么?
- 在mac os上创建临时文件时出错
- 如何在c++中创建临时文件来帮助缓存大数据
- 在RAM中创建临时文件,并在Gnuplot中使用它