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

chore(deps): upgrade to newest bsdtar #940

Merged
merged 1 commit into from
Sep 18, 2024
Merged
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
42 changes: 17 additions & 25 deletions lib/private/tar_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -36,44 +36,36 @@ BSDTAR_PLATFORMS = {

BSDTAR_PREBUILT = {
"darwin_amd64": (
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.4-3/tar_darwin_amd64",
"e872943518f946a4a73106c1fa811c0211cb74a6e6d673f5a2ffbfaf40806ec0",
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.5/tar_darwin_amd64",
"6c7752869833c5cd4cf9728f90afd37f6665d7f9e06a4fbfdeb0fa41267575cf",
),
"darwin_arm64": (
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.4-3/tar_darwin_arm64",
"81d992eeefb519421dc18db63fce51f7fef7204b94e17e9b490af7699b565ff1",
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.5/tar_darwin_arm64",
"1718c23919bae478ed13c682a341e389de6ba4396220fc8e75a7f0e5d6024019",
),
"linux_amd64": (
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.4-3/tar_linux_amd64",
"9dba82030199b2660086e458fa6481cf73089ee5c47d216e647bb2a6b0fae792",
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.5/tar_linux_amd64",
"b8c492a51fb9e4c59dfa71b3c62191210c48280b98c2a88f7cef8ba973a9ad39",
),
"linux_arm64": (
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.4-3/tar_linux_arm64",
"105f91ad792fce13030bd249d8f9a14fd7ceaf908e1caeb99685b0b1fac44be2",
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.5/tar_linux_arm64",
"aa760c25a5445320bb3cde06e60c99ebc95fb29f330af0212bd099dd24e1cc54",
),
"windows_amd64": (
"https://github.com/libarchive/libarchive/releases/download/v3.7.4/libarchive-v3.7.4-amd64.zip",
"7ced6865d5e22e1dab0c3f3d65094d946ae505ec4e8db026f82c9e1c413f3c59",
"https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.5/tar_windows_amd64.exe",
Copy link

Choose a reason for hiding this comment

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

I think the binary here won't work on Windows as intended – based on file it is an ELF binary:

$ wget https://github.com/aspect-build/bsdtar-prebuilt/releases/download/v3.7.5/tar_windows_amd64.exe
$ file tar_windows_amd64.exe
tar_windows_amd64.exe: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, stripped

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah sorry about that, I detected that problem before release here (CI is red on main on windows). Working on it...

"80c109b9477ed44e9f8626cd9d8a635c8761c4506030c91f46b289798c7a22b6",
),
}

def _bsdtar_binary_repo(rctx):
(url, sha256) = BSDTAR_PREBUILT[rctx.attr.platform]
if rctx.attr.platform.startswith("windows"):
rctx.download_and_extract(
url = url,
type = "zip",
sha256 = sha256,
)
binary = "libarchive/bin/bsdtar.exe"
else:
rctx.download(
url = url,
output = "tar",
executable = True,
sha256 = sha256,
)
binary = "tar"
binary = "tar.exe" if rctx.attr.platform.startswith("windows") else "tar"
rctx.download(
url = url,
output = binary,
executable = True,
sha256 = sha256,
)

rctx.file("BUILD.bazel", """\
# @generated by @aspect_bazel_lib//lib/private:tar_toolchain.bzl
Expand Down