Skip to content

Commit 52cc758

Browse files
authored
Cfg5 filter update (#20)
* filter exact named files * prepare release + update integrity of released modules * update buildfifer + cleanup
1 parent 127f578 commit 52cc758

File tree

21 files changed

+216
-242
lines changed

21 files changed

+216
-242
lines changed

MODULE.bazel

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""Module to handle everything bazel related concerning custom modules and rules"""
22

3-
bazel_dep(name = "rules_cc", version = "0.1.1")
4-
bazel_dep(name = "buildifier_prebuilt", version = "8.0.0")
3+
bazel_dep(name = "rules_cc", version = "0.2.16")
4+
bazel_dep(name = "rules_shell", version = "0.6.1")
5+
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1")
56
bazel_dep(name = "stardoc", version = "0.7.2")
67
bazel_dep(name = "ape", version = "1.0.1")
78
bazel_dep(name = "aspect_rules_js", version = "2.0.1")

MODULE.bazel.lock

Lines changed: 8 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bcr-modules/macros/add_module_macro.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
load("@rules_pkg//:mappings.bzl", "pkg_files")
44
load("@rules_pkg//:pkg.bzl", "pkg_zip")
5+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
56
load("//bcr-modules/rules:defs.bzl", "metadata_json")
67

78
def _add_module_macro_impl(name, visibility, versions, **kwargs):
@@ -37,7 +38,7 @@ def _add_module_macro_impl(name, visibility, versions, **kwargs):
3738
)
3839

3940
# bazel run target to directly put the generated metadata information into the vector-bazel-central-registry/modules folder in the repo
40-
native.sh_binary(
41+
sh_binary(
4142
name = name + ".add_to_repo",
4243
srcs = ["//tools:add_module.sh"],
4344
args = ["$(location @ape//ape:unzip)", "$(location " + name + ")", "vector-bazel-central-registry/modules/" + name],

bcr-modules/macros/module_macro.bzl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ def _module_macro_impl(
3636
# used to package our module archive while at the same time setting the mode to 0755, this had to be done via pes-cd before.
3737
pkg_tar(
3838
name = name,
39-
srcs = [name + "_srcs"] if len(pkg_files_targets) <= 0 else pkg_files_targets +
40-
[
41-
":" + name + "_BUILD_bazel",
42-
],
39+
srcs = [name + "_srcs", ":" + name + "_BUILD_bazel"] if len(pkg_files_targets) <= 0 else pkg_files_targets,
4340
extension = "tar.gz",
4441
mode = "0755",
4542
visibility = visibility,

bcr-modules/macros/upload_macro.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""A simple macro to build upload and download targets for a given module version and urls"""
22

3+
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
34
load("//bcr-modules:urls.bzl", "DEFAULT_DEV_GIT_UPLOAD_URL", "DEFAULT_PROD_GIT_UPLOAD_URL")
45

56
def _get_url(url, upload_module_name, version):
@@ -22,7 +23,7 @@ def _upload_macro_impl(name, visibility, upload_module_name, version, archive, d
2223

2324
for target in URLS.keys():
2425
# Add a convenience function to get moduel archive_override text
25-
native.sh_binary(
26+
sh_binary(
2627
name = target + "_get_archive_override",
2728
srcs = ["//tools:get_archive_override.sh"],
2829
args = [

bcr-modules/modules/rules_cfg5/0.0.2/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ module(
5858
5959
6060
],
61+
integrity = "sha256-D2C00bzcFMYfFNhNd5HTmpGS3AaF+LDDDdoWbo0d1Wg=",
6162
module_version = "0.0.2",
6263
pkg_files_targets = [
6364
"public",
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
load("@rules_pkg//:mappings.bzl", "pkg_files")
2+
load("//bcr-modules/macros:module_macro.bzl", "module")
3+
load("//bcr-modules/macros:upload_macro.bzl", "module_upload")
4+
5+
package(default_visibility = ["//visibility:public"])
6+
7+
module_upload(
8+
name = "upload",
9+
archive = ":rules_cfg5",
10+
upload_module_name = "rules_cfg5",
11+
version = "0.0.3",
12+
)
13+
14+
pkg_files(
15+
name = "private",
16+
srcs = [
17+
"//bcr-modules/modules/rules_cfg5/srcs:private/generate.bzl",
18+
"//bcr-modules/modules/rules_cfg5/srcs:private/start.bzl",
19+
"//bcr-modules/modules/rules_cfg5/srcs:private/toolchains.bzl",
20+
],
21+
prefix = "private",
22+
)
23+
24+
pkg_files(
25+
name = "private_common",
26+
srcs = [
27+
"//bcr-modules/modules/rules_cfg5/srcs:private/common/component_refs.bzl",
28+
],
29+
prefix = "private/common",
30+
)
31+
32+
pkg_files(
33+
name = "private_templates",
34+
srcs = [
35+
"//bcr-modules/modules/rules_cfg5/srcs:private/templates/filter_linux.sh.tpl",
36+
"//bcr-modules/modules/rules_cfg5/srcs:private/templates/filter_windows.ps1.tpl",
37+
],
38+
prefix = "private/templates",
39+
)
40+
41+
pkg_files(
42+
name = "public",
43+
srcs = [
44+
"//bcr-modules/modules/rules_cfg5/srcs:BUILD.bazel",
45+
"//bcr-modules/modules/rules_cfg5/srcs:MODULE.bazel",
46+
"//bcr-modules/modules/rules_cfg5/srcs:README.md",
47+
"//bcr-modules/modules/rules_cfg5/srcs:defs.bzl",
48+
"//bcr-modules/modules/rules_cfg5/srcs:generate.bzl",
49+
],
50+
)
51+
52+
module(
53+
name = "rules_cfg5",
54+
additional_dependencies = [
55+
56+
57+
58+
59+
60+
],
61+
module_version = "0.0.3",
62+
pkg_files_targets = [
63+
"public",
64+
"private",
65+
"private_common",
66+
"private_templates",
67+
],
68+
)

bcr-modules/modules/rules_cfg5/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ module_bcr_dir(
66
name = "rules_cfg5",
77
versions = [
88
"0.0.2",
9+
"0.0.3",
910
],
1011
visibility = ["//visibility:public"],
1112
)

bcr-modules/modules/rules_cfg5/srcs/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
module(
2525
name = "rules_cfg5",
26-
version = "0.0.2",
26+
version = "0.0.3",
2727
compatibility_level = 0,
2828
)
2929

bcr-modules/modules/rules_cfg5/srcs/private/rules.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
"""Rules for cfg5"""
2525

26+
load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
27+
load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
2628
load("//rules/common:create_davinci_tool_workspace.bzl", "create_davinci_tool_workspace")
2729
#load("//rules/vtt:toolchains.bzl", "generate_tools_vtt")
2830

0 commit comments

Comments
 (0)