Comments (5)
My apologies for breaking this for you, I should have tested this code path properly with 0.12.0 before submitting the PR, that's on me.
Indeed, zig is making a push to eliminate all absolute paths in the build system it seems ziglang/zig#18450
Context: andrewrk is the BDFL for zig, so if he's pushing to have it happen, it will most likely happen.
I like the approach dylan proposed here, the only thing I would like to add is maybe a warning that gets printed when using zig 0.12.0 so that people will be aware of future breakage when upgrading to zig 0.13.0. I'm assuming people have little scripts and shell aliases, shell variables, ect, that point to this.
from raylib.
I'm also seeing this issue in my project and agree with @fjebaker assessment of what's happening. The problem arises due to changes in the Zig master branch where the path to the emsdk headers must be a relative path, as mentioned here. Previously, in versions >= 0.12, this path was absolute.
This code in the src/build.zig
is checking that the path is absolute:
var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
dir.close();
However, we need to pass a relative path to b.path(cache_include)
to avoid the error sub_path is expected to be relative to the build root, but was this absolute path
:
raylib.addIncludePath(b.path(cache_include));
Ideally, I'd like to be able to use raylib's master branch with Zig's master branch. To resolve this in a way that doesn't break existing code but enables new development also I propose something like this:
if (comptime builtin.zig_version.minor > 12) {
var dir = std.fs.cwd().openDir(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
dir.close();
raylib.addIncludePath(b.path(cache_include));
} else {
var dir = std.fs.openDirAbsolute(cache_include, std.fs.Dir.OpenDirOptions{ .access_sub_paths = true, .no_follow = true }) catch @panic("No emscripten cache. Generate it!");
dir.close();
raylib.addIncludePath(.{ .path = cache_include });
}
I've made those changes in a fork here, happy to submit a pull request if others agree this change makes sense.
from raylib.
@fjebaker Thanks for reporting! Probably @CosmicBagel should comment on this issue.
from raylib.
Ah dang, I was too slow
from raylib.
Thanks @dylanlangston and @CosmicBagel, the changes merged work for me. Thanks for addressing this so quickly!
Context: andrewrk is the BDFL for zig, so if he's pushing to have it happen, it will most likely happen.
I absolutely love the direction Andrew is taking Zig in! Until the language has arrived at its stable API, these are just the little hacks we'll have to put up with (~;
from raylib.
Related Issues (20)
- [core] Camera near/far values are hard-coded HOT 3
- [rcore][android] ALooper_pollAll has been deprecated on Android NDK Version 27 HOT 1
- [rmodels] access violation in UnloadMesh with mesh from GenMeshCube clone HOT 5
- [textures] Large image sizes (8192 x 8192) overflows GetPixelDataSize() HOT 11
- [rtext] Blurry text when drawing custom font to RenderTexture HOT 3
- [rtextures] `LoadImageSvg()` causes heap buffer overflow when reading from file HOT 3
- Minimizing the window causes a crash when using raylib 32 bit dll from Dolphin Smalltalk external interfacing HOT 1
- Backface culling now working HOT 3
- [build] next release version HOT 3
- [rcore] Provide FLAG_WINDOW_UNFOCUSED functionality for SDL backend HOT 1
- [Examples] Example "models_loading.c" does not build HOT 10
- [core] Memory leak when running first window sample (Nvidia Drivers on Linux) HOT 2
- [misc] Statically linked raylib exposes functions from `src/external/*` HOT 11
- [WIP] [Examples] Update progress for v5.5 HOT 9
- [rcore] [desktop_GLFW] Window System Improvements HOT 10
- [docs] Documentation inconsistently uses Camera/Camera3D. HOT 2
- [rcore] Ability to rebind Capture/F12 hotkey HOT 1
- Request for a Evolve E2 85 Headset instead of the Evolve E2 65
- Truncating buffer in TextFormat might not work as intended HOT 2
- [rcore] Can't compile PLATFORM=PLATFORM_DRM GRAPHICS=GRAPHICS_API_OPENGL_21 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raylib.