Skip to content

Commit

Permalink
Merge pull request #17771 from github/redsun82/rust-codegen
Browse files Browse the repository at this point in the history
Rust: fix codegen to allow `--force` again
  • Loading branch information
redsun82 authored Oct 15, 2024
2 parents 5efb88e + 2c970a0 commit 886c7f1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions rust/codegen/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")

_args = [
"//rust/ast-generator",
"//rust/ast-generator:manifest",
Expand All @@ -15,3 +17,16 @@ sh_binary(
"//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__"],
)
3 changes: 2 additions & 1 deletion rust/codegen/codegen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ast_generator="$(rlocation "$1")"
ast_generator_manifest="$(rlocation "$2")"
codegen="$(rlocation "$3")"
codegen_conf="$(rlocation "$4")"
shift 4

CARGO_MANIFEST_DIR="$(dirname "$ast_generator_manifest")" "$ast_generator"
"$codegen" --configuration-file="$codegen_conf"
"$codegen" --configuration-file="$codegen_conf" "$@"

0 comments on commit 886c7f1

Please sign in to comment.