Refactor for improved build.zig integration #20
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi all!
I have this fork / branch that I've been using of zemscripten for my own projects where I attempted to
zig buildzig build --watch~/.config/zig) cache directory, but instead let every zig package which depends on the emsdk have its own instance in the project-specific cache directory (.zig-cache)I see that main recently got some stuff pushed, and there are merge conflicts, but I mainly wanted to start a discussion around the best way of handling caching and integration of the emsd into the watch mechanic and package manager in general. I'd fix up this PR if the flow it sketches out is something that makes sense for zemscripten.
Let me know what you think or if you have any ideas! And thanks for starting zemscripten, it helped a lot when I needed to figure out how to integrate emscripten with zig 🙏
Only use LazyPaths to improve caching and rebuild triggering. To achieve this, don't use addSystemCommand. Instead we have to build small zig programs to act as runArtifacts which allow us to rely on dynamic input and output paths only. Tell me if you know a better way!
Install SDKs into project-specific cache directory which should allow different projects using different emsdk versions more easily on the same build host.
Recursively add a build target's dependencies to the emcc command.