{"action":"created","issue":{"url":"https://api.github.com/repos/google/bazel/issues/58","labels_url":"https://api.github.com/repos/google/bazel/issues/58/labels{/name}","comments_url":"https://api.github.com/repos/google/bazel/issues/58/comments","events_url":"https://api.github.com/repos/google/bazel/issues/58/events","html_url":"https://github.com/google/bazel/issues/58","id":64297631,"number":58,"title":"Permission denied when running 'bazel build'","user":{"login":"rbvermaa","id":353885,"avatar_url":"https://avatars.githubusercontent.com/u/353885?v=3","gravatar_id":"","url":"https://api.github.com/users/rbvermaa","html_url":"https://github.com/rbvermaa","followers_url":"https://api.github.com/users/rbvermaa/followers","following_url":"https://api.github.com/users/rbvermaa/following{/other_user}","gists_url":"https://api.github.com/users/rbvermaa/gists{/gist_id}","starred_url":"https://api.github.com/users/rbvermaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbvermaa/subscriptions","organizations_url":"https://api.github.com/users/rbvermaa/orgs","repos_url":"https://api.github.com/users/rbvermaa/repos","events_url":"https://api.github.com/users/rbvermaa/events{/privacy}","received_events_url":"https://api.github.com/users/rbvermaa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-03-25T15:23:31Z","updated_at":"2015-03-25T18:26:12Z","closed_at":null,"body":"When going through the example in the documentation, I am getting the following error while running `bazel build`:\r\n\r\n    $ bazel build my-project:my-runner --verbose_failuresExtracting Bazel installation...\r\n    ......\r\n    INFO: Found 1 target...\r\n    ERROR: /home/rbvermaa/src/bazel/base_workspace/my-project/BUILD:1:1: Creating runfiles tree bazel-out/local_linux-fastbuild/bin/my-project/my-runner.runfiles failed: build-runfiles failed: error executing command \r\n      (cd /home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace && \\\r\n      exec env - \\\r\n      /home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace/_bin/build-runfiles bazel-out/local_linux-fastbuild/bin/my-project/my-runner.runfiles_manifest bazel-out/local_linux-fastbuild/bin/my-project/my-runner.runfiles): com.google.devtools.build.lib.shell.ExecFailedException: java.io.IOException: Cannot run program \"/home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace/_bin/process-wrapper\" (in directory \"/home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace\"): error=13, Permission denied: build-runfiles failed: error executing command \r\n      (cd /home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace && \\\r\n      exec env - \\\r\n      /home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace/_bin/build-runfiles bazel-out/local_linux-fastbuild/bin/my-project/my-runner.runfiles_manifest bazel-out/local_linux-fastbuild/bin/my-project/my-runner.runfiles): com.google.devtools.build.lib.shell.ExecFailedException: java.io.IOException: Cannot run program \"/home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace/_bin/process-wrapper\" (in directory \"/home/rbvermaa/.cache/bazel/_blaze_rbvermaa/ce51c282b5b9dadfc520c685445c68ce/base_workspace\"): error=13, Permission denied.\r\n    Target //my-project:my-runner failed to build\r\n    INFO: Elapsed time: 1.994s, Critical Path: 0.51s\r\n\r\nLooking at the files that bazel is failing on, they seem to lack the executable flag, while in the installation prefix of bazel, they are actually executable.    \r\n    \r\n    $ ll /home/rbvermaa/.cache/bazel/_blaze_rbvermaa/install/c319309e20c3f37a277f6e599681275a/_embedded_binaries/\r\n    total 13488\r\n    -rw-r--r-- 1 rbvermaa users      109 Mar 22  2025 build_interface_so\r\n    -rw-r--r-- 1 rbvermaa users    64181 Mar 22  2025 build-runfiles\r\n    -rw-r--r-- 1 rbvermaa users        0 Mar 22  2025 client_info\r\n    -rw-r--r-- 1 rbvermaa users       33 Mar 22  2025 install_base_key\r\n    -rw-r--r-- 1 rbvermaa users        4 Mar 22  2025 java.version\r\n    -rw-r--r-- 1 rbvermaa users      801 Mar 22  2025 jdk.BUILD\r\n    -rw-r--r-- 1 rbvermaa users      820 Mar 22  2025 jdk.WORKSPACE\r\n    -rw-r--r-- 1 rbvermaa users 13589089 Mar 22  2025 libblaze.jar\r\n    -rw-r--r-- 1 rbvermaa users    94557 Mar 22  2025 libunix.so\r\n    -rw-r--r-- 1 rbvermaa users    19486 Mar 22  2025 namespace-sandbox\r\n    -rw-r--r-- 1 rbvermaa users    14008 Mar 22  2025 process-wrapper\r\n    \r\nThe bazel installation directory looks like:\r\n    \r\n    $ ls -l /nix/store/wl19f5z591zrmrp66mbdjr1zi5z5kdr6-bazel-20150325.9a0dc1b2/share/bazel/\r\n    total 37712\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 actoolzip\r\n    -r-xr-xr-x 1 root nixbld 12367529 Jan  1  1970 bazel\r\n    -r-xr-xr-x 1 root nixbld      167 Jan  1  1970 build_interface_so\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 buildjar\r\n    -r-xr-xr-x 1 root nixbld    64181 Jan  1  1970 build-runfiles\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 bundlemerge\r\n    dr-xr-xr-x 8 root nixbld     4096 Jan  1  1970 classes\r\n    -r-xr-xr-x 1 root nixbld   307789 Jan  1  1970 client\r\n    -r-xr-xr-x 1 root nixbld        0 Jan  1  1970 client_info\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 ibtoolzip\r\n    dr-xr-xr-x 2 root nixbld     4096 Jan  1  1970 ijar\r\n    -r--r--r-- 1 root nixbld       33 Jan  1  1970 install_base_key\r\n    -r--r--r-- 1 root nixbld        4 Jan  1  1970 java.version\r\n    -r--r--r-- 1 root nixbld      801 Jan  1  1970 jdk.BUILD\r\n    -r--r--r-- 1 root nixbld      820 Jan  1  1970 jdk.WORKSPACE\r\n    -r--r--r-- 1 root nixbld 13589089 Jan  1  1970 libblaze.jar\r\n    -r-xr-xr-x 1 root nixbld    94557 Jan  1  1970 libunix.so\r\n    -r--r--r-- 1 root nixbld       58 Jan  1  1970 MANIFEST.MF\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 momczip\r\n    -r-xr-xr-x 1 root nixbld    19486 Jan  1  1970 namespace-sandbox\r\n    dr-xr-xr-x 2 root nixbld     4096 Jan  1  1970 native\r\n    dr-xr-xr-x 2 root nixbld     4096 Jan  1  1970 objs\r\n    -r--r--r-- 1 root nixbld 12059740 Jan  1  1970 package.zip\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 plmerge\r\n    -r-xr-xr-x 1 root nixbld    14008 Jan  1  1970 process-wrapper\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 singlejar\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 src\r\n    dr-xr-xr-x 2 root nixbld     4096 Jan  1  1970 test_classes\r\n    dr-xr-xr-x 3 root nixbld     4096 Jan  1  1970 xcodegen\r\n    \r\n    \r\nOne thing that might be different in my setup is the fact that the installation of bazel is readonly, perhaps that is related?\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/google/bazel/issues/comments/86159412","html_url":"https://github.com/google/bazel/issues/58#issuecomment-86159412","issue_url":"https://api.github.com/repos/google/bazel/issues/58","id":86159412,"user":{"login":"rbvermaa","id":353885,"avatar_url":"https://avatars.githubusercontent.com/u/353885?v=3","gravatar_id":"","url":"https://api.github.com/users/rbvermaa","html_url":"https://github.com/rbvermaa","followers_url":"https://api.github.com/users/rbvermaa/followers","following_url":"https://api.github.com/users/rbvermaa/following{/other_user}","gists_url":"https://api.github.com/users/rbvermaa/gists{/gist_id}","starred_url":"https://api.github.com/users/rbvermaa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rbvermaa/subscriptions","organizations_url":"https://api.github.com/users/rbvermaa/orgs","repos_url":"https://api.github.com/users/rbvermaa/repos","events_url":"https://api.github.com/users/rbvermaa/events{/privacy}","received_events_url":"https://api.github.com/users/rbvermaa/received_events","type":"User","site_admin":false},"created_at":"2015-03-25T18:26:12Z","updated_at":"2015-03-25T18:26:12Z","body":"This is on NixOS, which is a Linux distribution.\r\n\r\n    $ unzip -l /nix/store/wl19f5z591zrmrp66mbdjr1zi5z5kdr6-bazel-20150325.9a0dc1b2/share/bazel/bazel\r\n    Archive:  /nix/store/wl19f5z591zrmrp66mbdjr1zi5z5kdr6-bazel-20150325.9a0dc1b2/share/bazel/bazel\r\n      Length      Date    Time    Name\r\n    ---------  ---------- -----   ----\r\n     13589089  01-01-1980 00:00   libblaze.jar\r\n        94557  01-01-1980 00:00   libunix.so\r\n        64181  01-01-1980 00:00   build-runfiles\r\n        14008  01-01-1980 00:00   process-wrapper\r\n            0  01-01-1980 00:00   client_info\r\n          109  01-01-1980 00:00   build_interface_so\r\n          820  01-01-1980 00:00   jdk.WORKSPACE\r\n          801  01-01-1980 00:00   jdk.BUILD\r\n        19486  01-01-1980 00:00   namespace-sandbox\r\n           33  01-01-1980 00:00   install_base_key\r\n            4  01-01-1980 00:00   java.version\r\n    ---------                     -------\r\n     13783088                     11 files\r\n"}}