Skip to content

Commit 7973af3

Browse files
committed
servo: Merge #14244 - Use build script to generate binding files (from upsuper:buildtime-bindgen); r=emilio
<!-- Please describe your changes on the following line: --> This is a WIP patch to make rust-bindgen a build time dependency of style component for stylo. This should make things more automatic. I convert majority of `regen.py` to `build_gecko.rs`. It currently doesn't work on Windows, because of rust-lang/rust-bindgen#271 (it works when I fix the generated file manually, though). I haven't tested other platforms. It would break servo's CI for geckolib, because: 1. it needs libclang (which is probably easy to solve) 2. it needs `MOZ_OBJDIR` to be passed in so that it can generate bindings Manishearth emilio Do you agree with this change? Do you have suggestion for the issues above? --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 872ec89a9c546eb05246b5047aabfc032d140eff UltraBlame original commit: 78635ebabfc9e63971829a549388d1b61a75a503
1 parent 53ba84f commit 7973af3

File tree

12 files changed

+747
-890
lines changed

12 files changed

+747
-890
lines changed

servo/Cargo.lock

+74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

servo/components/style/Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ doctest = false
1414

1515
[features]
1616
gecko = ["nsstring_vendor", "num_cpus", "rayon/unstable"]
17+
bindgen = ["libbindgen", "regex"]
1718
servo = ["serde/unstable", "serde", "serde_derive", "heapsize_derive",
1819
"style_traits/servo", "app_units/plugins", "servo_atoms", "html5ever-atoms",
1920
"cssparser/heap_size", "cssparser/serde-serialization",
@@ -65,5 +66,8 @@ version = "1.0"
6566
kernel32-sys = "0.2"
6667

6768
[build-dependencies]
69+
lazy_static = "0.2"
70+
libbindgen = {version = "0.1.1", optional = true}
6871
phf_codegen = "0.7.20"
72+
regex = {version = "0.1", optional = true}
6973
walkdir = "0.1"

servo/components/style/binding_tools/README.md

-5
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,3 @@ This directory contains simple tools for generating the Rust bindings for [stylo
55
## `setup_bindgen.sh`
66

77
This clones Servo's version of bindgen, and uses `llvm-3.8` library to build it. It will then be used to generate the Rust bindings.
8-
9-
## `regen.sh`
10-
11-
This will regenerate the bindings for the `ServoBindings.h` file in your gecko
12-
build. The generated bindings live in `components/style/gecko_bindings/bindings.rs`. For structs, the bindings are in `components/style/gecko_bindings/structs_*`

0 commit comments

Comments
 (0)