libsql icon indicating copy to clipboard operation
libsql copied to clipboard

introduce first iteration of the zig build

Open levydsa opened this issue 1 year ago • 6 comments

levydsa avatar Jul 09 '24 20:07 levydsa

This tests seem to fail only because of the lack of the zig binary on the PATH. I don't have experience with this, can someone try guide me on how to fix that?

levydsa avatar Jul 11 '24 23:07 levydsa

Hey @levydsa! There's bunch of changes to libsql-sqlite3/src which I would prefer not to see for a build system change because it makes merging from upstream harder. What's the reason for them? For example, there's one that changes struct initialization to use C99 style, which looks dubious to me.

penberg avatar Jul 12 '24 06:07 penberg

@penberg The fields of that struct were changed at some point and this definition was incorrect. You can see a warning in the old build of a function pointer type mismatch. Zig makes this a error by default. Using struct initialization prevents this from happening again. I can revert if it I was actually correct. Other changes are to make it easier/possible to build without the amalgamation, but no substantial change other than some additional declarations and includes. Can you point out some other places that could cause problems?

levydsa avatar Jul 12 '24 06:07 levydsa

Hey @levydsa, ideally a build system change like this changes nothing in libsql3-sqlite/src directory. So let's turn off all the default warnings and so forth and only change things that are absolutely required to have a Zig build.

penberg avatar Jul 15 '24 07:07 penberg

Ok, then. I'll do my best to preserve src/.

levydsa avatar Jul 15 '24 08:07 levydsa

@penberg Done! I can't remove more than that without having to manually concat files to expose declarations.

levydsa avatar Jul 15 '24 17:07 levydsa

We don't have plans to switch to the Zig build so closing this.

penberg avatar Mar 19 '25 07:03 penberg