mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
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`.
This commit is contained in:
@@ -3,6 +3,7 @@ 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",
|
||||
|
||||
@@ -5,10 +5,11 @@ set -eu
|
||||
source misc/bazel/runfiles.sh 2>/dev/null || source external/ql+/misc/bazel/runfiles.sh
|
||||
|
||||
ast_generator="$(rlocation "$1")"
|
||||
ast_generator_manifest="$(rlocation "$2")"
|
||||
codegen="$(rlocation "$3")"
|
||||
codegen_conf="$(rlocation "$4")"
|
||||
shift 4
|
||||
grammar_file="$(rlocation "$2")"
|
||||
ast_generator_manifest="$(rlocation "$3")"
|
||||
codegen="$(rlocation "$4")"
|
||||
codegen_conf="$(rlocation "$5")"
|
||||
shift 5
|
||||
|
||||
CARGO_MANIFEST_DIR="$(dirname "$ast_generator_manifest")" "$ast_generator"
|
||||
CARGO_MANIFEST_DIR="$(dirname "$ast_generator_manifest")" "$ast_generator" "$grammar_file"
|
||||
"$codegen" --configuration-file="$codegen_conf" "$@"
|
||||
|
||||
Reference in New Issue
Block a user