Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

bazel run should run in bazel env working directory #2679

Copy link
Copy link
Open
@cosinequanon

Description

@cosinequanon
Issue body actions

🚀 feature request

Relevant Rules

This is meant to change the behavior of py_binary

Description

Currently if you run a binary with bazel run then the working directory will be the sandboxed bazel directory. This behavior is inconsistent with other implementations, for example in rules_go it is set like this https://github.com/bazel-contrib/rules_go/blob/b60f4475e3d97431318da1a0a81752a8884e6994/go/tools/go_bin_runner/main.go#L250

Describe the solution you'd like

bazel run should use the BUILD_WORKING_DIRECTORY environment variable to set the working directory.

Describe alternatives you've considered

You can do this hack where you add --run_under="cd $PWD &&" to the command but it only works on POSIX systems and you basically have to know the trick to have the command do what you might expect

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.