Skip to content

Commit 3647bb0

Browse files
committed
rust: update generate_rust_analyzer.py
Update the script to account for the new way helpers are handled since commit 7324a8. Signed-off-by: Boris-Chengbiao Zhou <[email protected]>
1 parent 10d0f7a commit 3647bb0

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

rust/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ rustc_host_target = $(shell $(RUSTC) --version --verbose | grep -F 'host: ' | cu
296296
RUST_LIB_SRC ?= $(rustc_sysroot)/lib/rustlib/src/rust/library
297297

298298
rust-analyzer:
299-
$(Q)$(srctree)/scripts/generate_rust_analyzer.py $(srctree) $(objtree) $(RUST_LIB_SRC) $(objtree)/rust/bindings_generated.rs > $(objtree)/rust-project.json
299+
$(Q)$(srctree)/scripts/generate_rust_analyzer.py $(srctree) $(objtree) $(RUST_LIB_SRC) > $(objtree)/rust-project.json
300300

301301
$(objtree)/rust/compiler_builtins.o: private rustc_objcopy = -w -W '__*'
302302
$(objtree)/rust/compiler_builtins.o: $(srctree)/rust/compiler_builtins.rs \

scripts/generate_rust_analyzer.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import pathlib
99
import sys
1010

11-
def generate_crates(srctree, objtree, sysroot_src, bindings_file):
11+
def generate_crates(srctree, objtree, sysroot_src):
1212
# Generate the configuration list.
1313
cfg = []
1414
with open(objtree / "include" / "generated" / "rustc_cfg") as fd:
@@ -78,7 +78,7 @@ def append_crate(display_name, root_module, deps, cfg=[], is_workspace_member=Tr
7878
["core", "alloc", "macros", "build_error"],
7979
cfg=cfg,
8080
)
81-
crates[-1]["env"]["RUST_BINDINGS_FILE"] = str(bindings_file.resolve(True))
81+
crates[-1]["env"]["OBJTREE"] = str(objtree.resolve(True))
8282
crates[-1]["source"] = {
8383
"include_dirs": [
8484
str(srctree / "rust" / "kernel"),
@@ -115,7 +115,6 @@ def main():
115115
parser.add_argument("srctree", type=pathlib.Path)
116116
parser.add_argument("objtree", type=pathlib.Path)
117117
parser.add_argument("sysroot_src", type=pathlib.Path)
118-
parser.add_argument("bindings_file", type=pathlib.Path)
119118
args = parser.parse_args()
120119

121120
logging.basicConfig(
@@ -124,7 +123,7 @@ def main():
124123
)
125124

126125
rust_project = {
127-
"crates": generate_crates(args.srctree, args.objtree, args.sysroot_src, args.bindings_file),
126+
"crates": generate_crates(args.srctree, args.objtree, args.sysroot_src),
128127
"sysroot_src": str(args.sysroot_src),
129128
}
130129

0 commit comments

Comments
 (0)