Skip to content

script: copy include! files from script_bindings to script's OUT_DIR #36384

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

sagudev
Copy link
Member

@sagudev sagudev commented Apr 7, 2025

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: rust-lang/rust-analyzer#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

@sagudev sagudev requested a review from jdm April 7, 2025 16:13
@sagudev sagudev requested a review from gterzian as a code owner April 7, 2025 16:13
@sagudev sagudev removed the request for review from gterzian April 7, 2025 16:13
Signed-off-by: sagudev <[email protected]>
@sagudev sagudev requested a review from jdm April 8, 2025 17:52
Copy link
Member

@jdm jdm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense!

@sagudev sagudev added this pull request to the merge queue Apr 8, 2025
Merged via the queue into servo:main with commit 4d4f949 Apr 8, 2025
22 checks passed
@sagudev sagudev deleted the RA-script-split branch April 8, 2025 20:17
TG199 pushed a commit to TG199/servo that referenced this pull request Apr 10, 2025
…ervo#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:
rust-lang/rust-analyzer#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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants