Skip to content

Commit 7c9e51d

Browse files
committed
feat: make use of prebuilt toolchain for e2e
Make sure all of our e2e use a shared prebuilt bazeldnf binary instead of each one building their own, this simplifies our MODULE.bazel for all of our e2e tests considerably as we no longer to keep prebuilt protoc or golang dependencies
1 parent 2b72e0e commit 7c9e51d

File tree

12 files changed

+5
-174
lines changed

12 files changed

+5
-174
lines changed

e2e/bazel-bzlmod-lock-file-from-args/.bazelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc
77

88
# Specific project flags go here if we have some
99
common --enable_bzlmod
10-
common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain
11-
12-
# prebuilt protoc
13-
common --incompatible_enable_proto_toolchain_resolution
1410

1511
# Load any settings & overrides specific to the current user from `.bazelrc.user`.
1612
# This file should appear in `.gitignore` so that settings are not shared with team members. This

e2e/bazel-bzlmod-lock-file-from-args/MODULE.bazel

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,6 @@ local_path_override(
99
)
1010

1111
bazel_dep(name = "rules_pkg", version = "1.1.0")
12-
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "rules_go")
13-
14-
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
15-
go_sdk.download(version = "1.24.1")
16-
17-
bazel_dep(name = "gazelle", version = "0.47.0")
18-
19-
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
20-
go_deps.from_file(go_mod = "@bazeldnf//:go.mod")
21-
use_repo(
22-
go_deps,
23-
"com_github_adrg_xdg",
24-
"com_github_bazelbuild_buildtools",
25-
"com_github_crillab_gophersat",
26-
"com_github_hashicorp_go_retryablehttp",
27-
"com_github_jdx_go_netrc",
28-
"com_github_klauspost_compress",
29-
"com_github_onsi_gomega",
30-
"com_github_sassoftware_go_rpmutils",
31-
"com_github_sirupsen_logrus",
32-
"com_github_spf13_cobra",
33-
"com_github_ulikunitz_xz",
34-
"io_k8s_sigs_yaml",
35-
"org_golang_x_crypto",
36-
"org_golang_x_exp",
37-
)
3812

3913
bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain")
4014
bazeldnf_toolchain.register(disable = True)
@@ -63,13 +37,3 @@ use_repo(
6337
bazeldnf,
6438
"bazeldnf_rpms",
6539
)
66-
67-
bazel_dep(name = "toolchains_protoc", version = "0.6.0", dev_dependency = True)
68-
69-
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc", dev_dependency = True)
70-
use_repo(protoc, "toolchains_protoc_hub")
71-
72-
register_toolchains(
73-
"@toolchains_protoc_hub//:all",
74-
dev_dependency = True,
75-
)

e2e/bazel-bzlmod-lock-file/.bazelrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import %workspace%/../../.aspect/bazelrc/debug.bazelrc
66
import %workspace%/../../.aspect/bazelrc/performance.bazelrc
77

88
common --enable_bzlmod
9-
common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain
109

1110
# Specific project flags go here if we have some
1211

e2e/bazel-bzlmod-lock-file/MODULE.bazel

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,9 @@ local_path_override(
99
)
1010

1111
bazel_dep(name = "rules_pkg", version = "1.1.0")
12-
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "rules_go")
1312

14-
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
15-
go_sdk.download(version = "1.24.1")
16-
17-
bazel_dep(name = "gazelle", version = "0.47.0")
18-
19-
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
20-
go_deps.from_file(go_mod = "@bazeldnf//:go.mod")
21-
use_repo(
22-
go_deps,
23-
"com_github_adrg_xdg",
24-
"com_github_bazelbuild_buildtools",
25-
"com_github_crillab_gophersat",
26-
"com_github_hashicorp_go_retryablehttp",
27-
"com_github_jdx_go_netrc",
28-
"com_github_klauspost_compress",
29-
"com_github_onsi_gomega",
30-
"com_github_sassoftware_go_rpmutils",
31-
"com_github_sirupsen_logrus",
32-
"com_github_spf13_cobra",
33-
"com_github_ulikunitz_xz",
34-
"io_k8s_sigs_yaml",
35-
"org_golang_x_crypto",
36-
"org_golang_x_exp",
37-
)
38-
39-
bazel_dep(name = "toolchains_protoc", version = "0.6.0")
40-
41-
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
42-
protoc.toolchain(
43-
google_protobuf = "com_google_protobuf",
44-
version = "v27.3",
45-
)
46-
use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")
47-
48-
register_toolchains(
49-
"@toolchains_protoc_hub//:all",
50-
dev_dependency = True,
51-
)
13+
bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain")
14+
bazeldnf_toolchain.register(disable = True)
5215

