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

sqlite3-binding.c is built even when dynamic linking is requested #318

Closed
marienz opened this issue Jul 24, 2016 · 3 comments
Closed

sqlite3-binding.c is built even when dynamic linking is requested #318

marienz opened this issue Jul 24, 2016 · 3 comments

Comments

@marienz
Copy link

marienz commented Jul 24, 2016

Commit 3a55553 added a +build !libsqlite3 constraint to sqlite3-binding.c. Commit 5505c7c replaced sqlite3-binding.c with an unaltered copy of upstream's amalgamation, accidentally removing the build constraint.

Without this constraint, libsqlite3-binding.c is built even when --tags=libsqlite3 is used (requesting dynamically linking to libsqlite3). This unnecessarily increases build times.

I'd send a pull request that just adds the constraint back, but it's very easy to reintroduce this problem the next time the embedded copy of SQLite is upgraded. Some kind of test is required, and I haven't thought of how to write one yet.

@gammons
Copy link

gammons commented Jul 26, 2016

👍 to this issue. I ran into it using the gorm sqlite3 dialect, which just imports this repo. Just importing the sqlite3 library is enough to cause 25+ second run times on my computer.

Repoing is easy:

package main

import (
    "fmt"

    _ "github.com/mattn/go-sqlite3"
)

func main() {
    fmt.Println("Hi!")
}
~ time go run main.go
Hi!
go run main.go  24.37s user 0.38s system 100% cpu 24.634 total

It takes nearly 25 seconds for each run!

@gammons
Copy link

gammons commented Jul 26, 2016

Nevermind, running go install github.com/mattn/go-sqlite3 fixed my issue. Sorry about the trouble!

@marienz
Copy link
Author

marienz commented Nov 5, 2016

#339 mostly fixed this.

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

2 participants