Generate webrender_ffi_generated.h at build time

RESOLVED FIXED in Firefox 66



3 months ago
3 months ago


(Reporter: kats, Assigned: emilio)


(Blocks 1 bug)

Other Branch
Dependency tree / graph

Firefox Tracking Flags

(firefox66 fixed)


(Whiteboard: [gfx-noted])


(4 attachments)

Now that we're using m-c as the canonical home for WR, I'm not running cbindgen on each WR update anymore. This means that it's easier for people to forget to run cbindgen and accidentally introduce bugs.

We should generate webrender_ffi_generated.h at build time instead of having it checked into the tree to make this a little more robust.

(Note that cbindgen is already a build-time requirement for the style system, so this should be relatively straightforward).

Don't we have a requirement for using nightly rust when running cbindgen? Also cbindgen, webrender and the latest rust nightly don't mix. (

In the near term perhaps we can just make the build fail somehow if the webrender_ffi_generated.h is not correctly updated?

Emilio, how realistic short-term is it to use cbindgen for WR like we do for the style system?

Flags: needinfo?(emilio)

(In reply to Jeff Muizelaar [:jrmuizel] from comment #2)

In the near term perhaps we can just make the build fail somehow if the webrender_ffi_generated.h is not correctly updated?

(I'm not sure how we'd detect that the bindings needed to be updated without running bindgen and comparing the output).


Comment 5

3 months ago

So the annoying part is the WR uses cbindgen in quite a different way than the style system, doing all the macro expansion that requires nightly rust or such.

I don't have the context as to know why we need the macro expansion, but if that goes away running cbindgen at build-time would be much more straight-forward.

Flags: needinfo?(emilio)

Comment 6

3 months ago

I talked with bobby, should be fixable to use #[derive] in euclid instead of a macro. Then we can do this.

Assignee: nobody → emilio

Comment 7

3 months ago
Posted file GitHub Pull Request


3 months ago
Depends on: 1519639

Comment 8

3 months ago
We need this to properly generate the WR bindings.

Also update the comment since the check was recently moved.

Comment 11

3 months ago
Pushed by
Update min cbindgen version. r=dmajor
Generalize a bit GenerateServoStyleConsts and rename to RunCbindgen. r=heycam
Generate webrender_ffi_generated.h at build time. r=kats

Comment 12

3 months ago
Last Resolved: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla66
You need to log in before you can comment on or make changes to this bug.