|
| 1 | +diff --git MODULE.bazel MODULE.bazel |
| 2 | +index daacd76..3373ccd 100644 |
| 3 | +--- MODULE.bazel |
| 4 | ++++ MODULE.bazel |
| 5 | +@@ -24,11 +24,13 @@ CPP_JSONNET_URL = ( |
| 6 | + # even exactly match a released version). |
| 7 | + http_archive( |
| 8 | + name = "cpp_jsonnet", |
| 9 | ++ patches = ["//:cpp_jsonnet.diff"], |
| 10 | + sha256 = CPP_JSONNET_SHA256, |
| 11 | + strip_prefix = CPP_JSONNET_STRIP_PREFIX, |
| 12 | + urls = [CPP_JSONNET_URL], |
| 13 | + ) |
| 14 | + |
| 15 | ++bazel_dep(name = "rules_cc", version = "0.2.16") |
| 16 | + bazel_dep(name = "gazelle", version = "0.42.0", repo_name = "bazel_gazelle") |
| 17 | + bazel_dep(name = "rules_go", version = "0.53.0", repo_name = "io_bazel_rules_go") |
| 18 | + |
| 19 | +diff --git cpp_jsonnet.diff cpp_jsonnet.diff |
| 20 | +new file mode 100644 |
| 21 | +index 0000000..0126bf4 |
| 22 | +--- /dev/null |
| 23 | ++++ cpp_jsonnet.diff |
| 24 | +@@ -0,0 +1,143 @@ |
| 25 | ++commit 218bc6532798e7a530dd5a048a6be1046b77c914 |
| 26 | ++Author: Benjamin Peterson <benjamin@engflow.com> |
| 27 | ++Date: Mon Dec 1 15:59:23 2025 -0600 |
| 28 | ++ |
| 29 | ++ add loads for cc rules to BUILD files |
| 30 | ++ |
| 31 | ++ builtin rules are removed in newer versions of Bazel |
| 32 | ++ |
| 33 | ++diff --git MODULE.bazel MODULE.bazel |
| 34 | ++index 32c00af..9e70a3b 100644 |
| 35 | ++--- MODULE.bazel |
| 36 | +++++ MODULE.bazel |
| 37 | ++@@ -5,3 +5,4 @@ module( |
| 38 | ++ |
| 39 | ++ bazel_dep(name = "googletest", version = "1.16.0") |
| 40 | ++ bazel_dep(name = "rules_python", version = "1.2.0") |
| 41 | +++bazel_dep(name = "rules_cc", version = "0.2.14") |
| 42 | ++diff --git cmd/BUILD cmd/BUILD |
| 43 | ++index 51803a4..9efb186 100644 |
| 44 | ++--- cmd/BUILD |
| 45 | +++++ cmd/BUILD |
| 46 | ++@@ -1,3 +1,6 @@ |
| 47 | +++load("@rules_cc//cc:cc_binary.bzl", "cc_binary") |
| 48 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 49 | +++ |
| 50 | ++ package(default_visibility = ["//visibility:private"]) |
| 51 | ++ |
| 52 | ++ cc_library( |
| 53 | ++diff --git core/BUILD core/BUILD |
| 54 | ++index 5508488..1e2d485 100644 |
| 55 | ++--- core/BUILD |
| 56 | +++++ core/BUILD |
| 57 | ++@@ -1,3 +1,6 @@ |
| 58 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 59 | +++load("@rules_cc//cc:cc_test.bzl", "cc_test") |
| 60 | +++ |
| 61 | ++ package(default_visibility = ["//visibility:private"]) |
| 62 | ++ |
| 63 | ++ cc_library( |
| 64 | ++diff --git cpp/BUILD cpp/BUILD |
| 65 | ++index ca996c3..43770b3 100644 |
| 66 | ++--- cpp/BUILD |
| 67 | +++++ cpp/BUILD |
| 68 | ++@@ -1,3 +1,6 @@ |
| 69 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 70 | +++load("@rules_cc//cc:cc_test.bzl", "cc_test") |
| 71 | +++ |
| 72 | ++ package(default_visibility = ["//visibility:private"]) |
| 73 | ++ |
| 74 | ++ cc_library( |
| 75 | ++diff --git examples/bazel/BUILD examples/bazel/BUILD |
| 76 | ++index 5be8463..d95cf84 100644 |
| 77 | ++--- examples/bazel/BUILD |
| 78 | +++++ examples/bazel/BUILD |
| 79 | ++@@ -1,3 +1,4 @@ |
| 80 | +++load("@rules_cc//cc:cc_binary.bzl", "cc_binary") |
| 81 | ++ load("@rules_python//python:defs.bzl", "py_binary") |
| 82 | ++ |
| 83 | ++ cc_binary( |
| 84 | ++diff --git examples/bazel/MODULE.bazel examples/bazel/MODULE.bazel |
| 85 | ++index 1888e07..728dc0b 100644 |
| 86 | ++--- examples/bazel/MODULE.bazel |
| 87 | +++++ examples/bazel/MODULE.bazel |
| 88 | ++@@ -1,5 +1,9 @@ |
| 89 | ++ # Example of using jsonnet by depending on the Bazel module. |
| 90 | ++ |
| 91 | ++ bazel_dep(name = "rules_python", version = "1.2.0") |
| 92 | +++bazel_dep(name = "rules_cc", version = "0.2.14") |
| 93 | ++ bazel_dep(name = "jsonnet") |
| 94 | ++-local_path_override(module_name = "jsonnet", path = "../..") |
| 95 | +++local_path_override( |
| 96 | +++ module_name = "jsonnet", |
| 97 | +++ path = "../..", |
| 98 | +++) |
| 99 | ++diff --git include/BUILD include/BUILD |
| 100 | ++index 3893ba4..869e438 100644 |
| 101 | ++--- include/BUILD |
| 102 | +++++ include/BUILD |
| 103 | ++@@ -1,3 +1,5 @@ |
| 104 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 105 | +++ |
| 106 | ++ package(default_visibility = ["//visibility:private"]) |
| 107 | ++ |
| 108 | ++ cc_library( |
| 109 | ++diff --git python/BUILD python/BUILD |
| 110 | ++index 513f2dc..ab5294f 100644 |
| 111 | ++--- python/BUILD |
| 112 | +++++ python/BUILD |
| 113 | ++@@ -1,3 +1,4 @@ |
| 114 | +++load("@rules_cc//cc:cc_binary.bzl", "cc_binary") |
| 115 | ++ load("@rules_python//python:defs.bzl", "py_library", "py_test") |
| 116 | ++ |
| 117 | ++ package(default_visibility = ["//visibility:private"]) |
| 118 | ++diff --git stdlib/BUILD stdlib/BUILD |
| 119 | ++index de1c31a..c7d4a70 100644 |
| 120 | ++--- stdlib/BUILD |
| 121 | +++++ stdlib/BUILD |
| 122 | ++@@ -1,3 +1,5 @@ |
| 123 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 124 | +++ |
| 125 | ++ package(default_visibility = ["//visibility:private"]) |
| 126 | ++ |
| 127 | ++ filegroup( |
| 128 | ++diff --git test_suite/BUILD test_suite/BUILD |
| 129 | ++index 12c8937..17ed1ad 100644 |
| 130 | ++--- test_suite/BUILD |
| 131 | +++++ test_suite/BUILD |
| 132 | ++@@ -1,3 +1,5 @@ |
| 133 | +++load("@rules_shell//shell:sh_library.bzl", "sh_library") |
| 134 | +++ |
| 135 | ++ package(default_visibility = ["//visibility:private"]) |
| 136 | ++ |
| 137 | ++ # Export the tests.source so it can be used by Bazel tests elsewhere in the repo. |
| 138 | ++diff --git third_party/json/BUILD third_party/json/BUILD |
| 139 | ++index 1d23af1..d4ede23 100644 |
| 140 | ++--- third_party/json/BUILD |
| 141 | +++++ third_party/json/BUILD |
| 142 | ++@@ -1,3 +1,5 @@ |
| 143 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 144 | +++ |
| 145 | ++ licenses(["permissive"]) |
| 146 | ++ |
| 147 | ++ package(default_visibility = ["//visibility:private"]) |
| 148 | ++diff --git third_party/md5/BUILD third_party/md5/BUILD |
| 149 | ++index 840ebd4..bd158c8 100644 |
| 150 | ++--- third_party/md5/BUILD |
| 151 | +++++ third_party/md5/BUILD |
| 152 | ++@@ -1,3 +1,5 @@ |
| 153 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 154 | +++ |
| 155 | ++ licenses(["permissive"]) |
| 156 | ++ |
| 157 | ++ package(default_visibility = ["//visibility:private"]) |
| 158 | ++diff --git third_party/rapidyaml/BUILD third_party/rapidyaml/BUILD |
| 159 | ++index 3ce4677..f98c6f3 100644 |
| 160 | ++--- third_party/rapidyaml/BUILD |
| 161 | +++++ third_party/rapidyaml/BUILD |
| 162 | ++@@ -1,3 +1,5 @@ |
| 163 | +++load("@rules_cc//cc:cc_library.bzl", "cc_library") |
| 164 | +++ |
| 165 | ++ licenses(["permissive"]) |
| 166 | ++ |
| 167 | ++ package(default_visibility = ["//visibility:private"]) |
0 commit comments