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 jq path in :pin runnable #454

Merged
merged 1 commit into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion coursier.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ sh_binary(
name = "pin",
srcs = ["pin.sh"],
args = [
"$(location :jq-binary)",
"$(rootpath :jq-binary)",
],
data = [
":jq-binary",
Expand Down
5 changes: 4 additions & 1 deletion private/pin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ readonly maven_install_json_loc={maven_install_location}
readonly execution_root=$(cd "$(dirname "$maven_install_json_loc")" && bazel info execution_root)
readonly workspace_name=$(basename "$execution_root")
# `jq` is a platform-specific dependency with an unpredictable path.
readonly jq=$1
# Note that $(rootpath) will always give external/unpinned_maven/jq, however under --nolegacy_external_runfiles
# there is only pin.runfiles/unpinned_maven/jq not also pin.runfiles/user_repo/external/unpinned_maven/jq
# So replace leading external/ with ../
readonly jq=${1/#external\//..\/}
cat <<"RULES_JVM_EXTERNAL_EOF" | "$jq" --sort-keys --indent 4 . - > $maven_install_json_loc
{dependency_tree_json}
RULES_JVM_EXTERNAL_EOF
Expand Down