bazelbuild / bazelbuild/bazel

Dangling symlinks with build without bytes minimal

Open
#25,894 7 comments 0 reactions 0 assignees View on GitHub
team-Core type: bug untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 18h
Merged PRs (30d)
75

Description

### Description of the bug:

I switched our builds to use remote download minimal option in our CI's. I am seeing a particular run target consistently fail. The error shows up as missing swig shared library files, which causes the python target to fail with **ModuleNotFoundError**.

In the runfiles directory, the files exist as dangling symlinks. I was able to find almost 800 files that are dangling.

```sh
$ bazel clean
$ bazel build //regression_tests
$ bazel run //python_binary <---- Fails

$ bazel clean
$ bazel build //regression_tests
$ bazel shutdown
$ bazel run //python_binary <---- Works

$ bazel clean
$ bazel run //python_binary <---- Works
```

We have `experimental_check_output_files` flag set, removing this flag also seems to fix the issue.
```sh
$ bazel clean
$ bazel build //regression_tests
$ bazel run //python_binary <---- Works
```

### Which category does this issue belong to?

Local Execution

### What is the output of `bazel info release`?

8.1.0

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the sequence involving //regression_tests and //python_binary with remote-download minimal and experimental_check_output_files enabled. Inspect the runfiles directory for dangling symlinks and compare runs with bazel shutdown or the flag removed; done means the Python target runs without missing SWIG libraries or dangling output links.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.