OpenBSD 6.6 "failed to open database" sujoctl

When running on an OpenBSD 6.6 system with sqlite3 installed, the following error message is presented when running sujoctl create-user :

2020/05/06 21:06:52 failed to open database: failed to query schema version: Binary was compiled with 'CGO_ENABLED=0', go-sqlite3 requires cgo to work. This is a stub
Assigned to
6 months ago
6 months ago
No labels applied.

~ols 6 months ago

sqlite3 is installed on the system

$ pkg_info sqlite3
Information for inst:sqlite3-3.27.2p0

~ols 6 months ago

Apologies for the inability to vowel today, I appear to have spelled soju incorrectly pretty much everywhere

~emersion 6 months ago

Can you try compiling with CGO_ENABLED=1? This is required by SQLite.

~ols 6 months ago

yes sure, it appears that the version of cgo i am using has issues with the application. i am building for openbsd but on macos, if that adds to the complication:

$ GOOS=openbsd CGO_ENABLED=1 go build -o sojuctl cmd/sojuctl/main.go
# net
/usr/local/Cellar/go/1.13.1/libexec/src/net/cgo_resold.go:21:84: cannot use _Ctype_ulong(len(b)) (type _Ctype_ulong) as type _Ctype_uint in argument to _C2func_getnameinfo

~emersion 6 months ago

Ah, cross-compilation will prove difficult with cgo. You'll need to setup a C cross-compiler and tell Go how to use it via the CC env variable.

~emersion 6 months ago

Err, the CC env variable.

~ols REPORTED BY_DESIGN 6 months ago

Thanks, I just compiled on OpenBSD instead

Register here or Log in to comment, or comment via email.