Closed eliemichel closed 2 months ago
@rajveermalviya and @Sahnvour thoughts?
I don't really care personally (I made wgpu-py find the files regardless of folder structure 😅).
Thanks for catching this issue, @eliemichel!
Updating the checked-in file directly would cause problems with bindgen, and since this only impacts package builds, the best approach (for now) is to update the Makefile instead:
diff --git a/Makefile b/Makefile
index 6a5546e..ddea760 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,7 @@ package: lib-native lib-native-release
cp ./dist/wgpu-native-git-tag dist/$$ARCHIVEDIR; \
cp ./ffi/webgpu-headers/webgpu.h dist/$$ARCHIVEDIR/include/webgpu; \
cp ./ffi/wgpu.h dist/$$ARCHIVEDIR/include/wgpu; \
+ sed -i '' 's/"webgpu.h"/<webgpu\/webgpu.h>/' dist/$$ARCHIVEDIR/include/wgpu/wgpu.h; \
if [ $(OS_NAME) = linux ]; then \
cp ./$$LIBDIR/libwgpu_native.so dist/$$ARCHIVEDIR/lib; \
cp ./$$LIBDIR/libwgpu_native.a dist/$$ARCHIVEDIR/lib; \
For reference, the folder structure was updated in #417 and #419, but we missed updating the include path because there’s no testing infrastructure for the built archives at the moment.
I know I said I don't care ... but changing the contents of a file in the makefile is rather unexpected and may cause confusion.
What about option B? Keeping webgpu.h
and wgpu.h
together does feel nice and simple, and wgpu.h
basically defines 'extensions' so webgpu, so it kinda makes sense (to me)?
IMHO option B is simpler and more intuitive, I don't think it causes any trouble to have both headers in the same folder.
If Option B feels like a better solution, here is an alternative PR (which indeed only affects the Makefile): https://github.com/gfx-rs/wgpu-native/pull/425
Thanks @eliemichel! Closing in favor of #425
The generated release zips files are organized as follows:
However,
wgpu.h
includeswebgpu.h
with#include "webgpu.h"
, which forces to addinclude/webgpu/
to the include directories, while it feels more idiomatic to only includeinclude/
. Other implementations also havewebgpu.h
in ainclude/webgpu/
subfolder so I suggest leaving this so, leading to two possible fixes:wgpu.h
(this PR)wgpu.h
ininclude/webgpu/
instead ofinclude/wgpu/
(what I had been doing manually in my distributions so far) -> edit: alternative PR for this option: https://github.com/gfx-rs/wgpu-native/pull/425