mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Rust: fix codegen to allow --force
This passes command line arguments to codegen, allowing in particular `--force` to be passed. Also, a convenience `//rust/codegen:py` is added to only run the python based code generation, which will be faster and enough when `ast-generator` is unchanged.
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
|
||||||
|
|
||||||
_args = [
|
_args = [
|
||||||
"//rust/ast-generator",
|
"//rust/ast-generator",
|
||||||
"//rust/ast-generator:manifest",
|
"//rust/ast-generator:manifest",
|
||||||
@@ -15,3 +17,16 @@ sh_binary(
|
|||||||
"//misc/bazel:sh_runfiles",
|
"//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__"],
|
||||||
|
)
|
||||||
|
|||||||
@@ -4,10 +4,12 @@ set -eu
|
|||||||
|
|
||||||
source misc/bazel/runfiles.sh 2>/dev/null || source external/ql+/misc/bazel/runfiles.sh
|
source misc/bazel/runfiles.sh 2>/dev/null || source external/ql+/misc/bazel/runfiles.sh
|
||||||
|
|
||||||
|
|
||||||
ast_generator="$(rlocation "$1")"
|
ast_generator="$(rlocation "$1")"
|
||||||
ast_generator_manifest="$(rlocation "$2")"
|
ast_generator_manifest="$(rlocation "$2")"
|
||||||
codegen="$(rlocation "$3")"
|
codegen="$(rlocation "$3")"
|
||||||
codegen_conf="$(rlocation "$4")"
|
codegen_conf="$(rlocation "$4")"
|
||||||
|
shift 4
|
||||||
|
|
||||||
CARGO_MANIFEST_DIR="$(dirname "$ast_generator_manifest")" "$ast_generator"
|
CARGO_MANIFEST_DIR="$(dirname "$ast_generator_manifest")" "$ast_generator"
|
||||||
"$codegen" --configuration-file="$codegen_conf"
|
"$codegen" --configuration-file="$codegen_conf" "$@"
|
||||||
|
|||||||
Reference in New Issue
Block a user