-
-
Notifications
You must be signed in to change notification settings - Fork 340
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
[feature] support more architectures #1753
Comments
I don't think we would consider moving away. It's the only Go-only SQLite implementation I'm aware of, and having tried using one with CGO bindings (issues with CGO aside) there's definitely differences between the two causing issues with the way we use the connection concurrently. However one thing we could consider is supporting build-tags that build a binary with SQLite + PostgreSQL support, SQLite only, PostgreSQL only. Which might solve this situation in some way. |
Looking at the cznic/libc repo, it seems support for most of the *BSDs has landed in some initial form, but it got stuck about a year ago. One potential alternative could be something like sqld. It does require running That way, we could drop the dependency on modernc.org/sqlite and their C-to-Go compiler, which would potentially allow for supporting all GOOS/GOARCH combinations Go itself supports. |
Heh, almost. The WASM build doesn't run on the BSDs yet because a locking primitive that's needed there (for SQLite, not GtS) isn't implemented yet. But if someone gets around to ncruces/go-sqlite3#85 then yes, I think that would solve the alternative architectures. Wazero (the WASM runtime) is a CGo-free implementation in Go and as such should work for any supported architecture by the Go compiler. |
Oh actually, it's fine as long as you run with |
@igalic I think this may also be of interest to you? |
Once we switch permanently to wasm sqlite3 we can update our CI stuff to build for additional architectures :) |
It's worth noting that the WASM SQLite build, by virtue of going through the wazero runtime, only officially supports 32-bit and 64-bit Intel/AMD and ARM. It's a CGo-free runtime, so it works on anything the Go compiler supports, but performance might not be part of the game. That's not really a problem for us since we don't support stuff like linux/s390, but this also means that something like openbsd/ppc64 might not work well. The same for any RISCv64 or MIPS targets. That's no different from using the modernc build which comes with more constraints, so in that sense we're not regressing here. |
This includes support for journal mode set to WAL on the BSDs. Relates to: superseriousbusiness#1753, superseriousbusiness#2962
This includes support for journal mode set to WAL on the BSDs. Relates to: superseriousbusiness#1753, superseriousbusiness#2962
Hopefully this helps. Or not. Maybe it's even more confusing. But I tried! |
So, I just released The new It's single process only (only a single process should access a database file at a time), but coordination between Caution: you will corrupt your database if use other processes to access databases concurrently with a In terms of deployment issues, it should be noted that, a That said… I do NOT recommend the These are better off using vanilla builds of the package:
All of the above support file locking and WAL mode out-of-the-box. |
Hey! I'd like to understand if there's a specific issue makes you recommend moderncsqlite on FreeBSD amd64? Nothing against it, whatever works best, I'd just like to understand if there's anything I can fix on my end. |
Just FYI, I've patched wazero to enable the compiler in a bunch of different platforms, and my test suite runs fine almost everywhere except OpenBSD (not sure if that's fixable). There are some challenges to getting this change submitted to wazero, though. |
Oh nice nice nice! That's great news :)
At the time we had some reports that people were struggling with backups + file locks or something along those lines, so we recommended moderncsqlite because it seemed to not present those issues. But in future it would be nice if we can just use moderncsqlite for the "nowasm" builds and have everything that can use wasm compiler mode use go-sqlite3 instead, as it makes things simpler. |
Ah, yes. Backing up a WAL database (Litestream, I'll keep poking on the wazero compiler. |
First step: tetratelabs/wazero#2338 |
Oooooh hell yeah that's exciting!!! You've been working your arse off, looks like! |
Final step: tetratelabs/wazero#2343 Anyone who wants to test, we'd welcome the feedback. |
|
Is your feature request related to a problem ?
I'm maintaining the package for gotosocial in pkgsrc. It is limited to amd64/x86_64 (at least for NetBSD and FreeBSD, https://gitlab.com/cznic/libc/-/issues/15 , https://gitlab.com/cznic/libc/-/issues/12 , https://gitlab.com/cznic/libc/-/issues/11 ) because of the sqlite implementation being used, if I remember this correctly.
Would moving away from this implementation and supporting more architectures something you'd consider (or alternatively, what else is blocking you)?
The text was updated successfully, but these errors were encountered: