Skip to content

Commit

Permalink
Lock down //rs/nns/governance. It is what I call a "monolithic" lib. …
Browse files Browse the repository at this point in the history
…Ideally, we would chop it up. Some of the pieces would have more visibility than others. In any case, this is a step in the right direction, made possible by previous commit.
  • Loading branch information
daniel-wong-dfinity-org committed Jan 21, 2025
1 parent 3233db4 commit ee1c920
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bazel/canisters.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -135,12 +135,14 @@ def rust_canister(name, service_file, visibility = ["//visibility:public"], test
native.alias(
name = name,
actual = name + ".wasm",
visibility = visibility,
)

# DID service related targets
native.alias(
name = name + ".didfile",
actual = service_file,
visibility = visibility,
)
did_git_test(
name = name + "_did_git_test",
Expand Down
16 changes: 14 additions & 2 deletions rs/nns/governance/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ load("//bazel:defs.bzl", "rust_bench", "rust_test_suite_with_extra_srcs")
load("//bazel:prost.bzl", "generated_files_check")
load(":feature_flags.bzl", "test_with_tla")

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

exports_files(["canister/governance.did"])
DID_FILES = glob([
"**/*.did",
])

exports_files(
DID_FILES,
visibility = [
"//visibility:public",
],
)

# Allows temporarily disabling TLA checks from the command line;
# just pass `--define tla_disabled=true` to your Bazel command
Expand Down Expand Up @@ -184,6 +193,7 @@ rust_library(

rust_library(
name = "governance--canbench_feature",
visibility = ["//visibility:private"],
srcs = LIB_SRCS,
aliases = ALIASES,
crate_features = ["canbench-rs"],
Expand Down Expand Up @@ -220,6 +230,7 @@ rust_canbench(

rust_canister(
name = "governance-canister",
visibility = ["//visibility:public"],
srcs = ["canister/canister.rs"],
aliases = ALIASES,
compile_data = ["canister/governance.did"],
Expand All @@ -234,6 +245,7 @@ rust_canister(

rust_canister(
name = "governance-canister-test",
visibility = ["//visibility:public"],
srcs = [
"canister/canister.rs",
"canister/tla_ledger.rs",
Expand Down

0 comments on commit ee1c920

Please sign in to comment.