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 issues with find in wrapper scripts #88

Merged
merged 3 commits into from
May 5, 2023
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ hassle. Simply add the following to your `WORKSPACE` file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "skyscope",
sha256 = "2acf7b7f5bf3e66b83e1fac3aa6bcf71d173433ca6786f83d62fb5e9241fe7dc",
urls = ["https://github.com/tweag/skyscope/releases/download/v0.2.6/skyscope.zip"]
sha256 = "5544313ec77adbc96856c4cdfb3dfc6b5409e05790860ae19c7d321fb585490b",
urls = ["https://github.com/tweag/skyscope/releases/download/v0.2.7/skyscope.zip"]
)
load("@skyscope//:repository.bzl", "configure_skyscope")
configure_skyscope()
Expand All @@ -75,7 +75,7 @@ its `WORKSPACE` file.

1. Go to the [releases page](https://github.com/tweag/skyscope/releases) and
pick the version you want. The latest is
[v0.2.6](https://github.com/tweag/skyscope/releases/v0.2.6).
[v0.2.7](https://github.com/tweag/skyscope/releases/v0.2.7).

2. Download a zip archive for your Operating System (currently supported are
Linux and MacOS).
Expand Down
6 changes: 3 additions & 3 deletions release/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ load(":package.bzl", "package_release")
package_release(
"//backend:skyscope",
{
"@platforms//os:linux": "7f60d4ba7b7d65be9f5dd18b1e7d5911f42217d2801e2046771f2ec01a862f96",
"@platforms//os:macos": "4f60f8bef757aad434dc9950f4ea59c6b476ac336aca113700e36d4574721ae4",
"@platforms//os:linux": "290e383ce51cd9cc4492b4cbcc33d10df65bc3bb07e606808b7fda0db3ef445e",
"@platforms//os:macos": "ac5fda02a10cf8d902d16f2e4b6cb5d6234f5304946f3574cb4855a71bde89b8",
},
"https://github.com/tweag/skyscope/releases/download/v0.2.6",
"https://github.com/tweag/skyscope/releases/download/v0.2.7",
)

exports_files(["entrypoint.sh"])
17 changes: 16 additions & 1 deletion release/package.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,22 @@ def package_release(binary, platforms, url_base):
)
wrapper = lambda name: [
"[[ \"${SKYSCOPE_DEBUG:-}\" ]] && set -x",
"RELEASE_DIR=$(find . -type d -name skyscope -printf \"$PWD/%P\\n\" -quit)",
"while true; do", # Search upward until we find the runfiles directory.
" case \"$(basename \"$PWD\")\" in",
" {}.runfiles)".format(name),
" RELEASE_DIR=\"$PWD/$(find . -type d -name skyscope | head -1)\"",
" break",
" ;;",
" /)",
" echo 'failed to find runfiles directory'",
" exit 1",
" ;;",
" *)",
" cd ..",
" continue",
" ;;",
" esac",
"done",
"export SKYSCOPE_BINARY=\"$RELEASE_DIR/closure/skyscope\"",
"\"$RELEASE_DIR/bin/skyscope\" {} \"$@\"".format(name),
]
Expand Down