Skip to content
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

fix(build)!: update to zig 0.14.0 #136

Merged
merged 3 commits into from
Mar 6, 2025
Merged

fix(build)!: update to zig 0.14.0 #136

merged 3 commits into from
Mar 6, 2025

Conversation

robbielyman
Copy link
Collaborator

BREAKING: this PR changes the package name from ziglua to lua_bindings. not using zig in the package name has been repeatedly communicated as best practices, analogous to npm's naming guidelines. for this particular package, this is complicated by the fact that ziglua provides far more than just lua packaged for Zig's build system (which already exists in numerous places), but also aims to provide ergonomic and powerful Zig abstractions on top of the Lua C implementation. For this reason, I chose to add "bindings" to the name.

NB - the "fingerprint" field in build.zig.zon is new in Zig 0.14.0 and is computed in part based on the name. once we have settled on the name, if it is not "lua_bindings" it will be necessary to delete the fingerprint line and regenerated it.

BREAKING: this PR changes the package name from `ziglua` to
`lua_bindings`. not using `zig` in the package name has been
repeatedly communicated as best practices, analogous to `npm`'s naming
guidelines. for this particular package, this is complicated by the
fact that `ziglua` provides far more than just `lua` packaged for
Zig's build system (which already exists in numerous places), but also
aims to provide ergonomic and powerful Zig abstractions on top of the
Lua C implementation. For this reason, I chose to add "bindings" to
the name.

NB - the "fingerprint" field in build.zig.zon is new in Zig 0.14.0 and
is computed in part based on the name. once we have settled on the
name, if it is not "lua_bindings" it will be necessary to delete the
fingerprint line and regenerated it.
@robbielyman
Copy link
Collaborator Author

this would close #117. @natecraddock would really love your input on the name we end up using! not at all attached to lua_bindings and would happily revert to ziglua if you'd rather.

@nurpax
Copy link
Contributor

nurpax commented Mar 6, 2025

FWIW, I'd still vote for ziglua. But I won't be sad with the proposed name either.

@natecraddock
Copy link
Owner

Hmmm. I don't love lua_bindings, but I'm also not sure what else is better. Maybe lua_wrapper? I agree that using just lua doesn't clearly communicate what ziglua does. I also want to follow Zig's recommendations

@robbielyman
Copy link
Collaborator Author

lua_wrapper is better descriptively than lua_bindings, i agree!

@nurpax
Copy link
Contributor

nurpax commented Mar 6, 2025

lua_wrapper seems fine.

I guess ziglua as the repo name still makes sense?

@robbielyman
Copy link
Collaborator Author

yeah, i think ziglua as the repo name is good—it communicates quickly and effectively that this is lua for zig

@natecraddock
Copy link
Owner

Okay let's do lua_wrapper then. I guess that means usage in build.zig would look something like this

    const lua_wrapper = b.dependency("lua_wrapper", .{
        .target = target,
        .optimize = optimize,
    });

    // ... snip ...

    // add the ziglua module and lua artifact
    exe.root_module.addImport("ziglua", lua_wrapper.module("ziglua"));

Which makes me wonder, do we also change the module name?

@robbielyman
Copy link
Collaborator Author

well, sounds like we have consensus on a good name. i'll go ahead and merge once CI goes green unless anyone has a strong opinion

@nurpax
Copy link
Contributor

nurpax commented Mar 6, 2025

So when adding a dependency with

zig fetch --save git+https://github.com/natecraddock/ziglua

I guess the dependency name will be ziglua in the zon file? Or how is that decided?

@robbielyman robbielyman merged commit 1a18506 into main Mar 6, 2025
3 checks passed
@natecraddock
Copy link
Owner

natecraddock commented Mar 6, 2025

I guess the dependency name will be ziglua in the zon file? Kind of a bummer.

That's a good point - if that is the case, not sure what to do about that

@robbielyman
Copy link
Collaborator Author

i think it will be .lua_wrapper, but i'm not sure

@natecraddock
Copy link
Owner

We should be sure to update any comments / docs that use ziglua as a package name (like in the readme)

@nurpax
Copy link
Contributor

nurpax commented Mar 6, 2025

I'll try it out. It'd make sense that the .name field is used for this.

@nurpax
Copy link
Contributor

nurpax commented Mar 6, 2025

How build.zig.zon behaves with zig fetch --save git+https://github.com/natecraddock/ziglua:

    .dependencies = .{
        .lua_wrapper = .{
            .url = "git+https://github.com/natecraddock/ziglua#1a18506845fee8c4cc9d59e5d0e533843cfc4c7b",
            .hash = "lua_wrapper-0.1.0-OyMC2yDLBAC0aIqxzYpQnnlBWCndv8u2y8zWH9gPGNFh",
        },
    },

It uses the .name field. Phew :)

@robbielyman
Copy link
Collaborator Author

let's continue discussing in #139 :)

@robbielyman robbielyman deleted the zig-0.14 branch March 6, 2025 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants