Unable to build wgpu-core in cbindgen when overriding local dependencies
Categories
(Core :: Graphics: WebGPU, defect)
Tracking
()
People
(Reporter: kvark, Unassigned)
References
Details
Steps:
-
Check out
wgpu
rev 37288a6 from https://github.com/gfx-rs/wgpu locally (current revision used by Gecko). -
Add this patch to the root Cargo toml:
+[patch."https://github.com/gfx-rs/wgpu"]
+wgpu-core = { path = "/x/code/wgpu/wgpu-core" }
+wgpu-types = { path = "/x/code/wgpu/wgpu-types" }
+wgpu-hal = { path = "/x/code/wgpu/wgpu-hal" }
- Do
./mach vendor rust
- should succeed - Do
./mach build
- should succeed, but fails with
0:01.72 /x/code/firefox/obj-x86_64-pc-linux-gnu/_virtualenvs/build/bin/python -m mozbuild.action.file_generate /x/code/firefox/build/RunCbindgen.py generate gfx/webrender_bindings/webrender_ffi_generated.h gfx/webrender_bindings/.deps/webrender_ffi_generated.h.pp gfx/webrender_bindings/.deps/webrender_ffi_generated.h.stub config/cbindgen-metadata.json /x/code/firefox/gfx/webrender_bindings /x/code/firefox/gfx/wr/webrender /x/code/firefox/gfx/wr/webrender_api
0:01.72 make[3]: *** No rule to make target '/x/code/firefox/third_party/rust/wgpu-core', needed by 'gfx/wgpu_bindings/.deps/wgpu_ffi_generated.h.stub'. Stop.
Reporter | ||
Comment 1•3 years ago
|
||
Hopefully, Emilio can have a quick look tomorrow, and it's not a serious issue.
Reporter | ||
Comment 2•3 years ago
|
||
This is a quirk of cargo-vendor, as it turned out. When an override points to a local path, vendoring doesn't try to copy the contents over to 3rd party folder. So the source can't be found by cbindgen (reasonably).
Reporter | ||
Comment 3•3 years ago
|
||
Actually, things aren't quite good yet. I thought I can trivially work around this by pushing my changes to github and picking them up via a github cargo patch. But doing this causes Gecko to rebuild almost completely, and 35-min turnaround times are not efficient for me.
It would be useful to be able to cargo-patch things to local paths, which I hope don't require full Gecko rebuild on changing.
Reporter | ||
Comment 4•3 years ago
|
||
Found out that I can just modify the source code right in third_party
(if the cargo patch points to it), and it doesn't rebuild the whole tree. So that's an acceptable workaround.
Comment 5•3 years ago
|
||
Yeah so this is because this hardcodes /third_party/rust/wgpu-core
and co.
Given this is a third-party path this is only needed for correctness when wgpu-core
is patched. So the right fix might be to make cbindgen emit the dependencies rather than hardcoding them ourselves, I guess. But this is sorta expected given how this works.
Reporter | ||
Comment 6•3 years ago
|
||
So this is clearly not a blocker. I can modify the third_party copy, or vendor it externally while changing cbindgen toml.
Would you still want to keep the bug open in order to look into "make cbindgen emit the dependencies" at some point?
If not, please feel free to close.
Comment 7•3 years ago
|
||
That's tracked in https://github.com/eqrion/cbindgen/issues/192
Description
•