gpu-dawn: standalone usage: headers are hard to find, need simple C webgpu.h example #605
Labels
No labels
CI
all
basisu
blog
bug
build
contributor-friendly
core
correctness
deferred
dev
direct3d-headers
docs
driver-os-issue
duplicate
dxcompiler
editor
examples
experiment
feature-idea
feedback
flac
freetype
gamemode
gkurve
glfw
gpu
gpu-dawn
harfbuzz
help welcome
in-progress
infrastructure
invalid
libmach
linux-audio-headers
long-term
mach
mach.gfx
mach.math
mach.physics
mach.testing
model3d
needs-triage
object
opengl-headers
opus
os/linux
os/macos
os/wasm
os/windows
package-manager
priority
proposal
proposal-accepted
question
roadmap
slipped
stability
sysaudio
sysgpu
sysjs
validating-fix
vulkan-zig-generated
wayland-headers
website
wontfix
wrench
www
x11-headers
xcode-frameworks
zig-update
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
hexops/mach#605
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi slimsag,
You mention:
But dawn_proc.c references 'dawn/dawn_proc.h' which is nowhere to be found.
If you include a single working hello world triangle C language example that compiles manually with, e.g., 'zig cc' or MSYS2 gcc/clang that would be extremely helpful to those of us who are not build engineers.
I tried building dawn from source following exactly your instructions with newest zig nightly to see if this process would generate the missing glue. I need to build for Windows from Linux so I ran:
This eventually failed trying to compile DX dependencies, first few build errors were:
I've spent several hours at this.
Alas, I'm forced to give up on Zig for now due to my lack of sufficient problem solving skills. On Windows MSYS2 I've built SDL2 with DX9, DX11, and DX12 SDL renderer backends and it all 'just works'.
I built Google Angle before going through the whole depot_tools rigamarole and it did, in the end, 'just work'.
From this day forward, if some Zig evangelist on HN says Zig builds 'just work', I'm sharing my counter-experience that for me it did not 'just work' even after hours upon hours of frustration.
But if I can compile a single C language webgpu.h hello triangle example for Windows then I will share that at least I got that much working. There is a repo that has a bunch of C webgpu.h Dawn examples but they only build on Linux for Linux, no Windows build:
https://github.com/samdauwe/webgpu-native-examples
Hi there
I think that you intended your message in a different way, so I just want to communicate how I interpreted it. I was drinking my morning coffee, saw your issue, and at first I got excited someone was going to try using Zig/mach-gpu-dawn like this. That's a first! I can help with this :) But then I read that last part about "From this day forward, ..." and thought, well, that's kind of F'd. It sounds to me a bit like "fix my issue or else I'll tell people Zig/Mach is shit!" and that was a little hurtful given I haven't even been given the chance to try and help yet.
I do get you're frustrated - modern build systems make me go bonkers too (I sometimes wonder how many software engineers get 'burnt out' just due to shitty build systems), I'm trying to solve this problem every day after hours for free, while working a difficult startup day job, so hopefully the fact that I'm personally passionate about solving this shitty experience for both you and me comes through here :)
The last thing I want to state (since this is a good time to do so) is that the Mach project, it's issue tracker, etc. is for code only. Anything that's not a direct discussion of code/tech, in general, is not welcome. It's just too time-consuming to manage, can baloon quickly into a nasty issue that appears on HN or similar, and after all, we're here for cool code/tech, right? I do absolutely encourage you to share your real experience with Zig and/or Mach other places, though, especially if it's bad or just "doesn't live up to the hype for me!" because I think we need more real experienced voices in our communities rather than endless hype chasing like we see in some other ecosystems cough frontend cough.
About the actual issues at hand..
..regarding Linux -> Windows cross compilation of Dawn from source, you are correct that is broken currently - I am sorry to say:
objidl.hon disk, while being#include'd under bothObjIdl.h,objidl.h, andOBJIDL.hthroughout Microsoft code. It's some absolute insanity on their part, which I haven't yet managed to untangle...regarding the missing source files (your original question):
The complete set of sources and their dependencies needed is:
webgpu.hand otherwebgpu.hversions are not strictly ABI compatible.):Final thought: It's genuinely really cool you're giving this a go! If you want reach out to me on Discord slimsag#2321 I am happy to help more with this if you get stuck. If someone like you is actually using mach-gpu-dawn for this, I am also happy to put a bit of time into e.g. packaging up those headers as a tarball or something in the CI pipeline so it's easier to fetch them if that's better for you. I would love to have a triangle C example using
zig cc, I don't think it'd be too hard to add, I just haven't had time to write up one.Hi slimsag,
Thanks for your detailed reply. I did word my issue very poorly and I do apologize. Insofar as we live in the Age of Entitlement I ought have been more clear that I'm not owed the hard work of others for free.
You come to the heart of the matter when you say this:
This is me.
Solutions like NPM's package-lock.json and Rust's Cargo.lock aren't perfect but they prevent build breaks well enough that developers don't abandon ship for something else.
Debian dpkg was created in the 1990s and mostly 'just works' solving dependencies for both binary and source packages.
So, here we are in the 2020s, it's $CURRENT_YEAR, and Zig hasn't yet solved build breakage frustration as well as its predecessors.
None of this is your fault, of course.
I just found this open issue, "package manager", from Apr 22, 2018:
https://github.com/ziglang/zig/issues/943
Andrew Kelley started Zig in 2015. It's almost 2023. For comparison, how long did Rust take to release Cargo? Debian to come up with dpkg?
I decided to try Zig because of HN evangelism. So my remark about saying I will henceforth be honest about my lousy Zig experience on HN was not intended to be a sulky threat. My Rust experience hasn't been all that the Rust Evangelism Strike Force promised me, either. But getting Rust wgpu samples compiling and running did indeed 'just work' the first try thanks to Cargo 'just working'. So the next time a stupid Rust vs. Zig war breaks out (or tabs vs. spaces, or Emacs vs. vi) I'll be one of the Opinionated Idiots shouting over the voices of others with my woeful tale about how Zig failed to do the thing I wanted Zig to do and therefore Zig eternally forever sucks and no one should ever use it ever.
I'm just kidding, of course. If I have anything to say at all, I'll mention Zig folks are very friendly and helpful at going 'above and beyond', as you've demonstrated, so thank you.
Clearer up-front communication of current Zig instability would help better manage developer expectations. E.g., if ziglang.org made it crystal clear on the front page that Zig is unstable and lacking industrial strength dependency management rather than instead implying Zig is a robust and maintainable C/C++ replacement as if it had already achieved this, then that would spare many a developer from hours of frustration.
But this is something Andrew Kelley should do, not you.
Zig will get there eventually. One day we'll have Year of the Linux Desktop and one day we'll have Year of Zig Build Breaks Solved.
Again, sorry for coming across as sulky and rude. I appreciate your open source contributions and sacrifices, which are well above and beyond my own.
An issue on the https://github.com/ziglang/www.ziglang.org repo on more clearly noting Zig's current instability on the homepage would probably be appreciated.
This made me curious, so I searched it up. Graydon Hoare started work on Rust in 2006, and it became officially sponsered by Mozilla sometime in 2010. Cargo wasn't introduced until 2014, a little after the Rust 1.0 release. Using those dates, it took 8 years for Rust to get a package manager. Zig will likely end up in the same ballpark if the current roadmap pans out.
hey @slimsag I would love to pick up going through providing an example of a triangle in raw webgpu in zig, but I have to agree with @dev-muppet s point that the directions are a bit unclear how to get the raw webgpu calls in mach-gpu built. Could I ask you kindly to provide some steps to go through, and I will try my best to pick it up from there? I would be very invested in this, since me and my buddies are working on a demo engine/tool for our upcoming demoscene productions (go check pouet.net if you are interested in what we are doing) and we would like to use webgpu and zig and hopefully through your library, since you already did the legwork for it for which we are already grateful <3
https://github.com/hexops/mach/issues/1166#issuecomment-2212990680