Skip to content

Commit 886c7f1

Browse files
authored
Merge pull request github#17771 from github/redsun82/rust-codegen
Rust: fix codegen to allow `--force` again
2 parents 5efb88e + 2c970a0 commit 886c7f1

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

rust/codegen/BUILD.bazel

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@bazel_skylib//rules:native_binary.bzl", "native_binary")
2+
13
_args = [
24
"//rust/ast-generator",
35
"//rust/ast-generator:manifest",
@@ -15,3 +17,16 @@ sh_binary(
1517
"//misc/bazel:sh_runfiles",
1618
],
1719
)
20+
21+
native_binary(
22+
name = "py",
23+
src = "//misc/codegen",
24+
out = "codegen",
25+
args = [
26+
"--configuration-file=$(location //rust:codegen-conf)",
27+
],
28+
data = [
29+
"//rust:codegen-conf",
30+
],
31+
visibility = ["//rust:__subpackages__"],
32+
)

rust/codegen/codegen.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ ast_generator="$(rlocation "$1")"
88
ast_generator_manifest="$(rlocation "$2")"
99
codegen="$(rlocation "$3")"
1010
codegen_conf="$(rlocation "$4")"
11+
shift 4
1112

1213
CARGO_MANIFEST_DIR="$(dirname "$ast_generator_manifest")" "$ast_generator"
13-
"$codegen" --configuration-file="$codegen_conf"
14+
"$codegen" --configuration-file="$codegen_conf" "$@"

0 commit comments

Comments
 (0)