Skip to content

std.Build: support exposing and depending on zig modules #14538

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

Merged
merged 1 commit into from
Feb 4, 2023

Conversation

andrewrk
Copy link
Member

@andrewrk andrewrk commented Feb 4, 2023

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", which is why this pull request is marked as "breaking".

real-world example usage

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
@andrewrk andrewrk added breaking Implementing this issue could cause existing code to no longer compile or have different behavior. zig build system std.Build, the build runner, `zig build` subcommand, package management enhancement Solving this issue will likely involve adding new logic or components to the codebase. labels Feb 4, 2023
@andrewrk andrewrk merged commit 693b12f into master Feb 4, 2023
@andrewrk andrewrk deleted the package-modules branch February 4, 2023 06:55
mitchellh added a commit to mitchellh/libxev that referenced this pull request Feb 5, 2023
Addresses the updates from ziglang PR
ziglang/zig#14538
usdogu added a commit to extism/zig-pdk that referenced this pull request Feb 7, 2023
rrbutani added a commit to rrbutani/rosettaboy that referenced this pull request Feb 8, 2023
This is needed for the nix package to build on macOS.

Also bumps the zig deps and has `build.zig` changes to match
ziglang/zig#14498 and ziglang/zig#14538.
jbboehr pushed a commit to jbboehr/rosettaboy that referenced this pull request Feb 9, 2023
This is needed for the nix package to build on macOS.

Also bumps the zig deps and has `build.zig` changes to match
ziglang/zig#14498 and ziglang/zig#14538.
jbboehr pushed a commit to jbboehr/rosettaboy that referenced this pull request Feb 10, 2023
This is needed for the nix package to build on macOS.

Also bumps the zig deps and has `build.zig` changes to match
ziglang/zig#14498 and ziglang/zig#14538.
jbboehr pushed a commit to jbboehr/rosettaboy that referenced this pull request Feb 10, 2023
This is needed for the nix package to build on macOS.

* bump the zig deps and has `build.zig` changes to match ziglang/zig#14498 and ziglang/zig#14538.
* only change preInstall on darwin
* drop the `SDL2` lowercase fix - doesn't appear to be necessary anymore.
* upgrade zig in github actions and pass in nim/zig versions (@jbboehr)
jbboehr pushed a commit to jbboehr/rosettaboy that referenced this pull request Feb 10, 2023
This is needed for the nix package to build on macOS.

* bump the zig deps and has `build.zig` changes to match ziglang/zig#14498 and ziglang/zig#14538.
* only change preInstall on darwin
* drop the `SDL2` lowercase fix - doesn't appear to be necessary anymore.
* upgrade zig in github actions and pass in nim/zig versions (@jbboehr)
jbboehr pushed a commit to jbboehr/rosettaboy that referenced this pull request Feb 10, 2023
This is needed for the nix package to build on macOS.

* bump the zig deps and has `build.zig` changes to match ziglang/zig#14498 and ziglang/zig#14538.
* only change preInstall on darwin
* drop the `SDL2` lowercase fix - doesn't appear to be necessary anymore.
* upgrade zig in github actions and pass in nim/zig versions (@jbboehr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking Implementing this issue could cause existing code to no longer compile or have different behavior. enhancement Solving this issue will likely involve adding new logic or components to the codebase. zig build system std.Build, the build runner, `zig build` subcommand, package management
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ability to depend on zig modules
1 participant