|
| 1 | +module( |
| 2 | + name = "ryandraves_nlb", |
| 3 | + version = "0.1.0", |
| 4 | + compatibility_level = 0, |
| 5 | +) |
| 6 | + |
| 7 | +# |
| 8 | +# "Standard" dependencies |
| 9 | +# |
| 10 | +bazel_dep(name = "aspect_bazel_lib", version = "2.10.0") |
| 11 | +bazel_dep(name = "bazel_skylib", version = "1.7.1") |
| 12 | +bazel_dep(name = "platforms", version = "0.0.10") |
| 13 | +bazel_dep(name = "rules_cc", version = "0.1.1") |
| 14 | +bazel_dep(name = "rules_platform", version = "0.1.0") |
| 15 | + |
| 16 | +http_archive = use_repo_rule("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") |
| 17 | +git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository") |
| 18 | + |
| 19 | +# |
| 20 | +# Pico SDK & Picotool |
| 21 | +# |
| 22 | +bazel_dep(name = "pico-sdk", version = "2.1.0") |
| 23 | +register_toolchains( |
| 24 | + "@pico-sdk//bazel/toolchain:linux-x86_64-rp2040", |
| 25 | + "@pico-sdk//bazel/toolchain:linux-x86_64-rp2350", |
| 26 | + "@pico-sdk//bazel/toolchain:linux-aarch64-rp2040", |
| 27 | + "@pico-sdk//bazel/toolchain:linux-aarch64-rp2350", |
| 28 | + "@pico-sdk//bazel/toolchain:win-x86_64-rp2040", |
| 29 | + "@pico-sdk//bazel/toolchain:win-x86_64-rp2350", |
| 30 | + "@pico-sdk//bazel/toolchain:mac-x86_64-rp2040", |
| 31 | + "@pico-sdk//bazel/toolchain:mac-x86_64-rp2350", |
| 32 | + "@pico-sdk//bazel/toolchain:mac-aarch64-rp2040", |
| 33 | + "@pico-sdk//bazel/toolchain:mac-aarch64-rp2350", |
| 34 | +) |
| 35 | + |
| 36 | +bazel_dep(name = "picotool", version = "2.1.0") |
| 37 | + |
| 38 | +# Pioasm is not yet available in the Pico SDK Bazel build |
| 39 | +# https://github.com/raspberrypi/pico-sdk/tree/master/bazel#known-issues-and-limitations |
| 40 | +# but the binary is distributed in another repo |
| 41 | +http_archive( |
| 42 | + name = "pioasm-linux-x86", |
| 43 | + build_file = "//bzl/deps:pioasm.BUILD", |
| 44 | + integrity = "sha256-pMFMVugwDgGkmCztV4sYGoYeKiN4j84HnEKCw9rVXuk=", |
| 45 | + url = "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/pico-sdk-tools-2.1.0-x86_64-lin.tar.gz", |
| 46 | +) |
| 47 | +http_archive( |
| 48 | + name = "pioasm-linux-arm", |
| 49 | + build_file = "//bzl/deps:pioasm.BUILD", |
| 50 | + integrity = "sha256-kBa73P7E6rVKcHIFysJLQZ2Ldc/LJFwTVxAjqCSFgJM=", |
| 51 | + url = "https://github.com/raspberrypi/pico-sdk-tools/releases/download/v2.1.0-0/pico-sdk-tools-2.1.0-aarch64-lin.tar.gz", |
| 52 | +) |
| 53 | + |
| 54 | +# |
| 55 | +# Rules Python |
| 56 | +# |
| 57 | +# aspect_rules_py is promising, but its `py_venv` is 3.11+ and |
| 58 | +# rule is either underdocumented or broken. |
| 59 | +bazel_dep(name = "aspect_rules_py", version = "1.0.0") |
| 60 | + |
| 61 | +bazel_dep(name = "rules_python", version = "0.40.0") |
| 62 | + |
| 63 | +python = use_extension("@rules_python//python/extensions:python.bzl", "python") |
| 64 | + |
| 65 | +python.toolchain( |
| 66 | + python_version = "3.12", |
| 67 | + is_default = True, |
| 68 | +) |
| 69 | + |
| 70 | +use_repo(python, "python_versions") |
| 71 | +use_repo(python, "python_3_12") |
| 72 | + |
| 73 | +pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip") |
| 74 | + |
| 75 | +pip.parse( |
| 76 | + hub_name = "pip", |
| 77 | + python_version = "3.12", |
| 78 | + requirements_lock = "//:requirements_lock.txt", |
| 79 | +) |
| 80 | + |
| 81 | +use_repo(pip, "pip") |
| 82 | + |
| 83 | +# |
| 84 | +# py_venv export |
| 85 | +# |
| 86 | +git_repository( |
| 87 | + name = "rules_pyvenv", |
| 88 | + commit = "0b03b0d1f5562223d1170c511e548dc0961f0c5f", |
| 89 | + remote = "https://github.com/cedarai/rules_pyvenv", |
| 90 | +) |
| 91 | + |
| 92 | +# |
| 93 | +# Buildifier |
| 94 | +# |
| 95 | +bazel_dep( |
| 96 | + name = "buildifier_prebuilt", |
| 97 | + version = "6.4.0", |
| 98 | + dev_dependency = True, |
| 99 | +) |
| 100 | + |
| 101 | +# Hedron's Compile Commands Extractor for Bazel |
| 102 | +# https://github.com/hedronvision/bazel-compile-commands-extractor |
| 103 | +bazel_dep(name = "hedron_compile_commands", dev_dependency = True) |
| 104 | +git_override( |
| 105 | + module_name = "hedron_compile_commands", |
| 106 | + remote = "https://github.com/hedronvision/bazel-compile-commands-extractor.git", |
| 107 | + commit = "0e990032f3c5a866e72615cf67e5ce22186dcb97", |
| 108 | + # Replace the commit hash (above) with the latest (https://github.com/hedronvision/bazel-compile-commands-extractor/commits/main). |
| 109 | + # Even better, set up Renovate and let it do the work for you (see "Suggestion: Updates" in the README). |
| 110 | +) |
| 111 | + |
| 112 | +# |
| 113 | +# rules_foreign_cc |
| 114 | +# |
| 115 | +bazel_dep(name = "rules_foreign_cc", version = "0.13.0") |
| 116 | + |
| 117 | +# |
| 118 | +# Pybind11 |
| 119 | +# |
| 120 | +bazel_dep(name = "pybind11_bazel", version = "2.12.0") |
| 121 | + |
| 122 | +# |
| 123 | +# Zmq |
| 124 | +# |
| 125 | +bazel_dep(name = "cppzmq", version = "4.10.0") |
| 126 | +bazel_dep(name = "libzmq", version = "4.3.5.bcr.1") |
| 127 | + |
| 128 | +# |
| 129 | +# Google Test |
| 130 | +# |
| 131 | +bazel_dep(name = "googletest", version = "1.15.2") |
| 132 | + |
| 133 | +# |
| 134 | +# Web development |
| 135 | +# |
| 136 | +bazel_dep(name = "aspect_rules_js", version = "2.0.2") |
| 137 | +bazel_dep(name = "aspect_rules_ts", version = "3.1.0") |
| 138 | +bazel_dep(name = "rules_nodejs", version = "6.2.0") |
| 139 | +bazel_dep(name = "aspect_rules_lint", version = "1.0.0-rc4") |
| 140 | + |
| 141 | +node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True) |
| 142 | + |
| 143 | +node.toolchain(node_version = "20.13.1") |
| 144 | + |
| 145 | +pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm", dev_dependency = True) |
| 146 | +use_repo(pnpm, "pnpm") |
| 147 | + |
| 148 | +npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True) |
| 149 | +npm.npm_translate_lock( |
| 150 | + name = "npm", |
| 151 | + npmrc = "//:.npmrc", |
| 152 | + pnpm_lock = "//:pnpm-lock.yaml", |
| 153 | + public_hoist_packages = { |
| 154 | + "@next/eslint-plugin-next": ["blog"], |
| 155 | + "eslint-config-react-app": ["react"], |
| 156 | + |
| 157 | + }, |
| 158 | + verify_node_modules_ignored = "//:.bazelignore", |
| 159 | + update_pnpm_lock = True, |
| 160 | + data = [ |
| 161 | + "//:package.json", |
| 162 | + "//blog:package.json", |
| 163 | + "//lrb:package.json", |
| 164 | + "//:pnpm-workspace.yaml", |
| 165 | + ], |
| 166 | +) |
| 167 | +use_repo(npm, "npm") |
| 168 | + |
| 169 | +rules_ts_ext = use_extension( |
| 170 | + "@aspect_rules_ts//ts:extensions.bzl", |
| 171 | + "ext", |
| 172 | + dev_dependency = True, |
| 173 | +) |
| 174 | +rules_ts_ext.deps() |
| 175 | +use_repo(rules_ts_ext, "npm_typescript") |
| 176 | + |
| 177 | +# |
| 178 | +# Rust |
| 179 | +# |
| 180 | +# Latest release w/ extensions split borked the toolchains |
| 181 | +bazel_dep(name = "rules_rust", version = "0.51.0") |
| 182 | + |
| 183 | +rust = use_extension("@rules_rust//rust:extensions.bzl", "rust") |
| 184 | +rust.toolchain( |
| 185 | + edition = "2021", |
| 186 | +) |
| 187 | +use_repo(rust, "rust_toolchains") |
| 188 | +register_toolchains("@rust_toolchains//:all") |
| 189 | + |
| 190 | +wasm_bindgen = use_extension("@rules_rust//wasm_bindgen:extensions.bzl", "wasm_bindgen") |
| 191 | +use_repo( |
| 192 | + wasm_bindgen, |
| 193 | +) |
| 194 | +register_toolchains( |
| 195 | + "@rules_rust//wasm_bindgen:default_wasm_bindgen_toolchain", |
| 196 | + "@rules_rust//rust/private/dummy_cc_toolchain:dummy_cc_wasm32_toolchain", |
| 197 | +) |
| 198 | + |
| 199 | +crate = use_extension( |
| 200 | + "@rules_rust//crate_universe:extension.bzl", |
| 201 | + "crate", |
| 202 | +) |
| 203 | +crate.spec(package = "wasm-bindgen", version = "=0.2.92") |
| 204 | +crate.spec(package = "wee_alloc", version = "0.4.5") |
| 205 | +crate.spec(package = "spin", version = "0.9.8") |
| 206 | +crate.spec(package = "lazy_static", version = "1.4", features = ["spin_no_std"]) |
| 207 | +crate.spec(package = "console_error_panic_hook", version = "0.1.7") |
| 208 | +crate.spec(package = "web-sys", version = "0.3", features = ["console"]) |
| 209 | +crate.from_specs() |
| 210 | +use_repo(crate, "crates") |
0 commit comments