marler8997 / ziglibc

193 stars 19 forks source link

small updates to work with current zig #13

Closed ttyyls closed 1 year ago

ttyyls commented 1 year ago

This is an attempt at getting ziglibc to compile and work with zig master branch post all the changes made to the semantics of casting. It was achieved mostly through running zig fmt plus some manual changes where it was required. zig version in use is 0.11.0-dev.3905+309aacfc8

marler8997 commented 1 year ago

Thanks for the contribution. I like to keep formatting/logical changes separate. I see you leveraged "zig fmt" to help with the update. One way to make this work is to use "zig fmt" with an older version of zig, create a commit, then "zig fmt" with the latest "unofficial release" (see https://github.com/marler8997/zig-unofficial-releases).

ttyyls commented 1 year ago

@marler8997 I followed your advice: I reverted the first commit, ran zig fmt with the latest unofficial release at the time (zig 0.11.0-dev.3886+0c1bfe271), then I diffed that against my original commit and added back my changes in a slightly more structured order, last but not least compiled and checked the example to still work under 0.11.0-dev.3941+91daf1c8d as of the latest commit in this pull request.

marler8997 commented 1 year ago

Thanks for doing this, I was ok with just splitting it into 2 commits, but it's fine that you split it into more. Could you remove the first commit and the revert? If not I can do it myself.

ttyyls commented 1 year ago

@marler8997 I rebased all of my changes into 2 commits as I assume you originally wished. Also it wouldn't hurt to add a note about the unofficial releases requirement in the README for future contributors. Cheers!

marler8997 commented 1 year ago

It looks like your first commit is using a newer version zig to run zig fmt, so it mixed formatting/logic changes. ziglibc is currently on version 0.11.0-dev.3312+ab37ab33c. I went ahead and ran zig fmt on ziglibc with that version and pushed to main.

So now you should be free to use zig fmt to update.