Closed Bug 1684180 Opened 4 years ago Closed 4 years ago

ESR 78.6 fails to build with cbindgen 0.16.0

Categories

(Core :: Graphics: WebGPU, defect)

78 Branch
defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox-esr78 84+ fixed

People

(Reporter: jbeich, Assigned: emilio)

References

Details

Attachments

(1 file)

$ pkg info -x cbindgen
rust-cbindgen-0.16.0

$ ./mach build
[...]
In file included from Unified_cpp_dom_webgpu1.cpp:110:
dom/webgpu/ipc/WebGPUParent.cpp:426:29: error: no member named '_0' in 'mozilla::webgpu::ffi::WGPUBufferBinding'
        bgb.resource.buffer._0.buffer = entry.mValue;
        ~~~~~~~~~~~~~~~~~~~ ^
dom/webgpu/ipc/WebGPUParent.cpp:427:29: error: no member named '_0' in 'mozilla::webgpu::ffi::WGPUBufferBinding'
        bgb.resource.buffer._0.offset = entry.mBufferOffset;
        ~~~~~~~~~~~~~~~~~~~ ^
dom/webgpu/ipc/WebGPUParent.cpp:428:29: error: no member named '_0' in 'mozilla::webgpu::ffi::WGPUBufferBinding'
        bgb.resource.buffer._0.size = entry.mBufferSize;
        ~~~~~~~~~~~~~~~~~~~ ^
dom/webgpu/ipc/WebGPUParent.cpp:432:34: error: member reference base type 'mozilla::webgpu::ffi::WGPUTextureViewId' (aka 'unsigned long long') is not a structure or union
        bgb.resource.texture_view._0 = entry.mValue;
        ~~~~~~~~~~~~~~~~~~~~~~~~~^~~
dom/webgpu/ipc/WebGPUParent.cpp:436:29: error: member reference base type 'mozilla::webgpu::ffi::WGPUSamplerId' (aka 'unsigned long long') is not a structure or union
        bgb.resource.sampler._0 = entry.mValue;
        ~~~~~~~~~~~~~~~~~~~~^~~
5 errors generated.

http://beefy5.nyi.freebsd.org/data/121i386-default/558873/logs/errors/firefox-esr-78.6.0_1,1.log
http://beefy5.nyi.freebsd.org/data/121i386-default/558873/logs/errors/thunderbird-78.6.0_1.log

i can confirm that tb 76.0 fails to build on OpenBSD/i386 with cbindgen updated to 0.16.0.

I can see the same build failure under NetBSD/amd64 with cbindgen-0.16.0 and firefox-78.6.0.

This is kind of expected, cbindgen changed output of Rust tuple structs. The solution is removing the _0s

(In reply to Emilio Cobos Álvarez (:emilio) from comment #3)

This is kind of expected, cbindgen changed output of Rust tuple structs. The solution is removing the _0s

is it something that's going to happen in mozilla-esr78 repo (via a cbindgen version check and ifdefs ?), or are downstreams upgrading their cbindgen package supposed to do that locally via patches ?

I can provide a patch.

This works both with the old and new cbindgen-generated bindings.

This is effectively dead code on ESR though, because we haven't enabled
WebGPU there, but...

Assignee: nobody → emilio
Status: NEW → ASSIGNED

Comment on attachment 9194817 [details]
Bug 1684180 - Fix ESR build with newer versions of cbindgen. r=kvark

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration: Trivial build fix for downstreams with newer cbindgen versions
  • User impact if declined: none
  • Fix Landed on Version: n/a
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): simple patch to fix build. This code shouldn't even run on ESR anyways because WebGPU is not enabled there.
  • String or UUID changes made by this patch: none
Attachment #9194817 - Flags: approval-mozilla-esr78?
See Also: → 1684350

(In reply to Emilio Cobos Álvarez (:emilio) from comment #6)

Created attachment 9194817 [details]
Bug 1684180 - Fix ESR build with newer versions of cbindgen. r=kvark

This works both with the old and new cbindgen-generated bindings.

This is effectively dead code on ESR though, because we haven't enabled
WebGPU there, but...

With this patch and cbindgen-0.15.0, 78.6.0 builds fine under NetBSD/amd64.

tb & fx esr 78.6.0 build on OpenBSD/amd64 with the patch and cbindgen 0.16.0.

Comment on attachment 9194817 [details]
Bug 1684180 - Fix ESR build with newer versions of cbindgen. r=kvark

Approved for 78.6.1 & 78.7esr.

Attachment #9194817 - Flags: approval-mozilla-esr78? → approval-mozilla-esr78+
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: