Skip to content

Commit eae1d77

Browse files
committed
Replace rules_meta with with_cfg.bzl
Signed-off-by: Dom Del Nano <ddelnano@gmail.com>
1 parent 70a28e1 commit eae1d77

File tree

5 files changed

+25
-36
lines changed

5 files changed

+25
-36
lines changed

.bazelrc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,6 @@ run --remote_download_outputs=all
2222
coverage --build_runfile_links
2323
coverage --nocache_test_results
2424

25-
# Needed by rules_meta.
26-
# Follow https://github.com/fmeum/rules_meta/issues/1#issuecomment-1255828109
27-
# for updates.
28-
common --incompatible_remove_rule_name_parameter=false
29-
3025
# Get version information into the build.
3126
build --workspace_status_command=bazel/get_workspace_status.sh
3227

WORKSPACE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ pl_register_cc_toolchains()
1919
# Install Pixie Labs Dependencies.
2020
pl_deps()
2121

22+
load("@bazel_features//:deps.bzl", "bazel_features_deps")
23+
24+
bazel_features_deps()
25+
2226
# Order is important. Try to go from most basic/primitive to higher level packages.
2327
# - go_rules_dependencies
2428
# - protobuf_deps

bazel/repositories.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,8 +257,9 @@ def _pl_deps():
257257
_bazel_repo("rules_python")
258258
_bazel_repo("rules_pkg")
259259
_bazel_repo("com_github_bazelbuild_buildtools")
260-
_bazel_repo("com_github_fmeum_rules_meta")
261260
_bazel_repo("com_google_protobuf_javascript", patches = ["//bazel/external:protobuf_javascript.patch"], patch_args = ["-p1"])
261+
_bazel_repo("bazel_features")
262+
_bazel_repo("with_cfg.bzl")
262263

263264
_com_llvm_lib()
264265
_cc_deps()

bazel/repository_locations.bzl

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@
1515
# SPDX-License-Identifier: Apache-2.0
1616

1717
REPOSITORY_LOCATIONS = dict(
18+
bazel_features = dict(
19+
sha256 = "07271d0f6b12633777b69020c4cb1eb67b1939c0cf84bb3944dc85cc250c0c01",
20+
strip_prefix = "bazel_features-1.38.0",
21+
urls = ["https://github.com/bazel-contrib/bazel_features/releases/download/v1.38.0/bazel_features-v1.38.0.tar.gz"],
22+
),
1823
bazel_gazelle = dict(
1924
sha256 = "d76bf7a60fd8b050444090dfa2837a4eaf9829e1165618ee35dceca5cbdf58d5",
2025
urls = [
@@ -81,13 +86,6 @@ REPOSITORY_LOCATIONS = dict(
8186
strip_prefix = "tdigest-85e0f70092460e60236821db4c25143768d3da12",
8287
urls = ["https://github.com/pixie-io/tdigest/archive/85e0f70092460e60236821db4c25143768d3da12.tar.gz"],
8388
),
84-
com_github_fmeum_rules_meta = dict(
85-
sha256 = "ed3ed909e6e3f34a11d7c2adcc461535975a875fe434719540a4e6f63434a866",
86-
strip_prefix = "rules_meta-0.0.4",
87-
urls = [
88-
"https://github.com/fmeum/rules_meta/archive/refs/tags/v0.0.4.tar.gz",
89-
],
90-
),
9189
com_github_gflags_gflags = dict(
9290
sha256 = "9e1a38e2dcbb20bb10891b5a171de2e5da70e0a50fff34dd4b0c2c6d75043909",
9391
strip_prefix = "gflags-524b83d0264cb9f1b2d134c564ef1aa23f207a41",
@@ -505,6 +503,12 @@ REPOSITORY_LOCATIONS = dict(
505503
),
506504
)
507505

506+
REPOSITORY_LOCATIONS["with_cfg.bzl"] = dict(
507+
sha256 = "c7af6227d24499438fa0bb96fe4034e163d8c807b06f7c0645f3654448268b84",
508+
strip_prefix = "with_cfg.bzl-0.11.0",
509+
urls = ["https://github.com/fmeum/with_cfg.bzl/releases/download/v0.11.0/with_cfg.bzl-v0.11.0.tar.gz"],
510+
)
511+
508512
# To modify one of the forked repos below:
509513
# 1. Make the changes to the repo and push the changes to the `pixie` on github.
510514
# 2. Update the commit below to point to the commit hash of the new `pixie` branch.

bazel/toolchain_transitions.bzl

Lines changed: 8 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,15 @@
1414
#
1515
# SPDX-License-Identifier: Apache-2.0
1616

17-
load("@com_github_fmeum_rules_meta//meta:defs.bzl", "meta")
17+
load("@with_cfg.bzl", "with_cfg")
1818
load("//bazel/test_runners/qemu_with_kernel:runner.bzl", "qemu_with_kernel_interactive_runner")
1919

20-
java_graal_binary = meta.wrap_with_transition(
21-
native.java_binary,
22-
{
23-
"java_runtime_version": meta.replace_with("remotejdk_openjdk_graal_17"),
24-
},
25-
executable = True,
26-
)
20+
java_graal_binary, _java_graal_binary_internal = with_cfg(native.java_binary).set(
21+
"java_runtime_version", "remotejdk_openjdk_graal_17").build()
2722

28-
cc_clang_binary = meta.wrap_with_transition(
29-
native.cc_binary,
30-
{
31-
"@//bazel/cc_toolchains:compiler": meta.replace_with("clang"),
32-
"@//bazel/cc_toolchains:libc_version": meta.replace_with("glibc2_36"),
33-
},
34-
executable = True,
35-
)
23+
cc_clang_binary, _cc_clang_binary_internal = with_cfg(native.cc_binary).set(
24+
Label("@//bazel/cc_toolchains:compiler"), "clang").set(
25+
Label("@//bazel/cc_toolchains:libc_version"), "glibc2_36").build()
3626

37-
qemu_interactive_runner = meta.wrap_with_transition(
38-
qemu_with_kernel_interactive_runner,
39-
{
40-
"@//bazel/cc_toolchains:libc_version": meta.replace_with("glibc2_36"),
41-
},
42-
executable = True,
43-
)
27+
qemu_interactive_runner, _qemu_interactive_runner_internal = with_cfg(qemu_with_kernel_interactive_runner).set(
28+
Label("@//bazel/cc_toolchains:libc_version"), "glibc2_36").build()

0 commit comments

Comments
 (0)