Skip to content

Commit

Permalink
implement node:dns module for nodejs_compat (#3183)
Browse files Browse the repository at this point in the history
  • Loading branch information
anonrig authored Dec 9, 2024
1 parent 79ff507 commit 88872ff
Show file tree
Hide file tree
Showing 22 changed files with 1,776 additions and 316 deletions.
1 change: 1 addition & 0 deletions compile_flags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
-isystembazel-bin/src/rust/cxx-integration/_virtual_includes/cxx-include/
-isystembazel-bin/src/rust/cxx-integration/_virtual_includes/cxx-integration@cxx
-isystembazel-bin/src/rust/cxx-integration-test/_virtual_includes/cxx-integration-test@cxx
-isystembazel-bin/src/rust/dns/_virtual_includes/dns@cxx
-D_FORTIFY_SOURCE=1
-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES
-D_LIBCPP_NO_ABI_TAG
Expand Down
27 changes: 24 additions & 3 deletions deps/rust/Cargo.lock

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

1 change: 1 addition & 0 deletions deps/rust/cargo.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ PACKAGES = {
"serde_json": crate.spec(version = "1"),
"serde": crate.spec(version = "1", features = ["derive"]),
"syn": crate.spec(version = "2"),
"thiserror": crate.spec(version = "2"),
# tokio is huge, let's enable only features when we actually need them.
"tokio": crate.spec(version = "1", default_features = False, features = ["net", "rt", "rt-multi-thread", "time"]),
"tracing": crate.spec(version = "0", default_features = False, features = ["std"]),
Expand Down
6 changes: 6 additions & 0 deletions deps/rust/crates/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,12 @@ alias(
tags = ["manual"],
)

alias(
name = "thiserror",
actual = "@crates_vendor__thiserror-2.0.6//:thiserror",
tags = ["manual"],
)

alias(
name = "tokio",
actual = "@crates_vendor__tokio-1.41.1//:tokio",
Expand Down
114 changes: 114 additions & 0 deletions deps/rust/crates/BUILD.thiserror-2.0.6.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,114 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//cargo:defs.bzl", "cargo_build_script")
load("@rules_rust//rust:defs.bzl", "rust_library")

package(default_visibility = ["//visibility:public"])

rust_library(
name = "thiserror",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"default",
"std",
],
crate_root = "src/lib.rs",
edition = "2021",
proc_macro_deps = [
"@crates_vendor__thiserror-impl-2.0.6//:thiserror_impl",
],
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=thiserror",
"manual",
"noclippy",
"norustfmt",
],
version = "2.0.6",
deps = [
"@crates_vendor__thiserror-2.0.6//:build_script_build",
],
)

cargo_build_script(
name = "_bs",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
"**/*.rs",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_features = [
"default",
"std",
],
crate_name = "build_script_build",
crate_root = "build.rs",
data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
edition = "2021",
pkg_name = "thiserror",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=thiserror",
"manual",
"noclippy",
"norustfmt",
],
version = "2.0.6",
visibility = ["//visibility:private"],
)

alias(
name = "build_script_build",
actual = ":_bs",
tags = ["manual"],
)
49 changes: 49 additions & 0 deletions deps/rust/crates/BUILD.thiserror-impl-2.0.6.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
###############################################################################
# @generated
# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To
# regenerate this file, run the following:
#
# bazel run @//deps/rust:crates_vendor
###############################################################################

load("@rules_rust//rust:defs.bzl", "rust_proc_macro")

package(default_visibility = ["//visibility:public"])

rust_proc_macro(
name = "thiserror_impl",
srcs = glob(
include = ["**/*.rs"],
allow_empty = True,
),
compile_data = glob(
include = ["**"],
allow_empty = True,
exclude = [
"**/* *",
".tmp_git_root/**/*",
"BUILD",
"BUILD.bazel",
"WORKSPACE",
"WORKSPACE.bazel",
],
),
crate_root = "src/lib.rs",
edition = "2021",
rustc_flags = [
"--cap-lints=allow",
],
tags = [
"cargo-bazel",
"crate-name=thiserror-impl",
"manual",
"noclippy",
"norustfmt",
],
version = "2.0.6",
deps = [
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.87//:syn",
],
)
22 changes: 22 additions & 0 deletions deps/rust/crates/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ _NORMAL_DEPENDENCIES = {
"serde": Label("@crates_vendor__serde-1.0.215//:serde"),
"serde_json": Label("@crates_vendor__serde_json-1.0.132//:serde_json"),
"syn": Label("@crates_vendor__syn-2.0.87//:syn"),
"thiserror": Label("@crates_vendor__thiserror-2.0.6//:thiserror"),
"tokio": Label("@crates_vendor__tokio-1.41.1//:tokio"),
"tracing": Label("@crates_vendor__tracing-0.1.40//:tracing"),
},
Expand Down Expand Up @@ -1386,6 +1387,16 @@ def crate_repositories():
build_file = Label("@workerd//deps/rust/crates:BUILD.thiserror-1.0.69.bazel"),
)

maybe(
http_archive,
name = "crates_vendor__thiserror-2.0.6",
sha256 = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47",
type = "tar.gz",
urls = ["https://static.crates.io/crates/thiserror/2.0.6/download"],
strip_prefix = "thiserror-2.0.6",
build_file = Label("@workerd//deps/rust/crates:BUILD.thiserror-2.0.6.bazel"),
)

maybe(
http_archive,
name = "crates_vendor__thiserror-impl-1.0.69",
Expand All @@ -1396,6 +1407,16 @@ def crate_repositories():
build_file = Label("@workerd//deps/rust/crates:BUILD.thiserror-impl-1.0.69.bazel"),
)

maybe(
http_archive,
name = "crates_vendor__thiserror-impl-2.0.6",
sha256 = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312",
type = "tar.gz",
urls = ["https://static.crates.io/crates/thiserror-impl/2.0.6/download"],
strip_prefix = "thiserror-impl-2.0.6",
build_file = Label("@workerd//deps/rust/crates:BUILD.thiserror-impl-2.0.6.bazel"),
)

maybe(
http_archive,
name = "crates_vendor__tokio-1.41.1",
Expand Down Expand Up @@ -1623,6 +1644,7 @@ def crate_repositories():
struct(repo = "crates_vendor__serde-1.0.215", is_dev_dep = False),
struct(repo = "crates_vendor__serde_json-1.0.132", is_dev_dep = False),
struct(repo = "crates_vendor__syn-2.0.87", is_dev_dep = False),
struct(repo = "crates_vendor__thiserror-2.0.6", is_dev_dep = False),
struct(repo = "crates_vendor__tokio-1.41.1", is_dev_dep = False),
struct(repo = "crates_vendor__tracing-0.1.40", is_dev_dep = False),
]
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,7 @@ rustfmt:
# example: just bench mimetype
bench path:
bazel run //src/workerd/tests:bench-{{path}}

# example: just clippy dns
clippy package="...":
bazel build //src/rust/{{package}} --config=lint
Loading

0 comments on commit 88872ff

Please sign in to comment.