You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Encountering "Infinite symlink expansion" when integrating an external cmake project which has symlink.
ERROR: infinite symlink expansion detected
[start of symlink chain]
/Users/taiyuanz/Projects/faiss/faiss
/Users/taiyuanz/Projects/faiss
[end of symlink chain]
ERROR: Skipping '@faiss_lib//:faiss_lib': no such package '@faiss_lib//': Infinite symlink expansion
WARNING: Target pattern parsing failed.
ERROR: no such package '@faiss_lib//': Infinite symlink expansion
INFO: Elapsed time: 0.059s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Fetching @faiss_lib; Restarting.
I was expecting Bazel to be able to work around this symlink because cmake can handle it pretty well.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
The external project is https://github.com/facebookresearch/faiss. You can do a git clone to have a copy locally. Then you can follow the instruction on INSTALL.md to do ./configure and then make
You can see the in the root of the project folder there's a symlink "faiss/ -> ./". This allows the developers of FAISS to write code like "#include <faiss/IndexFlat.h>" etc, even though IndexFlat.h is actually under the root directory
To reproduce using bazel, we just need the following simple files:
WORKSPACE
# File //:WORKSPACE
workspace(name = "faiss_server")
# External libraries that don't use bazel.
new_local_repository(
name = "faiss_lib",
path = "/Users/taiyuanz/Projects/faiss/",
build_file_content = """
cc_library(
name = "faiss_lib",
srcs = glob(
["*.o", "*.h"]
),
visibility = ["//visibility:public"],
)
"""
)
Then you just run
bazel build @faiss_lib//:faiss_lib
Then you will see
ERROR: infinite symlink expansion detected
[start of symlink chain]
/Users/taiyuanz/Projects/faiss/faiss
/Users/taiyuanz/Projects/faiss
[end of symlink chain]
ERROR: Skipping '@faiss_lib//:faiss_lib': no such package '@faiss_lib//': Infinite symlink expansion
WARNING: Target pattern parsing failed.
ERROR: no such package '@faiss_lib//': Infinite symlink expansion
INFO: Elapsed time: 0.059s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded)
Fetching @faiss_lib; Restarting.
What operating system are you running Bazel on?
Mac OS X Catalina
What's the output of bazel info release?
release 2.0.0
Have you found anything relevant by searching the web?
I have checked various discussions but haven't found anything similar to this issue.
Any other information, logs, or outputs that you want to share?
Not yet.
The text was updated successfully, but these errors were encountered:
Hi @firstprayer, the reported problem describes Bazel designed behavior: recursive symlinks are not allowed. Bazel expands symlinks to track file changes for accurate incremental builds.
Similar problem: #2927
Description of the problem / feature request:
Encountering "Infinite symlink expansion" when integrating an external cmake project which has symlink.
I was expecting Bazel to be able to work around this symlink because cmake can handle it pretty well.
Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
WORKSPACE
Then you just run
Then you will see
What operating system are you running Bazel on?
Mac OS X Catalina
What's the output of
bazel info release
?release 2.0.0
Have you found anything relevant by searching the web?
I have checked various discussions but haven't found anything similar to this issue.
Any other information, logs, or outputs that you want to share?
Not yet.
The text was updated successfully, but these errors were encountered: