bazelbuild / bazelbuild/bazel

runfiles.bash allows directories for RUNFILES_DIR

Open
#18,520 8 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 20h
Merged PRs (30d)
72

Description

### Description of the bug:

runfiles.bash allows directories ~~if they are symlinks~~ if RUNFILES_DIR is used, but not RUNFILES_MANIFEST_FILE. I think that this is a bug, and it makes sandbox builds of certain things succeed while they fail outside the sandbox (as linux-sandbox uses RUNFILES_DIR, while local uses RUNFILES_MANIFEST_FILE).

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

I can create a simple example if anyone has trouble reproducing this, but I think that it should be simple to do. Using the linux-sandbox with a file input (and then trying rlocation on its directory) is an easy way to reproduce this issue.

### Which operating system are you running Bazel on?

Linux

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

release 6.1.2

### 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` ?

_No response_

### Is this a regression? If yes, please try to identify the Bazel commit where the bug was introduced.

I don't think so.

### Have you found anything relevant by searching the web?

_No response_

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

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with a file input under the linux-sandbox and calling rlocation on its directory. Compare how runfiles.bash handles RUNFILES_DIR and RUNFILES_MANIFEST_FILE; the fix is complete when directory behavior is consistent in both modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
bash, linux
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.