Skip to content

Commit

Permalink
Added missing modules to various workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
UebelAndre committed Jan 9, 2025
1 parent f329c0c commit 39317a2
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 2 deletions.
8 changes: 7 additions & 1 deletion examples/all_deps_vendor/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ register_toolchains("@rust_toolchains//:all")
###############################################################################
# R U S T C R A T E S
###############################################################################
use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")

deps = use_extension("//:extensions.bzl", "rust_example")
use_repo(
deps,
"basic",
"basic__bzip2-0.3.3",
)
2 changes: 1 addition & 1 deletion examples/all_deps_vendor/basic/3rdparty/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ crates_vendor(
gen_build_script = True,
)],
},
cargo_lockfile = "Cargo.Bazel.lock",
cargo_lockfile = "Cargo.lock",
generate_build_scripts = False,
mode = "remote",
packages = {
Expand Down
23 changes: 23 additions & 0 deletions examples/all_deps_vendor/extensions.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
"""Bzlmod module extensions"""

load("//basic/3rdparty/crates:crates.bzl", basic_crate_repositories = "crate_repositories")

def _rust_example_impl(module_ctx):
# This should contain the subset of WORKSPACE.bazel that defines
# repositories.
direct_deps = []

direct_deps.extend(basic_crate_repositories())

# is_dev_dep is ignored here. It's not relevant for internal_deps, as dev
# dependencies are only relevant for module extensions that can be used
# by other MODULES.
return module_ctx.extension_metadata(
root_module_direct_deps = [repo.repo for repo in direct_deps],
root_module_direct_dev_deps = [],
)

rust_example = module_extension(
doc = "Dependencies for the rules_rust examples.",
implementation = _rust_example_impl,
)
4 changes: 4 additions & 0 deletions examples/android/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ local_path_override(
path = "../..",
)

bazel_dep(
name = "platforms",
version = "0.0.10",
)
bazel_dep(
name = "rules_cc",
version = "0.0.17",
Expand Down
4 changes: 4 additions & 0 deletions examples/ffi/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ bazel_dep(
name = "platforms",
version = "0.0.10",
)
bazel_dep(
name = "rules_cc",
version = "0.0.17",
)

###############################################################################
# T O O L C H A I N S
Expand Down
1 change: 1 addition & 0 deletions examples/hello_world/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_doc")
load("@rules_shell//shell:sh_test.bzl", "sh_test")

package(default_visibility = ["//visibility:public"])

Expand Down
4 changes: 4 additions & 0 deletions examples/hello_world/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ bazel_dep(
name = "bazel_skylib",
version = "1.7.1",
)
bazel_dep(
name = "rules_shell",
version = "0.3.0",
)

# To do third party dependencies, you have multiple options:

Expand Down
4 changes: 4 additions & 0 deletions examples/musl_cross_compiling/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ bazel_dep(
name = "rules_shell",
version = "0.3.0",
)
bazel_dep(
name = "bazel_skylib",
version = "1.7.1",
)

RUST_EDITION = "2021"

Expand Down
5 changes: 5 additions & 0 deletions test/no_std/MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ local_path_override(
path = "../..",
)

bazel_dep(
name = "rules_cc",
version = "0.0.17",
)

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
Expand Down

0 comments on commit 39317a2

Please sign in to comment.