Closed Bug 1354944 (wr-binding) Opened 3 years ago Closed 3 years ago
Autogenerate (much of) the webrender
_ffi .h file
The FFI boundary for webrender has gfx/webrender_bindings/src/bindings.rs on the rust side and gfx/webrender_bindings/webrender_ffi.h on the C++ side. However right now any changes in one have to be manually reflected in the other, which is error-prone. We now have a binding generator at https://github.com/jrmuizel/wr-binding which is getting close to done. The binding generator can take as input the rust code, and can generate a large subset of the stuff in webrender_ffi.h. This bug is tracking the remaining work needed to put it into production use. The goal here is to have the wr-bindings generator generate a bindings file which is then checked in at gfx/webrender_bindings/webrender_ffi_autogen.h and #include'd into gfx/webrender_bindings/webrender_ffi.h. If changes are made to bindings.rs or any of the rust code it depends on, the binding generator will need to be run manually. This will produce a new webrender_ffi_autogen.h file which can then be checked in along with the rest of the changes. There are a few things missing before we can get this done, I'll file other bugs hanging off this one for those items.
Depends on: 1354946
There's also going to be some fixes in wr-bindings needed, so I'll add those as issues on the github repo. e.g. jrmuizel/wr-binding#2
See Also: → https://github.com/jrmuizel/wr-binding/issues/2
Depends on: 1354950
Depends on: 1354951
Depends on: 1353735
See Also: → https://github.com/jrmuizel/wr-binding/issues/4
Depends on: 1355183
Depends on: 1355187
Depends on: 1355577
Depends on: 1355578
Depends on: 1355590
Depends on: 1355612
Depends on: 1355614
Depends on: 1355615
With all the dependencies fixed I have this working. Try push: https://treeherder.mozilla.org/#/jobs?repo=try&revision=3e09ddc847aae07fe343ba03ebc55afe7b00da77
Putting THIS FILE IS GENERATED! DO NOT MODIFY MANUALLY! See https://github.com/jrmuizel/wr-binding! on every function seems a little aggressive.
It is a little aggressive, yeah. But the function signatures are large enough that the warning only shows up every few lines. And in my experience a single warning at the top is usually not sufficient to stop people. But I can reduce it to one warning per "block" (i.e. one for structs, one for functions, etc). Also I should rename the file to be _generated.h instead of _autogen.h since it's technically not "auto"-generated.
Assignee: nobody → bugmail
Comment on attachment 8857219 [details] Bug 1354944 - Plug in the generated FFI header. https://reviewboard.mozilla.org/r/129156/#review131678
Attachment #8857219 - Flags: review?(jmuizelaar) → review+
Pushed by firstname.lastname@example.org: https://hg.mozilla.org/projects/graphics/rev/199dd7c4179f Plug in the generated FFI header. r=jrmuizel
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.