Try moving promises build config out of root (#27400)

* Try moving promises build config out of root

* buildifier

* fix copyright
reviewable/pr27402/r7^2
Craig Tiller 3 years ago committed by GitHub
parent 9df6d1d41e
commit fd64bbebb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 335
      BUILD
  2. 2
      bazel/grpc_build_system.bzl
  3. 355
      src/core/lib/promise/BUILD
  4. 76
      test/core/promise/BUILD

335
BUILD

@ -887,341 +887,6 @@ grpc_cc_library(
], ],
) )
grpc_cc_library(
name = "poll",
external_deps = [
"absl/types:variant",
],
language = "c++",
public_hdrs = [
"src/core/lib/promise/poll.h",
],
deps = ["gpr_platform"],
)
grpc_cc_library(
name = "context",
language = "c++",
public_hdrs = [
"src/core/lib/promise/context.h",
],
deps = [
"gpr_platform",
"gpr_tls",
],
)
grpc_cc_library(
name = "map",
language = "c++",
public_hdrs = ["src/core/lib/promise/map.h"],
deps = [
"gpr_platform",
"poll",
"promise_like",
],
)
grpc_cc_library(
name = "promise",
external_deps = [
"absl/types:optional",
],
language = "c++",
public_hdrs = [
"src/core/lib/promise/promise.h",
],
deps = [
"gpr_platform",
"poll",
"promise_like",
],
)
grpc_cc_library(
name = "promise_like",
language = "c++",
public_hdrs = [
"src/core/lib/promise/detail/promise_like.h",
],
deps = [
"gpr_platform",
"poll",
],
)
grpc_cc_library(
name = "promise_factory",
language = "c++",
public_hdrs = [
"src/core/lib/promise/detail/promise_factory.h",
],
deps = [
"gpr_platform",
"poll",
"promise_like",
],
)
grpc_cc_library(
name = "if",
external_deps = [
"absl/status:statusor",
],
language = "c++",
public_hdrs = ["src/core/lib/promise/if.h"],
deps = [
"gpr_platform",
"poll",
"promise_factory",
],
)
grpc_cc_library(
name = "promise_status",
external_deps = [
"absl/status",
"absl/status:statusor",
],
language = "c++",
public_hdrs = [
"src/core/lib/promise/detail/status.h",
],
deps = ["gpr_platform"],
)
grpc_cc_library(
name = "race",
language = "c++",
public_hdrs = ["src/core/lib/promise/race.h"],
deps = [
"gpr_platform",
"poll",
],
)
grpc_cc_library(
name = "loop",
language = "c++",
public_hdrs = [
"src/core/lib/promise/loop.h",
],
deps = [
"gpr_platform",
"poll",
"promise_factory",
],
)
grpc_cc_library(
name = "switch",
language = "c++",
public_hdrs = [
"src/core/lib/promise/detail/switch.h",
],
deps = ["gpr_platform"],
)
grpc_cc_library(
name = "basic_join",
language = "c++",
public_hdrs = [
"src/core/lib/promise/detail/basic_join.h",
],
deps = [
"bitset",
"construct_destruct",
"gpr_platform",
"poll",
"promise_factory",
],
)
grpc_cc_library(
name = "join",
language = "c++",
public_hdrs = [
"src/core/lib/promise/join.h",
],
deps = [
"basic_join",
"gpr_platform",
],
)
grpc_cc_library(
name = "try_join",
language = "c++",
public_hdrs = [
"src/core/lib/promise/try_join.h",
],
deps = [
"basic_join",
"gpr_platform",
"promise_status",
],
)
grpc_cc_library(
name = "basic_seq",
language = "c++",
public_hdrs = [
"src/core/lib/promise/detail/basic_seq.h",
],
deps = [
"construct_destruct",
"gpr_platform",
"poll",
"promise_factory",
"switch",
],
)
grpc_cc_library(
name = "seq",
language = "c++",
public_hdrs = [
"src/core/lib/promise/seq.h",
],
deps = [
"basic_seq",
"gpr_platform",
],
)
grpc_cc_library(
name = "try_seq",
language = "c++",
public_hdrs = [
"src/core/lib/promise/try_seq.h",
],
deps = [
"basic_seq",
"gpr_platform",
"promise_status",
],
)
grpc_cc_library(
name = "activity",
srcs = [
"src/core/lib/promise/activity.cc",
],
language = "c++",
public_hdrs = [
"src/core/lib/promise/activity.h",
],
deps = [
"atomic_utils",
"construct_destruct",
"context",
"gpr_base",
"gpr_codegen",
"poll",
"promise_factory",
"promise_status",
],
)
grpc_cc_library(
name = "exec_ctx_wakeup_scheduler",
hdrs = [
"src/core/lib/promise/exec_ctx_wakeup_scheduler.h",
],
language = "c++",
deps = [
"exec_ctx",
"gpr_base",
],
)
grpc_cc_library(
name = "wait_set",
external_deps = [
"absl/container:flat_hash_set",
],
language = "c++",
public_hdrs = [
"src/core/lib/promise/wait_set.h",
],
deps = [
"activity",
"gpr_platform",
],
)
grpc_cc_library(
name = "intra_activity_waiter",
language = "c++",
public_hdrs = [
"src/core/lib/promise/intra_activity_waiter.h",
],
deps = [
"activity",
"gpr_platform",
],
)
grpc_cc_library(
name = "latch",
external_deps = [
"absl/status",
],
language = "c++",
public_hdrs = [
"src/core/lib/promise/latch.h",
],
deps = [
"activity",
"gpr_platform",
"intra_activity_waiter",
],
)
grpc_cc_library(
name = "observable",
language = "c++",
public_hdrs = [
"src/core/lib/promise/observable.h",
],
deps = [
"activity",
"gpr_platform",
"wait_set",
],
)
grpc_cc_library(
name = "pipe",
external_deps = [
"absl/status",
],
language = "c++",
public_hdrs = [
"src/core/lib/promise/pipe.h",
],
deps = [
"activity",
"gpr_platform",
"intra_activity_waiter",
],
)
grpc_cc_library(
name = "for_each",
external_deps = [
"absl/status",
"absl/types:variant",
],
language = "c++",
public_hdrs = ["src/core/lib/promise/for_each.h"],
deps = [
"gpr_platform",
"poll",
"promise_factory",
],
)
grpc_cc_library( grpc_cc_library(
name = "ref_counted", name = "ref_counted",
language = "c++", language = "c++",

@ -350,6 +350,8 @@ def grpc_package(name, visibility = "private", features = []):
visibility = ["//visibility:public"] visibility = ["//visibility:public"]
elif visibility == "private": elif visibility == "private":
visibility = [] visibility = []
elif visibility == "grpc":
visibility = ["//:__subpackages__"]
else: else:
fail("Unknown visibility " + visibility) fail("Unknown visibility " + visibility)

@ -0,0 +1,355 @@
# Copyright 2021 gRPC authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_package")
licenses(["notice"])
grpc_package(
name = "test/core/promise",
visibility = "grpc",
)
grpc_cc_library(
name = "poll",
external_deps = [
"absl/types:variant",
],
language = "c++",
public_hdrs = [
"poll.h",
],
deps = ["//:gpr_platform"],
)
grpc_cc_library(
name = "context",
language = "c++",
public_hdrs = [
"context.h",
],
deps = [
"//:gpr_platform",
"//:gpr_tls",
],
)
grpc_cc_library(
name = "map",
language = "c++",
public_hdrs = ["map.h"],
deps = [
"poll",
"promise_like",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "promise",
external_deps = [
"absl/types:optional",
],
language = "c++",
public_hdrs = [
"promise.h",
],
deps = [
"poll",
"promise_like",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "promise_like",
language = "c++",
public_hdrs = [
"detail/promise_like.h",
],
deps = [
"poll",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "promise_factory",
language = "c++",
public_hdrs = [
"detail/promise_factory.h",
],
deps = [
"poll",
"promise_like",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "if",
external_deps = [
"absl/status:statusor",
],
language = "c++",
public_hdrs = ["if.h"],
deps = [
"poll",
"promise_factory",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "promise_status",
external_deps = [
"absl/status",
"absl/status:statusor",
],
language = "c++",
public_hdrs = [
"detail/status.h",
],
deps = ["//:gpr_platform"],
)
grpc_cc_library(
name = "race",
language = "c++",
public_hdrs = ["race.h"],
deps = [
"poll",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "loop",
language = "c++",
public_hdrs = [
"loop.h",
],
deps = [
"poll",
"promise_factory",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "switch",
language = "c++",
public_hdrs = [
"detail/switch.h",
],
deps = ["//:gpr_platform"],
)
grpc_cc_library(
name = "basic_join",
language = "c++",
public_hdrs = [
"detail/basic_join.h",
],
deps = [
"poll",
"promise_factory",
"//:bitset",
"//:construct_destruct",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "join",
language = "c++",
public_hdrs = [
"join.h",
],
deps = [
"basic_join",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "try_join",
language = "c++",
public_hdrs = [
"try_join.h",
],
deps = [
"basic_join",
"promise_status",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "basic_seq",
language = "c++",
public_hdrs = [
"detail/basic_seq.h",
],
deps = [
"poll",
"promise_factory",
"switch",
"//:construct_destruct",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "seq",
language = "c++",
public_hdrs = [
"seq.h",
],
deps = [
"basic_seq",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "try_seq",
language = "c++",
public_hdrs = [
"try_seq.h",
],
deps = [
"basic_seq",
"promise_status",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "activity",
srcs = [
"activity.cc",
],
language = "c++",
public_hdrs = [
"activity.h",
],
deps = [
"context",
"poll",
"promise_factory",
"promise_status",
"//:atomic_utils",
"//:construct_destruct",
"//:gpr_base",
"//:gpr_codegen",
],
)
grpc_cc_library(
name = "wait_set",
external_deps = [
"absl/container:flat_hash_set",
],
language = "c++",
public_hdrs = [
"wait_set.h",
],
deps = [
"activity",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "intra_activity_waiter",
language = "c++",
public_hdrs = [
"intra_activity_waiter.h",
],
deps = [
"activity",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "latch",
external_deps = [
"absl/status",
],
language = "c++",
public_hdrs = [
"latch.h",
],
deps = [
"activity",
"intra_activity_waiter",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "observable",
language = "c++",
public_hdrs = [
"observable.h",
],
deps = [
"activity",
"wait_set",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "pipe",
external_deps = [
"absl/status",
],
language = "c++",
public_hdrs = [
"pipe.h",
],
deps = [
"activity",
"intra_activity_waiter",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "for_each",
external_deps = [
"absl/status",
"absl/types:variant",
],
language = "c++",
public_hdrs = ["for_each.h"],
deps = [
"poll",
"promise_factory",
"//:gpr_platform",
],
)
grpc_cc_library(
name = "exec_ctx_wakeup_scheduler",
language = "c++",
public_hdrs = ["exec_ctx_wakeup_scheduler.h"],
deps = [
"//:exec_ctx",
"//:gpr_platform",
],
)

@ -38,7 +38,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:poll", "//src/core/lib/promise:poll",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -50,7 +50,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:context", "//src/core/lib/promise:context",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -62,7 +62,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:promise", "//src/core/lib/promise",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -79,8 +79,8 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:map", "//src/core/lib/promise",
"//:promise", "//src/core/lib/promise:map",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -92,7 +92,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:race", "//src/core/lib/promise:race",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -108,8 +108,8 @@ grpc_cc_test(
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:capture", "//:capture",
"//:promise", "//src/core/lib/promise",
"//:promise_factory", "//src/core/lib/promise:promise_factory",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -121,7 +121,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:if", "//src/core/lib/promise:if",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -133,8 +133,8 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:loop", "//src/core/lib/promise:loop",
"//:seq", "//src/core/lib/promise:seq",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -146,7 +146,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:join", "//src/core/lib/promise:join",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -158,7 +158,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:try_join", "//src/core/lib/promise:try_join",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -170,7 +170,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:seq", "//src/core/lib/promise:seq",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -182,7 +182,7 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:try_seq", "//src/core/lib/promise:try_seq",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -195,11 +195,11 @@ grpc_cc_test(
uses_polling = False, uses_polling = False,
deps = [ deps = [
"test_wakeup_schedulers", "test_wakeup_schedulers",
"//:activity", "//src/core/lib/promise",
"//:join", "//src/core/lib/promise:activity",
"//:promise", "//src/core/lib/promise:join",
"//:seq", "//src/core/lib/promise:seq",
"//:wait_set", "//src/core/lib/promise:wait_set",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -212,9 +212,9 @@ grpc_cc_test(
uses_polling = False, uses_polling = False,
deps = [ deps = [
"test_wakeup_schedulers", "test_wakeup_schedulers",
"//:join", "//src/core/lib/promise:join",
"//:latch", "//src/core/lib/promise:latch",
"//:seq", "//src/core/lib/promise:seq",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -227,9 +227,9 @@ grpc_cc_test(
uses_polling = False, uses_polling = False,
deps = [ deps = [
"test_wakeup_schedulers", "test_wakeup_schedulers",
"//:observable", "//src/core/lib/promise",
"//:promise", "//src/core/lib/promise:observable",
"//:seq", "//src/core/lib/promise:seq",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -242,12 +242,12 @@ grpc_cc_test(
uses_polling = False, uses_polling = False,
deps = [ deps = [
"test_wakeup_schedulers", "test_wakeup_schedulers",
"//:for_each", "//src/core/lib/promise:for_each",
"//:join", "//src/core/lib/promise:join",
"//:map", "//src/core/lib/promise:map",
"//:observable", "//src/core/lib/promise:observable",
"//:pipe", "//src/core/lib/promise:pipe",
"//:seq", "//src/core/lib/promise:seq",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -260,10 +260,10 @@ grpc_cc_test(
uses_polling = False, uses_polling = False,
deps = [ deps = [
"test_wakeup_schedulers", "test_wakeup_schedulers",
"//:join", "//src/core/lib/promise",
"//:pipe", "//src/core/lib/promise:join",
"//:promise", "//src/core/lib/promise:pipe",
"//:seq", "//src/core/lib/promise:seq",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )
@ -288,8 +288,8 @@ grpc_cc_test(
language = "c++", language = "c++",
uses_polling = False, uses_polling = False,
deps = [ deps = [
"//:activity", "//src/core/lib/promise:activity",
"//:exec_ctx_wakeup_scheduler", "//src/core/lib/promise:exec_ctx_wakeup_scheduler",
"//test/core/util:grpc_suppressions", "//test/core/util:grpc_suppressions",
], ],
) )

Loading…
Cancel
Save