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

Sqlite go #234

Merged
merged 3 commits into from Dec 15, 2022
Merged

Sqlite go #234

merged 3 commits into from Dec 15, 2022

Conversation

Szubie
Copy link
Collaborator

@Szubie Szubie commented Dec 15, 2022

The SQLite package used in Bravetools requires CGO to be enabled to build. This complicates cross-compilation of bravetools and leads to the production of dynamically linked binaries.

An alternative pure-Go SQLite implementation is avilable. This implementation is quite mature, with other projects building on top of it to provide an alternative interface to the standard Go SQLite interface.

According to benchmarks the pure-Go SQlite package is only slightly slower than the CGO version and passes all correctness tests. The platforms supported by the package cover most of our cross-compilation targets with the exception of windows/386 - we may have to drop that if we adopt this package.

Switching to this package allows for production of statically linked binaries by passing CGO_ENABLED=0 to go build. Formerly CGO-dependent pacakges such as net and os/user have pure-Go fallbacks nowadays.

The change is mostly a drop-in replacement, with one or two tweaks.

…idge"

This reverts commit 3f3c0b9.

Certain characters are still not permitted within names of storage
pools, for instance the backslash character. Keep the regex in place to
restrict characters but remove truncation based on length.
…etools without CGO. This makes cross-compilation easier and produces a statically linked binary rather than a dynamically linked one.
@idroz idroz merged commit 7e41392 into bravetools:master Dec 15, 2022
@Szubie Szubie deleted the sqlite-go branch December 15, 2022 16:29
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.

None yet

2 participants