Skip to content

Commit

Permalink
[build] Update rules_{js, ts} to drop bazel-lib workaround, convert a…
Browse files Browse the repository at this point in the history
…nd update more deps to update-deps

- Drop unused rules_license
  • Loading branch information
fhanau committed Oct 11, 2024
1 parent 1729660 commit fa95fb3
Show file tree
Hide file tree
Showing 19 changed files with 168 additions and 100 deletions.
47 changes: 0 additions & 47 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,6 @@ http_archive(
urls = ["https://github.com/google/brotli/archive/refs/tags/v1.1.0.tar.gz"],
)

http_archive(
name = "ada-url",
build_file = "//:build/BUILD.ada-url",
sha256 = "30d4f4cccbd8b0455a71a2180da95f3a38d085e4a440eb931da94c7272705edc",
type = "zip",
url = "https://github.com/ada-url/ada/releases/download/v2.9.1/singleheader.zip",
)

http_archive(
name = "nbytes",
build_file = "//:build/BUILD.nbytes",
Expand All @@ -88,14 +80,6 @@ http_archive(
url = "https://github.com/nodejs/nbytes/archive/refs/tags/v0.1.1.tar.gz",
)

http_archive(
name = "simdutf",
build_file = "//:build/BUILD.simdutf",
sha256 = "7867c118a11bb7ccaea0f999a28684b06040027506b424b706146cc912b80ff6",
type = "zip",
url = "https://github.com/simdutf/simdutf/releases/download/v5.2.8/singleheader.zip",
)

http_archive(
name = "pyodide",
build_file = "//:build/BUILD.pyodide",
Expand Down Expand Up @@ -243,37 +227,6 @@ rust_analyzer_dependencies()
#
# workerd uses Node.js scripts for generating TypeScript types.

# TODO(soon): rules_js depends on bazel-lib, which broke on Windows after a dependency binary was
# deleted. There is a fix available at https://github.com/bazel-contrib/bazel-lib/pull/940, but it
# is based off of a commit where WORKSPACE dependencies appear to be broken. Create a patch for the
# latest release build instead. Remove this ASAP once the fix has been merged and rules_js has been
# updated with the fixed version.
http_archive(
name = "aspect_bazel_lib",
patch_args = ["-p1"],
patches = [
# based on https://github.com/bazel-contrib/bazel-lib/pull/940.
"//:patches/bazel-lib/0001-chore-deps-upgrade-to-newest-bsdtar.patch",
],
sha256 = "688354ee6beeba7194243d73eb0992b9a12e8edeeeec5b6544f4b531a3112237",
strip_prefix = "bazel-lib-2.8.1",
url = "https://github.com/aspect-build/bazel-lib/releases/download/v2.8.1/bazel-lib-v2.8.1.tar.gz",
)

http_archive(
name = "aspect_rules_js",
sha256 = "6b7e73c35b97615a09281090da3645d9f03b2a09e8caa791377ad9022c88e2e6",
strip_prefix = "rules_js-2.0.0",
url = "https://github.com/aspect-build/rules_js/releases/download/v2.0.0/rules_js-v2.0.0.tar.gz",
)

http_archive(
name = "aspect_rules_ts",
sha256 = "ee7dcc35faef98f3050df9cf26f2a72ef356cab8ad927efb1c4dc119ac082a19",
strip_prefix = "rules_ts-3.0.0",
url = "https://github.com/aspect-build/rules_ts/releases/download/v3.0.0/rules_ts-v3.0.0.tar.gz",
)

load("@aspect_rules_js//js:repositories.bzl", "rules_js_dependencies")

rules_js_dependencies()
Expand Down
29 changes: 22 additions & 7 deletions build/deps/build_deps.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,6 @@
"repo": "bazel-skylib",
"file_regex": "\\.tar\\.gz$"
},
{
"name": "rules_license",
"type": "github_release",
"owner": "bazelbuild",
"repo": "rules_license",
"file_regex": "\\.tar\\.gz$"
},
{
"name": "rules_python",
"type": "github_release",
Expand Down Expand Up @@ -94,6 +87,28 @@
"owner": "bazelbuild",
"repo": "rules_pkg",
"file_regex": "\\.tar\\.gz$"
},
{
// Needed for aspect_rules_js, build fails on Windows if it is not fetched explicitly.
"name": "aspect_bazel_lib",
"type": "github_release",
"owner": "bazel-contrib",
"repo": "bazel-lib",
"file_regex": "^bazel-lib-"
},
{
"name": "aspect_rules_js",
"type": "github_release",
"owner": "aspect-build",
"repo": "rules_js",
"file_regex": "^rules_js-"
},
{
"name": "aspect_rules_ts",
"type": "github_release",
"owner": "aspect-build",
"repo": "rules_ts",
"file_regex": "^rules_ts-"
}
]
}
18 changes: 18 additions & 0 deletions build/deps/deps.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,24 @@
// needed in the future.
"freeze_commit": "c08ccc9ed166a82b92edd70ab215ae1f2501e838"
},
{
"name": "ada-url",
"type": "github_release",
"owner": "ada-url",
"repo": "ada",
"file_regex": "singleheader.zip",
"strip_prefix": "",
"build_file": "//:build/BUILD.ada-url"
},
{
"name": "simdutf",
"type": "github_release",
"owner": "simdutf",
"repo": "simdutf",
"file_regex": "singleheader.zip",
"strip_prefix": "",
"build_file": "//:build/BUILD.simdutf"
},
// webgpu deps
{
"name": "dawn",
Expand Down
8 changes: 6 additions & 2 deletions build/deps/gen/build_deps.bzl
Original file line number Diff line number Diff line change
@@ -1,21 +1,22 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

load("@//build/deps:gen/dep_aspect_bazel_lib.bzl", "dep_aspect_bazel_lib")
load("@//build/deps:gen/dep_aspect_rules_esbuild.bzl", "dep_aspect_rules_esbuild")
load("@//build/deps:gen/dep_aspect_rules_js.bzl", "dep_aspect_rules_js")
load("@//build/deps:gen/dep_aspect_rules_ts.bzl", "dep_aspect_rules_ts")
load("@//build/deps:gen/dep_bazel_skylib.bzl", "dep_bazel_skylib")
load("@//build/deps:gen/dep_build_bazel_apple_support.bzl", "dep_build_bazel_apple_support")
load("@//build/deps:gen/dep_cargo_bazel_linux_arm64.bzl", "dep_cargo_bazel_linux_arm64")
load("@//build/deps:gen/dep_cargo_bazel_linux_x64.bzl", "dep_cargo_bazel_linux_x64")
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_rules_license.bzl", "dep_rules_license")
load("@//build/deps:gen/dep_rules_pkg.bzl", "dep_rules_pkg")
load("@//build/deps:gen/dep_rules_python.bzl", "dep_rules_python")
load("@//build/deps:gen/dep_rules_rust.bzl", "dep_rules_rust")

def deps_gen():
dep_bazel_skylib()
dep_rules_license()
dep_rules_python()
dep_build_bazel_apple_support()
dep_rules_rust()
Expand All @@ -26,3 +27,6 @@ def deps_gen():
dep_cargo_bazel_win_x64()
dep_aspect_rules_esbuild()
dep_rules_pkg()
dep_aspect_bazel_lib()
dep_aspect_rules_js()
dep_aspect_rules_ts()
19 changes: 19 additions & 0 deletions build/deps/gen/dep_ada_url.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 = "v2.9.2"
URL = "https://github.com/ada-url/ada/releases/download/v2.9.2/singleheader.zip"
STRIP_PREFIX = ""
SHA256 = "b2cce630590b490d79ea4f4460ba77efd5fb29c5a87a4e8cb7ebc4859bc4b564"
TYPE = "zip"

def dep_ada_url():
http_archive(
name = "ada-url",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
build_file = "//:build/BUILD.ada-url",
)
18 changes: 18 additions & 0 deletions build/deps/gen/dep_aspect_bazel_lib.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

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

TAG_NAME = "v2.9.1"
URL = "https://github.com/bazel-contrib/bazel-lib/releases/download/v2.9.1/bazel-lib-v2.9.1.tar.gz"
STRIP_PREFIX = "bazel-lib-2.9.1"
SHA256 = "f93d386d8d0b0149031175e81df42a488be4267c3ca2249ba5321c23c60bc1f0"
TYPE = "tgz"

def dep_aspect_bazel_lib():
http_archive(
name = "aspect_bazel_lib",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
)
18 changes: 18 additions & 0 deletions build/deps/gen/dep_aspect_rules_js.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

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

TAG_NAME = "v2.1.0"
URL = "https://github.com/aspect-build/rules_js/releases/download/v2.1.0/rules_js-v2.1.0.tar.gz"
STRIP_PREFIX = "rules_js-2.1.0"
SHA256 = "75c25a0f15a9e4592bbda45b57aa089e4bf17f9176fd735351e8c6444df87b52"
TYPE = "tgz"

def dep_aspect_rules_js():
http_archive(
name = "aspect_rules_js",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
)
18 changes: 18 additions & 0 deletions build/deps/gen/dep_aspect_rules_ts.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# WARNING: THIS FILE IS AUTOGENERATED BY update-deps.py DO NOT EDIT

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

TAG_NAME = "v3.2.1"
URL = "https://github.com/aspect-build/rules_ts/releases/download/v3.2.1/rules_ts-v3.2.1.tar.gz"
STRIP_PREFIX = "rules_ts-3.2.1"
SHA256 = "8bbac753f4b61adbfc1d9878b87b9cd0f64c9e8e6d8fafc8a1bbfa9625bab162"
TYPE = "tgz"

def dep_aspect_rules_ts():
http_archive(
name = "aspect_rules_ts",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
)
8 changes: 4 additions & 4 deletions build/deps/gen/dep_build_bazel_apple_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

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

TAG_NAME = "1.17.0"
URL = "https://api.github.com/repos/bazelbuild/apple_support/tarball/1.17.0"
STRIP_PREFIX = "bazelbuild-apple_support-07dd08d"
SHA256 = "f90a92ad6bdb245523f63dae5e65ebaef7e0087c6651236fc83987cb03937dc3"
TAG_NAME = "1.17.1"
URL = "https://api.github.com/repos/bazelbuild/apple_support/tarball/1.17.1"
STRIP_PREFIX = "bazelbuild-apple_support-8ee7a2d"
SHA256 = "75112edeece57fedeef88bce87e28e4a30cc29f0892053532f29f57cf62709a1"
TYPE = "tgz"

def dep_build_bazel_apple_support():
Expand Down
8 changes: 4 additions & 4 deletions build/deps/gen/dep_capnp_cpp.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

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

URL = "https://github.com/capnproto/capnproto/tarball/b279a2776d13c997689fb0a36ea9f1c91e881aba"
STRIP_PREFIX = "capnproto-capnproto-b279a27/c++"
SHA256 = "f633ccd5922b512c3aea69c861340149ad2aa51f389ba5aca50f01334d23b9a9"
URL = "https://github.com/capnproto/capnproto/tarball/c0b99a8014f886e0962f0bbd2c17d986acf53d55"
STRIP_PREFIX = "capnproto-capnproto-c0b99a8/c++"
SHA256 = "4634ba3a20f714d169787b11bde49f4c75308eb98b725dc99be1a86cf8e78737"
TYPE = "tgz"
COMMIT = "b279a2776d13c997689fb0a36ea9f1c91e881aba"
COMMIT = "c0b99a8014f886e0962f0bbd2c17d986acf53d55"

def dep_capnp_cpp():
http_archive(
Expand Down
6 changes: 3 additions & 3 deletions build/deps/gen/dep_cargo_bazel_linux_arm64.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

TAG_NAME = "0.51.0"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.51.0/cargo-bazel-aarch64-unknown-linux-gnu"
SHA256 = "4e2cba0e871e0a3412459f73e85e8ee7091a43c98b8b86722e8c7dcdf5ffa08e"
TAG_NAME = "0.52.2"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.2/cargo-bazel-aarch64-unknown-linux-gnu"
SHA256 = "bf87642d5a8cffb60613719bf3329a9ff24671240b10c7f875a2d227e80b9cc5"

def dep_cargo_bazel_linux_arm64():
http_file(
Expand Down
6 changes: 3 additions & 3 deletions build/deps/gen/dep_cargo_bazel_linux_x64.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

TAG_NAME = "0.51.0"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.51.0/cargo-bazel-x86_64-unknown-linux-gnu"
SHA256 = "7ec5837a46305a71560d5bb051abaa12d968c8cbea0a39922a3b575bdc50c3ac"
TAG_NAME = "0.52.2"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.2/cargo-bazel-x86_64-unknown-linux-gnu"
SHA256 = "a7e320f8f732ecbcdea85fb1b0ce7de44e53d76f9b0b598fb03dc755a9125937"

def dep_cargo_bazel_linux_x64():
http_file(
Expand Down
6 changes: 3 additions & 3 deletions build/deps/gen/dep_cargo_bazel_macos_arm64.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

TAG_NAME = "0.51.0"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.51.0/cargo-bazel-aarch64-apple-darwin"
SHA256 = "604190df2967941f735c3b9a6a0ba92e6c826379b0a49bb00ec9cf61af59392d"
TAG_NAME = "0.52.2"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.2/cargo-bazel-aarch64-apple-darwin"
SHA256 = "10ebb420568df159c10b6e5348192b165fc299f54b2bebc4e78412f3d3b67e41"

def dep_cargo_bazel_macos_arm64():
http_file(
Expand Down
6 changes: 3 additions & 3 deletions build/deps/gen/dep_cargo_bazel_macos_x64.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

TAG_NAME = "0.51.0"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.51.0/cargo-bazel-x86_64-apple-darwin"
SHA256 = "0de69294b78503d9fde35a84e31aba24d503da74a5ef0416ee1c8d49ec5029ca"
TAG_NAME = "0.52.2"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.2/cargo-bazel-x86_64-apple-darwin"
SHA256 = "951905d3763fd4acc515bb33ec23e651657baf867d8bf94b3f23e87a1cea15ad"

def dep_cargo_bazel_macos_x64():
http_file(
Expand Down
6 changes: 3 additions & 3 deletions build/deps/gen/dep_cargo_bazel_win_x64.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

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

TAG_NAME = "0.51.0"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.51.0/cargo-bazel-x86_64-pc-windows-msvc.exe"
SHA256 = "1665532ee718c883fe61be71bcf584aa759c75fe6dc431b481adfa823a38d647"
TAG_NAME = "0.52.2"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.2/cargo-bazel-x86_64-pc-windows-msvc.exe"
SHA256 = "3ec8a8757ab4a45fb30f8d33bdec3bcd9ed2d4f05af41f0acf5ce9a465ee60d4"

def dep_cargo_bazel_win_x64():
http_file(
Expand Down
18 changes: 0 additions & 18 deletions build/deps/gen/dep_rules_license.bzl

This file was deleted.

6 changes: 3 additions & 3 deletions build/deps/gen/dep_rules_rust.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

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

TAG_NAME = "0.51.0"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.51.0/rules_rust-v0.51.0.tar.gz"
TAG_NAME = "0.52.2"
URL = "https://github.com/bazelbuild/rules_rust/releases/download/0.52.2/rules_rust-v0.52.2.tar.gz"
STRIP_PREFIX = ""
SHA256 = "042acfb73469b2d1848fe148d81c3422c61ea47a9e1900f1c9ec36f51e8e7193"
SHA256 = "671ddb3fe5ebcf9dd34d051eca7352fbaf33fa53bf61eed0b75a4c34829e5480"
TYPE = "tgz"

def dep_rules_rust():
Expand Down
19 changes: 19 additions & 0 deletions build/deps/gen/dep_simdutf.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 = "v5.5.0"
URL = "https://github.com/simdutf/simdutf/releases/download/v5.5.0/singleheader.zip"
STRIP_PREFIX = ""
SHA256 = "aae1a08b1fffcdb17a83670c482eaed0aae6f288bb59496da100c0d7cfacfb24"
TYPE = "zip"

def dep_simdutf():
http_archive(
name = "simdutf",
url = URL,
strip_prefix = STRIP_PREFIX,
type = TYPE,
sha256 = SHA256,
build_file = "//:build/BUILD.simdutf",
)
Loading

0 comments on commit fa95fb3

Please sign in to comment.