-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Packages depending on other packages doesn't work #855
Comments
I think we need to add support for it in
This puts |
I think this is #353 |
should we add a package object similar to the executable and library object? furthermore, does |
As Windows has a maximum size for the command (8K from cmd.exe, 32K from StartProcess()), seems to me that "--pkg-begin" and "--pkg-end" will not scale for large projects with many edges in their package dependency graph. Unless I am missing something? Maybe the tree described by "--pkg-begin" and "--pkg-end" should be imported from a file, instead? |
@BenoitJGirard you are correct. How packages work for zig is still in the design phase. The command line interface is one of the things that will be addressed. I'm planning on publishing a detailed design specification proposal for the zig package manager shortly after 0.4.0 is released. |
@andrewrk Understood. I like how "--pkg-begin" and "--pkg-end" force the explicit listing of the dependencies all the way down the dependency graph. Policing the dependency graph for large projects is one of the headaches we have at my day job. I hope your upcoming design keeps that mindset. |
but we need to workaround ziglang/zig#855
The command used is now |
To run tests requires a carful workaround for packages that depend on packages. See ziglang/zig#855. Basically, tests cannot be ran using "zig build test" because of package dependencies.
This might be working today. Here's what needs to happen for this to be closed:
|
this happened because
but what you really need is
so what they need to do is const pkg_c = Pkg{ .name = "c", .path = .{ .path = "c.zig" } };
const pkg_b = Pkg{ .name = "b", .path = .{ .path = "b.zig" }, .dependencies = &[_]Pkg{ pkg_c } };
exe.addPackage(pkg_b); |
This indeed works today, and has test coverage via these files:
|
* use the new build system API to avoid hard-coded references to zig-cache - image generation now runs in parallel to compilation - it does caching now to make subsequent builds faster (.d file parsing is a TODO in upstream zig however) * avoid having a file be in multiple modules at once, which was always unsound. now everything is properly separated into modules. * communicate git version via build system options API rather than hard-coded dependency on zig-cache directory * delete deps/zig-sdl in favor of using zig package manager * remove workaround for ziglang/zig#855 * update to new `@memset` * update for loop syntax * update reflection semantics * update for breaking std lib changes
Three file example:
a.zig
:b.zig
:c.zig
:build.zig
:When using
zig build
I get:I've looked around in
build.zig
, but it doesn't seem like there is a way to add package pathc.zig
tob
. Actually, it seems thatbuild.zig
just passes the info to the zig compiler through command line args:The text was updated successfully, but these errors were encountered: