Open nezvers opened 4 months ago
Thanks for the feedback!
I fail to see the justified existence of Python in the build setup.
It was the quickest way to hack in a download step when I was working on my last project. I also would prefer a zig-only version of the build script though. I might port it when I have time (I also would be happy to accept a PR :))
- It is used for a task that shouldn't be there (by reading code it looks like it downloads and unpacks
A project made with Odin means that a working Odin is already set up. Odin is accessible with PATH or working directory path.
I wanted to set it up in such a way that only zig
and git
are required for getting started (hence the download/unpack step -- granted this is written in Python atm, but like I mentioned I was interested in porting this to Zig). When I want to build my project on a new box, I don't want to have to visit both Zig and Odin's respective websites to download/unpack/add binary to the path. If it were just an apt-get
or winget install
away I wouldn't have this issue. I'll consider moving the dependency install steps to a standalone python/zig script though so it's an optional step for folks who already have odin and zig in the PATH. The tight integration with the zig build process is actually ickier than I was expecting and the whole addOutputFileArg("odin");
bit is a hack anyway.
Likewise emsdk is also already set up in PATH. I don't understand what's going on there with --sysroot emsdk/upstream/emscripten.
The sysroot flag doesn't just let the zig build process know where the emcc binary is, it also adds an important include paths: https://github.com/charles-l/zig-odin-raylib-template/blob/master/build.zig#L77
I based the emcc code off the old pacman.zig
WASM demo. It looks like in the latest version this is a packaged in a nicer way, but the hack still lives there. In any case, it's definitely worth "borrowing" the latest sokol-zig emsdk build.zig
code so it's nicer to work with :P I hadn't seen those improvements, but I'm happy to use a cleaner approach for the emscripten management code.
Can you explain what that python script is doing? I tried to bypass it to last instructions by pointing to my Odin's directory in python but I didn't get it to work.
I prefer solid point by point instructions (even mentioning adding stuff to OS environment PATH variable) rather than hit a hole in a wall by getting frustrated from intermingle between languages. Just put needed files right into the repository. THEN think how to automate that. Start with simple SHARABLE version.
My only experience with emscriptem that actually compiles is with Raylib gamejam template. There's a makefile in /src folder. It requires fixing EMSDK_PATH, PYTHON_PATH, NODE_PATH. And on top it lacks a raylib building step, so need to build raylib with PLATFORM_WEB and repo being next to template repo. Could be that in raylib you need to fix those variables too.
I had
python
in PATH but set up from windows store to getpython3
name in PATH.I fail to see the justified existence of Python in the build setup.
A project made with Odin means that a working Odin is already set up. Odin is accessible with PATH or working directory path.
Likewise
emsdk
is also already set up in PATH. I don't understand what's going on there with--sysroot emsdk/upstream/emscripten
.I'm totally down for utilizing zig as a compiler and build script.