Files
codeql/misc/bazel/rust.bzl
Paolo Tranquilli 913a9263d2 Bazel: stub internal repo parts needed for building rust binaries
This is another shot at https://github.com/github/codeql/pull/17382,
using a different and more lightweight approach.

This allows building the ruby and python (and in the future also rust)
packs from within the codeql repository. This will:
* skip defining the glibc symbols checking, which only makes sense when
  building the release from the internal repository
* stub out our `universal_binary` rule, which we only need when building
  the release.
2024-09-05 08:16:28 +02:00

24 lines
749 B
Python

load("@rules_rust//rust:defs.bzl", "rust_binary")
load("@semmle_code//buildutils-internal:glibc_symbols_check.bzl", "glibc_symbols_check")
load("@semmle_code//buildutils-internal:lipo.bzl", "universal_binary")
def codeql_rust_binary(
name,
target_compatible_with = None,
visibility = None,
symbols_test = True,
**kwargs):
rust_label_name = "single_arch/" + name
universal_binary(
name = name,
dep = ":" + rust_label_name,
target_compatible_with = target_compatible_with,
visibility = visibility,
)
rust_binary(
name = rust_label_name,
**kwargs
)
if symbols_test:
glibc_symbols_check(name = name + "symbols-test", binary = name)