Skip to content

Commit 916f404

Browse files
Copilotphlax
andcommitted
Use WORKSPACE.bzlmod for envoy dependencies instead of module extension
Co-authored-by: phlax <[email protected]>
1 parent 1a64b95 commit 916f404

File tree

3 files changed

+36
-49
lines changed

3 files changed

+36
-49
lines changed

MODULE.bazel

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,8 @@ archive_override(
2020
integrity = "sha256-kx4r36cRfb/2at8z85cSzRbQ6y27VIc5tb8sb/AtMlo=",
2121
)
2222

23-
# Non-module dependencies (envoy, envoy_archive, bootstrap)
24-
# These cannot be handled via standard bzlmod because:
25-
# - envoy has local_path_overrides in MODULE.bazel that don't work as external deps
26-
# - envoy_archive has no MODULE.bazel
27-
# - bootstrap needs a custom BUILD file
28-
non_module_deps = use_extension("//:deps.bzl", "non_module_dependencies")
29-
use_repo(non_module_deps, "com_github_twbs_bootstrap", "envoy", "envoy_archive")
23+
# Note: envoy, envoy_archive, and bootstrap are loaded via WORKSPACE.bzlmod
24+
# because envoy's WORKSPACE needs to run to load its dependencies (like zstd)
3025

3126
# Setup jq toolchain from aspect_bazel_lib
3227
bazel_lib_toolchains = use_extension("@aspect_bazel_lib//lib:extensions.bzl", "toolchains")

WORKSPACE.bzlmod

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# WORKSPACE.bzlmod
2+
# This file supplements MODULE.bazel for dependencies that cannot be expressed in pure bzlmod.
3+
# In bzlmod mode, both MODULE.bazel and WORKSPACE.bzlmod are processed.
4+
5+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
6+
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
7+
load("//:versions.bzl", "VERSIONS")
8+
9+
# Bootstrap CSS framework - needs custom BUILD file
10+
bootstrap = VERSIONS["com_github_twbs_bootstrap"]
11+
http_archive(
12+
name = "com_github_twbs_bootstrap",
13+
urls = [url.format(repo = bootstrap["repo"], version = bootstrap["version"]) for url in bootstrap["urls"]],
14+
sha256 = bootstrap["sha256"],
15+
strip_prefix = bootstrap["strip_prefix"].format(version = bootstrap["version"]),
16+
build_file = "@envoy-website//bazel:bootstrap.BUILD",
17+
)
18+
19+
# envoy - for documentation building
20+
envoy = VERSIONS["envoy"]
21+
http_archive(
22+
name = "envoy",
23+
urls = [url.format(repo = envoy["repo"], version = envoy["version"]) for url in envoy["urls"]],
24+
sha256 = envoy["sha256"],
25+
strip_prefix = envoy["strip_prefix"].format(version = envoy["version"]),
26+
)
27+
28+
# envoy_archive - contains versioned documentation
29+
envoy_archive = VERSIONS["envoy_archive"]
30+
git_repository(
31+
name = "envoy_archive",
32+
remote = "https://github.com/{repo}".format(repo = envoy_archive["repo"]),
33+
commit = envoy_archive["version"],
34+
)

deps.bzl

Lines changed: 0 additions & 42 deletions
This file was deleted.

0 commit comments

Comments
 (0)