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

Executable shell script isn't runnable from repository root #110

Open
simontoens opened this issue Apr 21, 2021 · 1 comment
Open

Executable shell script isn't runnable from repository root #110

simontoens opened this issue Apr 21, 2021 · 1 comment

Comments

@simontoens
Copy link
Contributor

The springboot rule is_executable. During the build phase, the springboot rule generates a shell script, which bazel then calls when the user invokes "bazel run". Sometimes, for debugging, it is useful to be able to run this shell script by itself. This doesn't work from the repository root - instead the current directory has to be "bazel-bin". This doesn't match the behavior of other shell scripts generated by rules that are executable - they are typically runnable from the repo root.

For example, assuming this target is the springboot rule target: projects/services/myservice:myservice

This doesn't work (from the repo root):
bazel-bin/projects/services/myservice/myservice

This does work, but it is less convenient:
cd bazel-bin && projects/services/myservice/myservice

@drmercer-lucid
Copy link
Contributor

drmercer-lucid commented Mar 30, 2022

Just a note, in v2.1.0 onward, this is now even more broken than before (probably related to #143). Neither running from the repo root nor running from bazel-bin work anymore:

$ bazel-bin/my-project/my-project_deploy
bazel-bin/my-project/my-project_deploy: line 15: external/rules_spring/springboot/default_bazelrun_script.sh: No such file or directory
$ cd bazel-bin && my-project/my-project_deploy
my-project/my-project_deploy: line 15: external/rules_spring/springboot/default_bazelrun_script.sh: No such file or directory

Can confirm that cd bazel-bin && my-project/my-project_deploy does work on 2.0.0, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants