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

introduce first iteration of the zig build #1543

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

levydsa
Copy link
Contributor

@levydsa levydsa commented Jul 9, 2024

No description provided.

Now it can compile sqlite3 without any extensions and wasm support
this might be reverted later, needs further inspection
Due to the sources being amalgamated, this goes unnoticed. There is no
script to generate this file in the current source. Where is this from?
77e6a56 'add libsql_vector tests to veryquick'
@levydsa
Copy link
Contributor Author

levydsa commented Jul 11, 2024

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?

@penberg
Copy link
Collaborator

penberg commented Jul 12, 2024

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.

@levydsa
Copy link
Contributor Author

levydsa commented Jul 12, 2024

@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?

@penberg
Copy link
Collaborator

penberg commented Jul 15, 2024

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.

@levydsa
Copy link
Contributor Author

levydsa commented Jul 15, 2024

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

@levydsa
Copy link
Contributor Author

levydsa commented Jul 15, 2024

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

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.

2 participants