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

Allow bazel run @maven//:pin to run successfully #426

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

shs96c
Copy link
Collaborator

@shs96c shs96c commented Jun 26, 2020

To do this, we download each version of jq that might be used and
ensure it's available. Decide at run time which version we'll use.

Fixes #409

To do this, we download each version of jq that might be used and
ensure it's available. Decide at run time which version we'll use.
Copy link
Collaborator

@jin jin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@jin jin merged commit 45583ec into bazel-contrib:master Jun 26, 2020
@alexeagle
Copy link
Contributor

Hmm, this isn't working for me

% bazel run @unpinned_maven//:pin
/private/var/tmp/_bazel_alex.eagle/03c50bd9f989d25b88a1be300d53820c/execroot/rh/bazel-out/darwin-fastbuild/bin/external/unpinned_maven/pin: line 10: external/unpinned_maven/jq: No such file or directory

Changing this arg
https://github.com/bazelbuild/rules_jvm_external/pull/426/files#diff-062be76e7bf90a2fa889e8a9ec966b5cR53
from $(location :jq-binary) to just jq fixes it for me.
(note, $(rootpath :jq-binary) didn't fix it either, still has the extra "external/unpinned_maven" segments)

We go to lengths to genrule-copy the file to just "jq" so it doesn't seem like we should have to do this? unless it's for windows, but then you still don't have a bash.runfiles helper used in the pin.sh script

alexeagle pushed a commit to alexeagle/rules_jvm_external that referenced this pull request Sep 2, 2020
Problem reported on bazel-contrib#426

The build typically takes place in the user's workspace, so using
`$(location)` (or more correctly, `$(rootpath)`) gives an undesirable
"external/" leading segment. This would be useful if the binary being
run is in the users workspace, but we know our binary is in the same
workspace defining the BUILD file.

This change also uses the runfiles helper since I think that's required
to make this work on Windows, though I only tested on Mac.
alexeagle pushed a commit to alexeagle/rules_jvm_external that referenced this pull request Sep 2, 2020
Problem reported on bazel-contrib#426

The build typically takes place in the user's workspace, so using
`$(location)` (or more correctly, `$(rootpath)`) gives an undesirable
"external/" leading segment. This would be useful if the binary being
run is in the users workspace, but we know our binary is in the same
workspace defining the BUILD file.

This change also uses the runfiles helper since I think that's required
to make this work on Windows, though I only tested on Mac.
alexeagle pushed a commit to alexeagle/rules_jvm_external that referenced this pull request Sep 9, 2020
It currently relies on the legacy_external_runfiles behavior where Bazel makes
two copies of the program, at both
pin.runfiles/unpinned_maven/jq and  pin.runfiles/user_repo/external/unpinned_maven/jq

Problem reported on bazel-contrib#426
alexeagle pushed a commit to alexeagle/rules_jvm_external that referenced this pull request Sep 9, 2020
It currently relies on the legacy_external_runfiles behavior where Bazel makes
two copies of the program, at both
pin.runfiles/unpinned_maven/jq and  pin.runfiles/user_repo/external/unpinned_maven/jq

Problem reported on bazel-contrib#426
shs96c pushed a commit that referenced this pull request Sep 9, 2020
It currently relies on the legacy_external_runfiles behavior where Bazel makes
two copies of the program, at both
pin.runfiles/unpinned_maven/jq and  pin.runfiles/user_repo/external/unpinned_maven/jq

Problem reported on #426
@shs96c shs96c deleted the fix-jq branch December 9, 2022 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pin command requires pinned_maven_install due to jq dependency
4 participants