-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
ability to depend on zig modules #14278
Comments
How are you supposed to handle pure zig packages which in turn depend on for example system libraries? Are you supposed to create a const lib = b.addStaticLibrary("a", "a.zig");
lib.linkSystemLibrary("some-system-library");
lib.linkLibC();
const module = b.addModule("a", "a.zig"); const module = b.addModule("a", "a.zig");
module.linkSystemLibrary("some-system-library");
module.linkLibC(); |
New API introduced: std.Build.addModule This function exposes a zig module with the given name, which can be used by packages that depend on this one via std.Build.Dependency.module. std.Build.Pkg and related functionality is deleted. Every use case has a straightforward upgrade path using the new Module struct. std.Build.OptionsStep.getPackage is replaced by std.Build.OptionsStep.createModule. std.Build.CompileStep.addPackagePath is replaced by std.Build.CompileStep.addAnonymousModule. This partially addresses #14307 by renaming some of the instances of "package" to "module". Closes #14278
New API introduced: std.Build.addModule This function exposes a zig module with the given name, which can be used by packages that depend on this one via std.Build.Dependency.module. std.Build.Pkg and related functionality is deleted. Every use case has a straightforward upgrade path using the new Module struct. std.Build.OptionsStep.getPackage is replaced by std.Build.OptionsStep.createModule. std.Build.CompileStep.addPackagePath is replaced by std.Build.CompileStep.addAnonymousModule. This partially addresses #14307 by renaming some of the instances of "package" to "module". Closes #14278
Nice to see the evolution in package management! FWIW - I'm caching these changes in my toy project https://github.com/korandoru/zig-uuid to demonstrate the usage for new build APIs. |
Extracted from #14265.
Terminology clarification: #14307
Something like this:
build.zig.zon
build.zig
The build.zig file for clap:
See #14282 for depending on pure zig modules without executing build.zig logic.
See #14286 for running build.zig logic in a sandbox.
The text was updated successfully, but these errors were encountered: