Skip to content

Binary targets on Windows use --run_under's runfiles manifest if the argument is a rule #10598

@gmishkin

Description

@gmishkin

Description of the problem / feature request:

On Windows only, when using --run_under with an argument that's a binary rule in the workspace (as opposed to some binary from PATH), the binary rule you're actually running with bazel run sees the run under rule's runfiles manifest and not its own.

Of course that manifest doesn't have much of anything in it and so rlocation of an actual data dep of the binary rule fails. It works fine on Mac and Linux.

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

https://github.com/gmishkin/run_under_runfiles

bazel run //:printer

On Linux, it works fine. You see the contents of the data file from the "printer" rule and the "timer" run_under script prints the time it took.

On Windows it fails with cat: '': No such file or directory but you see the timer results from run_under. If you comment out the --run_under line in the .bazelrc you do see the contents of the data file, but not the elapsed time.

What operating system are you running Bazel on?

Windows 10 version 1909

What's the output of bazel info release?

release 2.0.0

Have you found anything relevant by searching the web?

Some stuff about runfiles on Windows but nothing about interaction with --run_under.

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

I'm using --enable_runfiles=yes on Windows but removing that has no effect one way or another.

Metadata

Metadata

Assignees

Labels

P1I'll work on this now. (Assignee required)area-WindowsWindows-specific issues and feature requeststeam-OSSIssues for the Bazel OSS team: installation, release processBazel packaging, websitetype: bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions