Skip to content

Commit

Permalink
Move clang-format and ruff to build_deps.jsonc (#3254)
Browse files Browse the repository at this point in the history
  • Loading branch information
npaun authored Dec 17, 2024
1 parent 3f4bbc5 commit 76b567f
Show file tree
Hide file tree
Showing 9 changed files with 164 additions and 77 deletions.
77 changes: 0 additions & 77 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -394,83 +394,6 @@ new_local_repository(
path = "empty",
)

# Dev tools

FILE_GROUP = """filegroup(
name="file",
srcs=glob(["**"])
)"""

http_archive(
name = "ruff-darwin-arm64",
build_file_content = FILE_GROUP,
integrity = "sha256-KbGnLDXu1bIkD/Nl4fRdB7wMQLkzGhGcK1nMpEwPMi4=",
strip_prefix = "ruff-aarch64-apple-darwin",
url = "https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-aarch64-apple-darwin.tar.gz",
)

http_archive(
name = "ruff-darwin-amd64",
build_file_content = FILE_GROUP,
integrity = "sha256-W3JL0sldkm6kbaB9+mrFVoY32wR0CDhpi7SxkJ2Oug0=",
strip_prefix = "ruff-x86_64-apple-darwin",
url = "https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-x86_64-apple-darwin.tar.gz",
)

http_archive(
name = "ruff-linux-arm64",
build_file_content = FILE_GROUP,
integrity = "sha256-7nBZdr686PdPmCFa2EN65OHgmDCfqB3ygFaXVgUDRuM=",
strip_prefix = "ruff-aarch64-unknown-linux-gnu",
url = "https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-aarch64-unknown-linux-gnu.tar.gz",
)

http_archive(
name = "ruff-linux-amd64",
build_file_content = FILE_GROUP,
integrity = "sha256-Uu1+NMFYCfMT4/jtQoH+Uj5+XwZn57+ZWIhbfm8icKg=",
strip_prefix = "ruff-x86_64-unknown-linux-gnu",
url = "https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-x86_64-unknown-linux-gnu.tar.gz",
)

http_archive(
name = "ruff-windows-amd64",
build_file_content = FILE_GROUP,
integrity = "sha256-H2yX4kuLyNdBrkRPhTr61FQqJRyiKeLq4TnMmKE0t2A=",
url = "https://github.com/astral-sh/ruff/releases/download/0.6.7/ruff-x86_64-pc-windows-msvc.zip",
)

# clang-format static binary builds via GH Actions: https://github.com/npaun/bins/blob/master/.github/workflows/llvm.yml
# TODO(soon): Move this workflow to a repo in the cloudflare GH organization

http_file(
name = "clang-format-darwin-arm64",
executable = True,
integrity = "sha256-1hG7AcfgGL+IBrSCEhD9ed6pvIpZMdXMdhCDGkqzhpA=",
url = "https://github.com/npaun/bins/releases/download/llvm-18.1.8/llvm-18.1.8-darwin-arm64-clang-format",
)

http_file(
name = "clang-format-linux-arm64",
executable = True,
integrity = "sha256-No7G08x7VJ+CkjuhyohcTWymPPm0QUE4EZlkp9Of5jM=",
url = "https://github.com/npaun/bins/releases/download/llvm-18.1.8/llvm-18.1.8-linux-arm64-clang-format",
)

http_file(
name = "clang-format-linux-amd64",
executable = True,
integrity = "sha256-iCbaPg60x60eA9ZIWmSdFva/RD9xOBcJLUwSRK8Gxzk=",
url = "https://github.com/npaun/bins/releases/download/llvm-18.1.8/llvm-18.1.8-linux-amd64-clang-format",
)

http_file(
name = "clang-format-windows-amd64",
executable = True,
integrity = "sha256-4V2KXVoX5Ny1J7ABfVRx0nAHpAGegykhzac7zW3nK0k=",
url = "https://github.com/npaun/bins/releases/download/llvm-18.1.8/llvm-18.1.8-windows-amd64-clang-format.exe",
)

# ========================================================================================
# Web Platform Tests

Expand Down
50 changes: 50 additions & 0 deletions build/deps/build_deps.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,56 @@
"repo": "buildtools",
"file_regex": "^buildifier-windows-amd64.exe$",
"file_type": "executable"
},
//clang-format
{
"name": "clang-format-linux-amd64",
"type": "github_release",
"owner": "cloudflare",
"repo": "workerd-tools",
"file_regex": "llvm-.*-linux-amd64-clang-format",
"file_type": "executable"
},
{
"name": "clang-format-linux-arm64",
"type": "github_release",
"owner": "cloudflare",
"repo": "workerd-tools",
"file_regex": "llvm-.*-linux-arm64-clang-format",
"file_type": "executable"
},
{
"name": "clang-format-darwin-arm64",
"type": "github_release",
"owner": "cloudflare",
"repo": "workerd-tools",
"file_regex": "llvm-.*-darwin-arm64-clang-format",
"file_type": "executable"
},
//ruff
{
"name": "ruff-darwin-arm64",
"type": "github_release",
"owner": "astral-sh",
"repo": "ruff",
"file_regex": "^ruff-aarch64-apple-darwin.tar.gz$",
"build_file_content": "filegroup(name='file', srcs=glob(['**']))"
},
{
"name": "ruff-linux-arm64",
"type": "github_release",
"owner": "astral-sh",
"repo": "ruff",
"file_regex": "^ruff-aarch64-unknown-linux-gnu.tar.gz$",
"build_file_content": "filegroup(name='file', srcs=glob(['**']))"
},
{
"name": "ruff-linux-amd64",
"type": "github_release",
"owner": "astral-sh",
"repo": "ruff",
"file_regex": "^ruff-x86_64-unknown-linux-gnu.tar.gz$",
"build_file_content": "filegroup(name='file', srcs=glob(['**']))"
}
]
}
12 changes: 12 additions & 0 deletions build/deps/gen/build_deps.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,13 @@ load("@//build/deps:gen/dep_cargo_bazel_linux_x64.bzl", "dep_cargo_bazel_linux_x
load("@//build/deps:gen/dep_cargo_bazel_macos_arm64.bzl", "dep_cargo_bazel_macos_arm64")
load("@//build/deps:gen/dep_cargo_bazel_macos_x64.bzl", "dep_cargo_bazel_macos_x64")
load("@//build/deps:gen/dep_cargo_bazel_win_x64.bzl", "dep_cargo_bazel_win_x64")
load("@//build/deps:gen/dep_clang_format_darwin_arm64.bzl", "dep_clang_format_darwin_arm64")
load("@//build/deps:gen/dep_clang_format_linux_amd64.bzl", "dep_clang_format_linux_amd64")
load("@//build/deps:gen/dep_clang_format_linux_arm64.bzl", "dep_clang_format_linux_arm64")
load("@//build/deps:gen/dep_cxxbridge_cmd.bzl", "dep_cxxbridge_cmd")
load("@//build/deps:gen/dep_ruff_darwin_arm64.bzl", "dep_ruff_darwin_arm64")
load("@//build/deps:gen/dep_ruff_linux_amd64.bzl", "dep_ruff_linux_amd64")
load("@//build/deps:gen/dep_ruff_linux_arm64.bzl", "dep_ruff_linux_arm64")
load("@//build/deps:gen/dep_rules_nodejs.bzl", "dep_rules_nodejs")
load("@//build/deps:gen/dep_rules_pkg.bzl", "dep_rules_pkg")
load("@//build/deps:gen/dep_rules_python.bzl", "dep_rules_python")
Expand Down Expand Up @@ -44,3 +50,9 @@ def deps_gen():
dep_buildifier_darwin_amd64()
dep_buildifier_darwin_arm64()
dep_buildifier_windows_amd64()
dep_clang_format_linux_amd64()
dep_clang_format_linux_arm64()
dep_clang_format_darwin_arm64()
dep_ruff_darwin_arm64()
dep_ruff_linux_arm64()
dep_ruff_linux_amd64()
15 changes: 15 additions & 0 deletions build/deps/gen/dep_clang_format_darwin_arm64.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

load("@//:build/http.bzl", "http_file")

TAG_NAME = "llvm-18.1.8"
URL = "https://github.com/cloudflare/workerd-tools/releases/download/llvm-18.1.8/llvm-18.1.8-darwin-arm64-clang-format"
SHA256 = "08c90dad18580c61caed43b249704f4e8b1ca3dee6abb197185ecaef298149af"

def dep_clang_format_darwin_arm64():
http_file(
name = "clang-format-darwin-arm64",
url = URL,
executable = True,
sha256 = SHA256,
)
15 changes: 15 additions & 0 deletions build/deps/gen/dep_clang_format_linux_amd64.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

load("@//:build/http.bzl", "http_file")

TAG_NAME = "llvm-18.1.8"
URL = "https://github.com/cloudflare/workerd-tools/releases/download/llvm-18.1.8/llvm-18.1.8-linux-amd64-clang-format"
SHA256 = "34677b7593943121858197358481d6941d9be1977e024c9e21862bddef62c762"

def dep_clang_format_linux_amd64():
http_file(
name = "clang-format-linux-amd64",
url = URL,
executable = True,
sha256 = SHA256,
)
15 changes: 15 additions & 0 deletions build/deps/gen/dep_clang_format_linux_arm64.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

load("@//:build/http.bzl", "http_file")

TAG_NAME = "llvm-18.1.8"
URL = "https://github.com/cloudflare/workerd-tools/releases/download/llvm-18.1.8/llvm-18.1.8-linux-arm64-clang-format"
SHA256 = "e1eb317d1ccceb3d1b544a841bfb7a74a52969d8aa033f40b1796af3821c2a96"

def dep_clang_format_linux_arm64():
http_file(
name = "clang-format-linux-arm64",
url = URL,
executable = True,
sha256 = SHA256,
)
19 changes: 19 additions & 0 deletions build/deps/gen/dep_ruff_darwin_arm64.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

load("@//:build/http.bzl", "http_archive")

TAG_NAME = "0.8.3"
URL = "https://github.com/astral-sh/ruff/releases/download/0.8.3/ruff-aarch64-apple-darwin.tar.gz"
STRIP_PREFIX = "ruff-aarch64-apple-darwin"
SHA256 = "b99da0f689b01d5b556fe2f66a756c99fe85b78cebd19f73817de7315438d53e"
TYPE = "tgz"

def dep_ruff_darwin_arm64():
http_archive(
name = "ruff-darwin-arm64",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
build_file_content = "filegroup(name='file', srcs=glob(['**']))",
)
19 changes: 19 additions & 0 deletions build/deps/gen/dep_ruff_linux_amd64.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

load("@//:build/http.bzl", "http_archive")

TAG_NAME = "0.8.3"
URL = "https://github.com/astral-sh/ruff/releases/download/0.8.3/ruff-x86_64-unknown-linux-gnu.tar.gz"
STRIP_PREFIX = "ruff-x86_64-unknown-linux-gnu"
SHA256 = "19eb5ce0cf1151d5ef58372633c342e1c000f4bfa8877b3d4ba0f0191b4bf839"
TYPE = "tgz"

def dep_ruff_linux_amd64():
http_archive(
name = "ruff-linux-amd64",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
build_file_content = "filegroup(name='file', srcs=glob(['**']))",
)
19 changes: 19 additions & 0 deletions build/deps/gen/dep_ruff_linux_arm64.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

load("@//:build/http.bzl", "http_archive")

TAG_NAME = "0.8.3"
URL = "https://github.com/astral-sh/ruff/releases/download/0.8.3/ruff-aarch64-unknown-linux-gnu.tar.gz"
STRIP_PREFIX = "ruff-aarch64-unknown-linux-gnu"
SHA256 = "e8fd209006dc6be4066eb1730371aa2bba0216471a7fddb57aaf07562dcf7283"
TYPE = "tgz"

def dep_ruff_linux_arm64():
http_archive(
name = "ruff-linux-arm64",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
build_file_content = "filegroup(name='file', srcs=glob(['**']))",
)

0 comments on commit 76b567f

Please sign in to comment.