Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: local tool script #27

Closed
wants to merge 1 commit into from
Closed

Conversation

alexeagle
Copy link
Contributor

We shouldn't assume the working directory is in the repo root. Also allows it to work with --noexperimental_convenience_symlinks

We shouldn't assume the working directory is in the repo root. Also allows it to work with `--noexperimental_convenience_symlinks`
mark-thm added a commit that referenced this pull request Apr 16, 2024
)

It's common for users of multitool to want to run tools in the current working directory. In #26, @alexeagle documented a technique we've used for a while with creating a script and symlinking to it. Our internal copy of this script is a bit more complicated to help avoid expensive calls to Bazel that simple `bazel run` calls don't really need. More refinements have been proposed in #27. All of these things are fundamentally workarounds for bazelbuild/bazel#3325.

To help simplify things, this PR adds a convenience wrapper that captures the execpath, switches to $BUILD_WORKING_DIRECTORY, and then runs the desired tool. The resulting shell script gets to use a very simple `bazel run`, should be compatible across any slew of Bazel options, and cache as well as any typical run target.
@mark-thm
Copy link
Contributor

Simplified this with #29

@mark-thm mark-thm closed this Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants