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

link with system libsqlite3-dev #234

Closed
onlyjob opened this issue Sep 3, 2015 · 9 comments
Closed

link with system libsqlite3-dev #234

onlyjob opened this issue Sep 3, 2015 · 9 comments

Comments

@onlyjob
Copy link

onlyjob commented Sep 3, 2015

On Debian it should be possible to link go-sqlite3 with system libsqlite3 library instead of a bundled copy of SQLite3 amalgamation.
Package libsqlite3-dev provides static SQLite3 library and development headers.
Please introduce option to allow use of system library.

Thank you.

@aviau
Copy link

aviau commented Sep 3, 2015

This is already possible with:

go build -tags "libsqlite3"

I have written a patch on the Debian repository.

@onlyjob
Copy link
Author

onlyjob commented Sep 3, 2015

Here is the patch:

Description: Use libsqlite3-dev
Author: Alexandre Viau <alexandre@alexandreviau.net>
Last-Update: 2015-09-03

--- a/sqlite3-binding.h
+++ b/sqlite3-binding.h
@@ -1,5 +1 @@
-#ifndef USE_LIBSQLITE3
-#include "code/sqlite3-binding.h"
-#else
 #include <sqlite3.h>
-#endif
--- a/sqlite3-binding.c
+++ /dev/null
@@ -1,4 +0,0 @@
-#ifndef USE_LIBSQLITE3
-# include "code/sqlite3-binding.c"
-#endif
-
--- a/sqlite3_libsqlite3.go
+++ b/sqlite3_libsqlite3.go
@@ -2,7 +2,6 @@
 //
 // Use of this source code is governed by an MIT-style
 // license that can be found in the LICENSE file.
-// +build libsqlite3

 package sqlite3

@mattn
Copy link
Owner

mattn commented Sep 3, 2015

No, it should be interact with build tag. However i could understand what you want. So i'll look into it in later.

@onlyjob
Copy link
Author

onlyjob commented Sep 3, 2015

Thanks.

@mattn
Copy link
Owner

mattn commented Sep 3, 2015

@onlyjob well, do you expect --tags libsqlite3 should be default?

@onlyjob
Copy link
Author

onlyjob commented Sep 3, 2015

I think it would be a good idea. :) It is always better to use system library, when possible.

@mattn
Copy link
Owner

mattn commented Sep 4, 2015

No, I think go-sqlite3 should link static library.

@onlyjob
Copy link
Author

onlyjob commented Sep 4, 2015

@mattn, static linking is a security nightmare.
See https://wiki.debian.org/StaticLinking

@mattn
Copy link
Owner

mattn commented Sep 4, 2015

so I provide way to link shared with --tags libsqlite3.

gjrtimmer added a commit to gjrtimmer/go-sqlite3 that referenced this issue May 26, 2018
Compile Section Closes mattn#175
Compile Section Closes mattn#201
Compile Section Closes mattn#206
Compile Section Closes mattn#404
Compile Section Closes mattn#217
Compile Section Closes mattn#224
Compile Section Closes mattn#234
Compile Section Closes mattn#242
Feature table Closes mattn#255
Description Section Closes mattn#232
Golang:1.6 not supported Closes mattn#272
Golang:1.5 not supported + compilation section Closes mattn#283
usleep Implemented Closes mattn#285
FAQ Section Closes mattn#289
Compile Section closes mattn#295
FAQ Section Closes mattn#305
PR339 Closes mattn#318 mattn#321
Compilation Section Closes mattn#341
PR407 Closes mattn#364
Feature `sqlite_vtable` Closes mattn#393
Compile Section Closes mattn#416
sqlite_trace feature Closes mattn#433
Compilation Section Closes mattn#435
Compilation Section Closes mattn#443
Golang:1.6 Not Supported Closes mattn#445
Compilation Section Closes mattn#451
Compilation Section Closes mattn#467
Compilation Section Closes mattn#491
Compilation Section Closes mattn#495
Compilation Section Closes mattn#505
Compilation Section Closes mattn#557
Compilation Section Closes mattn#560
@mattn mattn closed this as completed in c9394b1 May 27, 2018
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

No branches or pull requests

3 participants