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

local Prerelease/release jobs fail if ~/.ccache doesnt exist on the host before running the scripts #695

Closed
mikaelarguedas opened this issue Dec 19, 2019 · 1 comment · Fixed by #696
Labels

Comments

@mikaelarguedas
Copy link
Contributor

Running prerelease job on Bionic (and Xenial) fails if the directory ~/.ccache doesnt exist on the host machine

When trying to mount the volume the folder is created as root. But the docker container is using a non-root user causing this error to appear.

ccache: error: Failed to create directory /home/buildfarm/.ccache/tmp: Permission denied
full error message
==> cmake /tmp/ws/src/roscpp_core/cpp_common -DCATKIN_DEVEL_PREFIX=/tmp/ws/devel_isolated/cpp_common -DCMAKE_INSTALL_PREFIX=/tmp/ws/install_isolated -DBUILD_TESTING=0 -DCATKIN_SKIP_TESTING=1 -G Unix Makefiles in '/tmp/ws/build_isolated/cpp_common'
-- The C compiler identification is GNU 7.4.0
-- The CXX compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- broken
CMake Error at /usr/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
  The C compiler

    "/usr/lib/ccache/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /tmp/ws/build_isolated/cpp_common/CMakeFiles/CMakeTmp
    
    Run Build Command:"/usr/bin/make" "cmTC_4192b/fast"
    /usr/bin/make -f CMakeFiles/cmTC_4192b.dir/build.make CMakeFiles/cmTC_4192b.dir/build
    make[1]: Entering directory '/tmp/ws/build_isolated/cpp_common/CMakeFiles/CMakeTmp'
    Building C object CMakeFiles/cmTC_4192b.dir/testCCompiler.c.o
    /usr/lib/ccache/cc    -o CMakeFiles/cmTC_4192b.dir/testCCompiler.c.o   -c /tmp/ws/build_isolated/cpp_common/CMakeFiles/CMakeTmp/testCCompiler.c
    ccache: error: Failed to create directory /home/buildfarm/.ccache/tmp: Permission denied
    CMakeFiles/cmTC_4192b.dir/build.make:65: recipe for target 'CMakeFiles/cmTC_4192b.dir/testCCompiler.c.o' failed
    make[1]: *** [CMakeFiles/cmTC_4192b.dir/testCCompiler.c.o] Error 1
    make[1]: Leaving directory '/tmp/ws/build_isolated/cpp_common/CMakeFiles/CMakeTmp'
    Makefile:126: recipe for target 'cmTC_4192b/fast' failed
    make: *** [cmTC_4192b/fast] Error 2
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

How to reproduce:

sudo mv ~/.ccache ~/.ccache_old
mkdir -p /tmp/prerelease_ccache_bug && cd /tmp/prerelease_ccache_bug
generate_prerelease_script.py   https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml   melodic default ubuntu bionic amd64   roscpp_core   --level 0   --output-dir ./
./prerelease.sh
sudo mv ~/.ccache_old ~/.ccache

Same failure appears with release jobs

@Affonso-Gui
Copy link

Was still having this problem a few years later. In my case, the .ccache existed but was owned by root.

Solved by changing the ownership, as pointed out in:
https://answers.ros.org/question/347063/error-pre-release-melodic/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants