Files
codeql/rust/codegen/BUILD.bazel
Paolo Tranquilli 290a1043b1 Rust: fetch ungram and rust-analyzer code instead of checking it in
* The ungram file is now taken from the rust-analyzer dependencies
  pulled in by bazel
* the grammar parsing code is not published, so it must be taken
  directly from rust-analyzer code. That part should be less prone to be
  updated than the ungram file, so it does not necessarily need to be
  in sync with the rust-analyzer version is used elsewhere.
* both need some patches. The former is patched during build, the latter
  during loading in `MODULE.bazel`.
2024-12-18 16:37:24 +01:00

35 lines
784 B
Python

load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
_args = [
"//rust/ast-generator",
"//rust/ast-generator:ungram",
"//rust/ast-generator:Cargo.toml",
"//misc/codegen",
"//rust:codegen-conf",
]
sh_binary(
name = "codegen",
srcs = ["codegen.sh"],
args = ["$(rlocationpath %s)" % a for a in _args],
data = _args,
visibility = ["//rust:__subpackages__"],
deps = [
"//misc/bazel:sh_runfiles",
],
)
native_binary(
name = "py",
src = "//misc/codegen",
out = "codegen",
args = [
"--configuration-file=$(location //rust:codegen-conf)",
],
data = [
"//rust:codegen-conf",
],
visibility = ["//rust:__subpackages__"],
)