danvergara / dblab

The database client every command line junkie deserves.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"go-sqlite3 requires cgo to work. This is a stub"

gravityFlower opened this issue · comments

Describe the bug
dblab does not start on Windows given an sqlite db. It fails with error message Error: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub

To Reproduce
Steps to reproduce the behavior:

  1. Download dblab_0.16.0_windows_amd64.tar.gz
  2. Extract
  3. Open Windows-Terminal app in extracted Folder
  4. Try to open an sqlite db by running .\dblab.exe --driver sqlite3 --db "P:\ath\To\sqlite.db"

Expected behavior
dblab opens

OS (please complete the following information):

  • Microsoft Windows 10 Pro x64 Version 10.0.19044 Build 19044

That's on me. The tar file contains two files: dblab (the regular binary) and dblab-sqlite (with cgo enabled), but I forgot to mention that on the documentation. Please, use the latter. It should work, otherwise let me know in this thread.

@gravityFlower This is getting addressed in this PR.
Is this new set of instructions work for you, let us know.

Doesn't seem to work for me. Both executables give me the same error.
grafik

Are you sure? Just tested out both binaries and just the regular one fails when I try to open a sqlite database. @israteneda you work with Windows systems right? Can you confirm?

commented

Same on Ubuntu and a SQLite database

Screenshot from 2022-09-23 10-41-07

Seriously guys, still don't what's going on in your systems.

I'm going to spend the rest of the day tracing down the compiling error, maybe it has to do with the goreleaser's cross-compiling limitations.

Just as a note: can confirm the linux version works as expected, tested on wsl/ubuntu 20.04
To confirm it wasn't a local machine error, i set up a virtual machine with a windows 10 iso, downloaded release v0.16.0, ran dblab-sqlite and got the same error.

accidentally closed the issue. Thanks a lot @gravityFlower for going through this. I still tracing down the error. Pretty sure it has to with goreleases. Will setup a better test environment for Windows for the upcoming releases.

commented

Screenshot from 2022-09-23 10-41-07

Seriously guys, still don't what's going on in your systems.

./dblab-sqlite works for me on another system

Looks like I found out what's going on and how to fixed. It seems we need to improve our goreleaser config and build every binary with special care.

I'll keep you posted on any progress.

I dropped a new PR to fix this as I promised a few days ago. Please take a look and feel free to leave a comment if you spot anything wrong.

cc @gravityFlower @jacklocke @israteneda

We're making progress! I was able to compile a binary through the new goreleaser config files. Obviously, installing the correspondent cross-compilation tools and then run it in a Windows virtual machine. Now, we're in a position to ship a candidate release.

Screenshot from 2022-09-28 19-25-52

Finally we have a working release candidate for this. Please, check it out.

https://github.com/danvergara/dblab/releases/tag/v0.16.1-rc1
cc. @gravityFlower @jacklocke @israteneda

The version v0.16.1 of dblab-sqlite doesn't complain anymore and i am able to open an sqlite db under windows 10.