5316
bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf")
5417
bazeldnf.config(

e2e/bazel-bzlmod-toolchain-from-source-lock-file/.bazelrc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc
88

99
# Specific project flags go here if we have some
1010
common --enable_bzlmod
11-
common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain
12-
13-
# prebuilt protoc
14-
common --incompatible_enable_proto_toolchain_resolution
1511

1612
# Load any settings & overrides specific to the current user from `.bazelrc.user`.
1713
# This file should appear in `.gitignore` so that settings are not shared with team members. This

e2e/bazel-bzlmod-toolchain-from-source-lock-file/MODULE.bazel

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ local_path_override(
99
)
1010

1111
bazel_dep(name = "rules_pkg", version = "1.1.0")
12-
bazel_dep(name = "toolchains_protoc", version = "0.6.0")
1312

1413
bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf")
1514
bazeldnf.toolchain(disable = True)

e2e/bazel-bzlmod-toolchain-from-source/.bazelrc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import %workspace%/../../.aspect/bazelrc/performance.bazelrc
77

88
# Specific project flags go here if we have some
99
common --enable_bzlmod
10-
common --extra_toolchains=@bazeldnf//cmd:bazeldnf-host-toolchain
11-
common --incompatible_enable_proto_toolchain_resolution
1210

1311
# Load any settings & overrides specific to the current user from `.bazelrc.user`.
1412
# This file should appear in `.gitignore` so that settings are not shared with team members. This

e2e/bazel-bzlmod-toolchain-from-source/MODULE.bazel

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -9,45 +9,6 @@ local_path_override(
99
)
1010

1111
bazel_dep(name = "rules_pkg", version = "1.1.0")
12-
bazel_dep(name = "rules_go", version = "0.59.0", repo_name = "rules_go")
13-
14-
go_sdk = use_extension("@rules_go//go:extensions.bzl", "go_sdk")
15-
go_sdk.download(version = "1.24.1")
16-
17-
bazel_dep(name = "gazelle", version = "0.47.0")
18-
bazel_dep(name = "toolchains_protoc", version = "0.6.0")
19-
20-
protoc = use_extension("@toolchains_protoc//protoc:extensions.bzl", "protoc")
21-
protoc.toolchain(
22-
google_protobuf = "com_google_protobuf",
23-
version = "v27.3",
24-
)
25-
use_repo(protoc, "com_google_protobuf", "toolchains_protoc_hub")
26-
27-
register_toolchains(
28-
"@toolchains_protoc_hub//:all",
29-
dev_dependency = True,
30-
)
31-
32-
go_deps = use_extension("@gazelle//:extensions.bzl", "go_deps")
33-
go_deps.from_file(go_mod = "@bazeldnf//:go.mod")
34-
use_repo(
35-
go_deps,
36-
"com_github_adrg_xdg",
37-
"com_github_bazelbuild_buildtools",
38-
"com_github_crillab_gophersat",
39-
"com_github_hashicorp_go_retryablehttp",
40-
"com_github_jdx_go_netrc",
41-
"com_github_klauspost_compress",
42-
"com_github_onsi_gomega",
43-
"com_github_sassoftware_go_rpmutils",
44-
"com_github_sirupsen_logrus",
45-
"com_github_spf13_cobra",
46-
"com_github_ulikunitz_xz",
47-
"io_k8s_sigs_yaml",
48-
"org_golang_x_crypto",
49-
"org_golang_x_exp",
50-
)
5112

5213
bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain")
5314
bazeldnf_toolchain.register(disable = True)

e2e/bazel-bzlmod/MODULE.bazel

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ local_path_override(
88
path = "../..",
99
)
1010

11+
bazeldnf_toolchain = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf_toolchain")
12+
bazeldnf_toolchain.register(disable = True)
13+
1114
bazel_dep(name = "rules_pkg", version = "1.1.0")
1215

1316
bazeldnf = use_extension("@bazeldnf//bazeldnf:extensions.bzl", "bazeldnf")

e2e/bazel-workspace/WORKSPACE

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,10 @@ load("@bazeldnf//bazeldnf:defs.bzl", "rpm")
2222
load(
2323
"@bazeldnf//bazeldnf:repositories.bzl",
2424
"bazeldnf_dependencies",
25-
"bazeldnf_register_toolchains",
2625
)
2726

2827
bazeldnf_dependencies()
2928

30-
bazeldnf_register_toolchains(
31-
name = "bazeldnf_prebuilt",
32-
)
33-
3429
rpm(
3530
name = "libvirt-devel-11.0.0-1.fc42.x86_64.rpm",
3631
sha256 = "dba37bbe57903afe49b5666f1781eb50001baa81af4584b355db0b6a2afad9fa",

0 commit comments

Comments
 (0)