Closed Bug 1519501 Opened 5 years ago Closed 5 years ago

Generate webrender_ffi_generated.h at build time

Categories

(Core :: Graphics: WebRender, enhancement)

Other Branch
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla66
Tracking Status
firefox66 --- fixed

People

(Reporter: kats, Assigned: emilio)

References

Details

(Whiteboard: [gfx-noted])

Attachments

(4 files)

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. (https://github.com/servo/webrender/issues).

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).

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)

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

Assignee: nobody → emilio
Attached file GitHub Pull Request
Depends on: 1519639
We need this to properly generate the WR bindings.

Also update the comment since the check was recently moved.
Pushed by emilio@crisal.io:
https://hg.mozilla.org/integration/mozilla-inbound/rev/620e00a8a3ac
Update min cbindgen version. r=dmajor
https://hg.mozilla.org/integration/mozilla-inbound/rev/8a7ab9b279fe
Generalize a bit GenerateServoStyleConsts and rename to RunCbindgen. r=heycam
https://hg.mozilla.org/integration/mozilla-inbound/rev/e3d38e17dec8
Generate webrender_ffi_generated.h at build time. r=kats
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: