Skip to content

Commit

Permalink
[build] Disentangle r2*.c++, memory-cache.c++ from io target
Browse files Browse the repository at this point in the history
- Mark tools:dump_api_ast as no-downstream – this target is expensive and
  serves no purpose for the downstream build.
- Disable default dependencies for tracing to drop superfluous crate and match
  downstream
  • Loading branch information
fhanau committed Oct 25, 2024
1 parent efb5ff9 commit 09f3380
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 106 deletions.
30 changes: 9 additions & 21 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 @@ -5,6 +5,8 @@ load("@rules_rust//crate_universe:defs.bzl", "crate")

# We prefer single-digit dependencies to stay up to date as much as possible
PACKAGES = {
# When adding packages here, please only enable features as needed to keep compile times and
# binary sizes bounded.
"anyhow": crate.spec(version = "1"),
"capnp": crate.spec(version = "0"),
"capnpc": crate.spec(version = "0"),
Expand All @@ -19,5 +21,5 @@ PACKAGES = {
"serde_json": crate.spec(version = "1"),
"serde": crate.spec(version = "1", features = ["derive"]),
"tokio": crate.spec(version = "1", features = ["net", "process", "signal", "rt", "rt-multi-thread", "time"]),
"tracing": crate.spec(version = "0"),
"tracing": crate.spec(version = "0", default_features = False, features = ["std"]),
}
2 changes: 1 addition & 1 deletion deps/rust/crates/BUILD.cssparser-macros-0.6.1.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,6 @@ rust_proc_macro(
version = "0.6.1",
deps = [
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)
4 changes: 2 additions & 2 deletions deps/rust/crates/BUILD.cxxbridge-cmd-1.0.128.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ rust_library(
"@crates_vendor__codespan-reporting-0.11.1//:codespan_reporting",
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)

Expand Down Expand Up @@ -91,6 +91,6 @@ rust_binary(
"@crates_vendor__codespan-reporting-0.11.1//:codespan_reporting",
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)
2 changes: 1 addition & 1 deletion deps/rust/crates/BUILD.cxxbridge-macro-1.0.128.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ rust_proc_macro(
deps = [
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)
2 changes: 1 addition & 1 deletion deps/rust/crates/BUILD.derive_more-0.99.18.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ rust_proc_macro(
"@crates_vendor__convert_case-0.4.0//:convert_case",
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)
2 changes: 1 addition & 1 deletion deps/rust/crates/BUILD.serde_derive-1.0.213.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ rust_proc_macro(
deps = [
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ rust_library(
"parsing",
"printing",
"proc-macro",
"visit-mut",
],
crate_root = "src/lib.rs",
edition = "2021",
Expand All @@ -51,7 +50,7 @@ rust_library(
"noclippy",
"norustfmt",
],
version = "2.0.82",
version = "2.0.85",
deps = [
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
Expand Down
2 changes: 1 addition & 1 deletion deps/rust/crates/BUILD.thiserror-impl-1.0.65.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ rust_proc_macro(
deps = [
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)
6 changes: 0 additions & 6 deletions deps/rust/crates/BUILD.tracing-0.1.40.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@ rust_library(
],
),
crate_features = [
"attributes",
"default",
"std",
"tracing-attributes",
],
crate_root = "src/lib.rs",
edition = "2018",
proc_macro_deps = [
"@crates_vendor__tracing-attributes-0.1.27//:tracing_attributes",
],
rustc_flags = [
"--cap-lints=allow",
],
Expand Down
49 changes: 0 additions & 49 deletions deps/rust/crates/BUILD.tracing-attributes-0.1.27.bazel

This file was deleted.

2 changes: 1 addition & 1 deletion deps/rust/crates/BUILD.zerocopy-derive-0.7.35.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,6 @@ rust_proc_macro(
deps = [
"@crates_vendor__proc-macro2-1.0.89//:proc_macro2",
"@crates_vendor__quote-1.0.37//:quote",
"@crates_vendor__syn-2.0.82//:syn",
"@crates_vendor__syn-2.0.85//:syn",
],
)
20 changes: 5 additions & 15 deletions deps/rust/crates/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1324,12 +1324,12 @@ def crate_repositories():

maybe(
http_archive,
name = "crates_vendor__syn-2.0.82",
sha256 = "83540f837a8afc019423a8edb95b52a8effe46957ee402287f4292fae35be021",
name = "crates_vendor__syn-2.0.85",
sha256 = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56",
type = "tar.gz",
urls = ["https://static.crates.io/crates/syn/2.0.82/download"],
strip_prefix = "syn-2.0.82",
build_file = Label("@workerd//deps/rust/crates:BUILD.syn-2.0.82.bazel"),
urls = ["https://static.crates.io/crates/syn/2.0.85/download"],
strip_prefix = "syn-2.0.85",
build_file = Label("@workerd//deps/rust/crates:BUILD.syn-2.0.85.bazel"),
)

maybe(
Expand Down Expand Up @@ -1392,16 +1392,6 @@ def crate_repositories():
build_file = Label("@workerd//deps/rust/crates:BUILD.tracing-0.1.40.bazel"),
)

maybe(
http_archive,
name = "crates_vendor__tracing-attributes-0.1.27",
sha256 = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7",
type = "tar.gz",
urls = ["https://static.crates.io/crates/tracing-attributes/0.1.27/download"],
strip_prefix = "tracing-attributes-0.1.27",
build_file = Label("@workerd//deps/rust/crates:BUILD.tracing-attributes-0.1.27.bazel"),
)

maybe(
http_archive,
name = "crates_vendor__tracing-core-0.1.32",
Expand Down
37 changes: 35 additions & 2 deletions src/workerd/api/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ filegroup(
"encoding.c++",
"html-rewriter.c++",
"hyperdrive.c++",
"pyodide.c++",
"pyodide/pyodide.c++",
"memory-cache.c++",
"r2*.c++",
"rtti.c++",
"url.c++",
"util.c++",
Expand All @@ -34,7 +35,10 @@ filegroup(
"encoding.h",
"html-rewriter.h",
"hyperdrive.h",
"memory-cache.h",
"pyodide/pyodide.h",
"modules.h",
"r2*.h",
"rtti.h",
"url.h",
"util.h",
Expand All @@ -43,6 +47,33 @@ filegroup(
visibility = ["//visibility:public"],
)

wd_cc_library(
name = "r2",
srcs = glob(["r2*.c++"]),
hdrs = glob(["r2*.h"]),
implementation_deps = [
"//src/workerd/api:r2-api_capnp",
],
visibility = ["//visibility:public"],
deps = [
"//src/workerd/io",
],
)

wd_cc_library(
name = "memory-cache",
srcs = ["memory-cache.c++"],
hdrs = ["memory-cache.h"],
implementation_deps = [
"//src/workerd/io",
],
visibility = ["//visibility:public"],
deps = [
"//src/workerd/jsg",
"//src/workerd/util:uuid",
],
)

wd_cc_library(
name = "rtti",
srcs = ["rtti.c++"],
Expand All @@ -56,6 +87,9 @@ wd_cc_library(
deps = [
":html-rewriter",
":hyperdrive",
":memory-cache",
":pyodide",
":r2",
"//src/pyodide",
"//src/pyodide:pyodide_extra_capnp",
"//src/workerd/api/node",
Expand Down Expand Up @@ -112,7 +146,6 @@ kj_test(
src = "pyodide/pyodide-test.c++",
deps = [
":pyodide",
"//src/workerd/tests:test-fixture",
],
)

Expand Down
5 changes: 4 additions & 1 deletion src/workerd/api/memory-cache.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#pragma once

#include <workerd/io/trace.h>
#include <workerd/jsg/jsg.h>
#include <workerd/util/uuid.h>

Expand All @@ -12,6 +11,10 @@

#include <set>

namespace workerd {
class SpanBuilder;
}

namespace workerd::api {

// The MemoryCache mechanism is an in-process, memory-resident data cache that
Expand Down
1 change: 0 additions & 1 deletion src/workerd/io/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ wd_cc_library(
"//src/workerd/api:data-url",
"//src/workerd/api:deferred-proxy",
"//src/workerd/api:encoding",
"//src/workerd/api:r2-api_capnp",
"//src/workerd/api:url",
"//src/workerd/jsg",
"//src/workerd/util:autogate",
Expand Down
Loading

0 comments on commit 09f3380

Please sign in to comment.