bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23.13k stars 4.05k forks source link

cannot create symbolic link bazel-out Executing Bazel from exfat drive #17750

Closed Starkiller4011 closed 1 month ago

Starkiller4011 commented 1 year ago

Description of the bug:

I am working from a Manjaro install that has an exfat drive mounted to /proj with a umask of 0000. This drive must be exfat so that it can be shared between a Windows and Linux installation. I have a simple single file C++ project on this drive that will build and run when using bazel build //app:foo and bazel run //app:foo but when building, bazel is unable to create the symbolic links and I get the following warning:

WARNING: failed to create one or more convenience symlinks for prefix 'bazel-':
  cannot create symbolic link bazel-bin -> /home/foo/.cache/bazel/_bazel_foo/3191cbbdbbf17473932a749ffe343e4d/execroot/foo/bazel-out/k8-fastbuild/bin:  /proj/foo/foo/bazel-bin (Operation not permitted)
  cannot create symbolic link bazel-testlogs -> /home/foo/.cache/bazel/_bazel_foo/3191cbbdbbf17473932a749ffe343e4d/execroot/foo/bazel-out/k8-fastbuild/testlogs:  /proj/foo/foo/bazel-testlogs (Operation not permitted)
  cannot create symbolic link bazel-out -> /home/foo/.cache/bazel/_bazel_foo/3191cbbdbbf17473932a749ffe343e4d/execroot/foo/bazel-out:  /proj/foo/foo/bazel-out (Operation not permitted)
  cannot create symbolic link bazel-foo -> /home/foo/.cache/bazel/_bazel_foo/3191cbbdbbf17473932a749ffe343e4d/execroot/foo:  /proj/foo/foo/bazel-foo (Operation not permitted)

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

  1. Install Manjaro Linux
  2. Install base-devel package from official community repo
  3. Install bazel package from official community repo
  4. Make proj directory at root and set permissions: sudo mkdir /proj && sudo chmod 777 /proj
  5. Add fstab entry for exfat formatted second drive: UUID=UUIDSTRING /proj exfat defaults,nofail,umask=0000 0 0
  6. Restart system
  7. Create simple C++ bazel hello world project on /proj
  8. Build hello world project bazel build //app:HelloWorld

Which operating system are you running Bazel on?

Manjaro

What is the output of bazel info release?

release 6.0.0

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 master; git rev-parse HEAD ?

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Have you found anything relevant by searching the web?

No response

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

No response

sgowroji commented 1 year ago

Hi @Starkiller4011, Can you provide an example code to reproduce the above error. Thanks!

Starkiller4011 commented 1 year ago

Here is the project I used to see if the bug was related to my code or was something else. This also produces the same issue. It is worth noting that the issue only happens when running bazel from the mounted exfat drive.

|- WORKSPACE.bazel
|- app
|   |- HelloWorld.cpp
|   |- BUILD.bazel

WORKSPACE.bazel:

workspace(name = "HelloWorld")
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")

git_repository(
    name = "gtest",
    remote = "https://github.com/google/googletest",
    branch = "main",
)

app/BUILD.bazel:

load("@rules_cc//cc:defs.bzl", "cc_binary")

cc_binary(
    name = "HelloWorld",
    srcs = ["HelloWorld.cpp"],
)

app/HelloWorld.cpp:

#include <cstdlib>
#include <iostream>

int main(int argc, char** argv) {
    std::cout << "Hello World\n";
    return EXIT_SUCCESS;
}
github-actions[bot] commented 4 months ago

Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 1+ years. It will be closed in the next 90 days unless any other activity occurs. If you think this issue is still relevant and should stay open, please post any comment here and the issue will no longer be marked as stale.

github-actions[bot] commented 1 month ago

This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please post @bazelbuild/triage in a comment here and we'll take a look. Thanks!