diff options
author | sagudev <16504129+sagudev@users.noreply.github.com> | 2025-04-08 21:22:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-04-08 19:22:24 +0000 |
commit | 4d4f94936f8859f039497df370083fd7ea35fb00 (patch) | |
tree | 96fbab2b41039f3fe5b3dafdbc842f3e76d55f67 /components/script_bindings/codegen/CodegenRust.py | |
parent | 7fd004adcee67ddf0b34b6d00f179c216461ac90 (diff) | |
download | servo-4d4f94936f8859f039497df370083fd7ea35fb00.tar.gz servo-4d4f94936f8859f039497df370083fd7ea35fb00.zip |
script: copy include! files from script_bindings to script's OUT_DIR (#36384)
copy generated `include!`d files from script_bindings's OUT_DIR, to
script's OUT_DIR to allow Rust Analyzer to load them.
This is done to bypass limitation of Rust Analyzer:
https://github.com/rust-lang/rust-analyzer/issues/17040
Also build script will now be rerun only when there are actual changes
to concrete bindings due to emitted `cargo::rerun-if-changed` (not for
each change in script crate).
Testing: It compiles so it works, I tested manually and RA now works as
expected (although we need to from type alias to concrete union-types
definitions)
Fixes:
https://servo.zulipchat.com/#narrow/channel/263398-general/topic/rust-analyzer.20failed.20to.20include.20codes.20in.20script_bindings
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Diffstat (limited to 'components/script_bindings/codegen/CodegenRust.py')
-rw-r--r-- | components/script_bindings/codegen/CodegenRust.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script_bindings/codegen/CodegenRust.py b/components/script_bindings/codegen/CodegenRust.py index 4f87ec792b4..26e76d9d828 100644 --- a/components/script_bindings/codegen/CodegenRust.py +++ b/components/script_bindings/codegen/CodegenRust.py @@ -8522,7 +8522,7 @@ class GlobalGenRoots(): ] imports = CGList([CGGeneric(f"use {mod};") for mod in mods], "\n") - phf = CGGeneric("include!(concat!(env!(\"BINDINGS_OUT_DIR\"), \"/InterfaceObjectMapPhf.rs\"));") + phf = CGGeneric("include!(concat!(env!(\"OUT_DIR\"), \"/InterfaceObjectMapPhf.rs\"));") return CGList([ CGGeneric(AUTOGENERATED_WARNING_COMMENT), |