-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Build stage dependencies? #18164
Comments
Should already be possible #14279 |
that imports the dependency's build.zig file, not a module of the dependency |
I think I'm going to have the same issue. I'd like to use I came across https://zig.news/liyu1981/how-to-use-your-fav-pkg-in-buildzig-3ni8 but that solution is not truly the same as using a regular dependency, since the behavior of I'm already trying to support an optional build option where I build that generator as a standalone executable in order to make debugging sessions easier (I dunno how else to debug the build system). So for now I'm considering to workaround that by abandoning the idea of having functional profiling when building, with some sort of conditional compilation: const ztracy = if (is_in_build_system) @import("my_own_dummy_wrappers_that_do_nothing.zig") else @import("ztracy") But I also don't know what to put in Having some kind of proper build-system dependencies would make all this much easier (not just for my specific case, which has some workaround options, but any other cases where a lib is needed (and not necessarily pure zig) without having to overcome different behavior of |
Two comments:
As far as I know, this is the only way to have a build-time dependency on logic provided by a complex dependency (which itself uses the zig package manager for further dependencies). This is an understandable limitation at this stage of Zig but I do hope it can be addressed at some point. |
also looking to do this. it's crazy, but we go hard on earth. |
Currently, we can specify dependencies in
build.zig.zon
and add them in lib, exe or test deps byb.dependency
.However, if the
build.zig
itself wants to use a library,const libname = @import("libname")
inbuild.zig
seems import the build file of the dep. And as a result, I cannot use functions/types in that library.What I need here may be compared to
[build-dependencies]
in Cargo.The text was updated successfully, but these errors were encountered: