-
Notifications
You must be signed in to change notification settings - Fork 134
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Global Artifact Caching Breaks Multi-Target Builds #170
Comments
Not-Nik
added a commit
that referenced
this issue
Nov 8, 2024
Should be fixed |
The fix I tried broke the build. Maybe we would need to give each artifact a unique name? |
Well, i don't really know. Can raylib-zig be built without caching the artifact? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey o, 👋 I'm pretty new to both Zig and
raylib-zig
, and I think I stumbled upon a bug while trying to build my project for different platforms. I've discussed this in the Zig Discord server, and they suggested I should report it.What's Happening
I'm trying to build a simple project for multiple targets (like macOS and Windows), but it seems there's an issue with how artifacts are being cached. From what I understand after discussing it in Discord, the problem is that
raylib-zig
is using global variables to cache build artifacts, which doesn't play well with Zig's build system when trying to build for multiple targets.How to Reproduce
I created a minimal test project to demonstrate the issue. Here's how you can try it yourself:
build.zig.zon
:build.zig
:src/main.zig
:The Error
When I run
zig build
, I get this error:From what I learned in the Discord discussion, this happens because the caching system is reusing the first cached artifact instead of creating new ones for different targets.
What Should Happen
The build system should create separate artifacts for each target, allowing us to successfully build for multiple platforms.
Additional Context
The issue seems to be related to the global caching in
build.zig
here:raylib-zig/build.zig
Line 100 in c191e12
I'm still learning Zig and raylib, so please let me know if you need any additional information or if I should test something else! 😊
The text was updated successfully, but these errors were encountered: