Skip to content

Commit

Permalink
Upgrade lol-html to 2.1.0 (changes how C API is accessed)
Browse files Browse the repository at this point in the history
  • Loading branch information
npaun committed Dec 5, 2024
1 parent 00ea12d commit 5bbe96f
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 27 deletions.
7 changes: 3 additions & 4 deletions deps/rust/BUILD.lolhtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
cc_library(
name = "lolhtml",
hdrs = ["@crates_vendor__lol_html-2.0.0//:c-api/include/lol_html.h"],
include_prefix = "c-api/include",
strip_include_prefix = "c-api/include",
hdrs = ["@crates_vendor__lol_html_c_api-1.1.2//:include/lol_html.h"],
strip_include_prefix = "include",
visibility = ["//visibility:public"],
deps = [
"@crates_vendor//:lolhtml",
"@crates_vendor//:lol_html_c_api",
],
)
10 changes: 5 additions & 5 deletions deps/rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion deps/rust/cargo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ PACKAGES = {
"cxx": crate.spec(version = "1"),
"cxxbridge-cmd": crate.spec(version = "1"),
"flate2": crate.spec(version = "1"),
"lolhtml": crate.spec(git = "https://github.com/cloudflare/lol-html.git", rev = "a161bb319a61ddfb4c66e29153bbf8d6491f28cf"),
# Commit hash refers to lol-html v2.1.0. We then access the nested lol_html_c_api crate within.
# TODO(npaun): Seems like some changes are still ongoing on the lol-html side. Recheck this in a couple weeks.
"lol_html_c_api": crate.spec(git = "https://github.com/cloudflare/lol-html.git", rev = "cac9f2f59aea8ad803286b0aae0d667926f441c7"),
"nix": crate.spec(version = "0"),
"pico-args": crate.spec(version = "0"),
"proc-macro2": crate.spec(version = "1"),
Expand Down
4 changes: 2 additions & 2 deletions deps/rust/crates/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ alias(
)

alias(
name = "lolhtml",
actual = "@crates_vendor__lolhtml-1.1.2//:lolhtml",
name = "lol_html_c_api",
actual = "@crates_vendor__lol_html_c_api-1.1.2//:lolhtml",
tags = ["manual"],
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ rust_library(
"noclippy",
"norustfmt",
],
version = "2.0.0",
version = "2.1.0",
deps = [
"@crates_vendor__bitflags-2.6.0//:bitflags",
"@crates_vendor__cfg-if-1.0.0//:cfg_if",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ rust_library(
],
tags = [
"cargo-bazel",
"crate-name=lolhtml",
"crate-name=lol_html_c_api",
"manual",
"noclippy",
"norustfmt",
Expand All @@ -45,8 +45,8 @@ rust_library(
deps = [
"@crates_vendor__encoding_rs-0.8.35//:encoding_rs",
"@crates_vendor__libc-0.2.162//:libc",
"@crates_vendor__lol_html-2.0.0//:lol_html",
"@crates_vendor__lolhtml-1.1.2//:build_script_build",
"@crates_vendor__lol_html-2.1.0//:lol_html",
"@crates_vendor__lol_html_c_api-1.1.2//:build_script_build",
"@crates_vendor__thiserror-1.0.69//:thiserror",
],
)
Expand Down Expand Up @@ -86,13 +86,13 @@ cargo_build_script(
),
edition = "2021",
links = "lolhtml",
pkg_name = "lolhtml",
pkg_name = "lol_html_c_api",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=lolhtml",
"crate-name=lol_html_c_api",
"manual",
"noclippy",
"norustfmt",
Expand Down
16 changes: 8 additions & 8 deletions deps/rust/crates/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ _NORMAL_DEPENDENCIES = {
"codespan-reporting": Label("@crates_vendor__codespan-reporting-0.11.1//:codespan_reporting"),
"cxx": Label("@crates_vendor__cxx-1.0.130//:cxx"),
"flate2": Label("@crates_vendor__flate2-1.0.35//:flate2"),
"lolhtml": Label("@crates_vendor__lolhtml-1.1.2//:lolhtml"),
"lol_html_c_api": Label("@crates_vendor__lol_html_c_api-1.1.2//:lolhtml"),
"nix": Label("@crates_vendor__nix-0.29.0//:nix"),
"pico-args": Label("@crates_vendor__pico-args-0.5.0//:pico_args"),
"proc-macro2": Label("@crates_vendor__proc-macro2-1.0.89//:proc_macro2"),
Expand Down Expand Up @@ -889,20 +889,20 @@ def crate_repositories():

maybe(
new_git_repository,
name = "crates_vendor__lol_html-2.0.0",
commit = "a161bb319a61ddfb4c66e29153bbf8d6491f28cf",
name = "crates_vendor__lol_html-2.1.0",
commit = "cac9f2f59aea8ad803286b0aae0d667926f441c7",
init_submodules = True,
remote = "https://github.com/cloudflare/lol-html.git",
build_file = Label("@workerd//deps/rust/crates:BUILD.lol_html-2.0.0.bazel"),
build_file = Label("@workerd//deps/rust/crates:BUILD.lol_html-2.1.0.bazel"),
)

maybe(
new_git_repository,
name = "crates_vendor__lolhtml-1.1.2",
commit = "a161bb319a61ddfb4c66e29153bbf8d6491f28cf",
name = "crates_vendor__lol_html_c_api-1.1.2",
commit = "cac9f2f59aea8ad803286b0aae0d667926f441c7",
init_submodules = True,
remote = "https://github.com/cloudflare/lol-html.git",
build_file = Label("@workerd//deps/rust/crates:BUILD.lolhtml-1.1.2.bazel"),
build_file = Label("@workerd//deps/rust/crates:BUILD.lol_html_c_api-1.1.2.bazel"),
strip_prefix = "c-api",
)

Expand Down Expand Up @@ -1615,7 +1615,7 @@ def crate_repositories():
struct(repo = "crates_vendor__codespan-reporting-0.11.1", is_dev_dep = False),
struct(repo = "crates_vendor__cxx-1.0.130", is_dev_dep = False),
struct(repo = "crates_vendor__flate2-1.0.35", is_dev_dep = False),
struct(repo = "crates_vendor__lolhtml-1.1.2", is_dev_dep = False),
struct(repo = "crates_vendor__lol_html_c_api-1.1.2", is_dev_dep = False),
struct(repo = "crates_vendor__nix-0.29.0", is_dev_dep = False),
struct(repo = "crates_vendor__pico-args-0.5.0", is_dev_dep = False),
struct(repo = "crates_vendor__proc-macro2-1.0.89", is_dev_dep = False),
Expand Down
2 changes: 1 addition & 1 deletion src/workerd/api/html-rewriter.c++
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "html-rewriter.h"

#include "c-api/include/lol_html.h"
#include "lol_html.h"
#include "streams.h"
#include "util.h"

Expand Down

0 comments on commit 5bbe96f

Please sign in to comment.