Hello everyone, I'm fiddling around with <https://...
# contributors
q
Hello everyone, I'm fiddling around with https://github.com/ory/kratos/issues/3631 (Steam integration), trying to do my first things in Go and Kratos. I'm using GoLand and when I run e.g. the tests in selfservice/strategy/oidc/strategy_test.go I'll get this error:
Copy code
=== RUN   TestStrategy
    driver.go:85: 
        	Error Trace:	D:/OpenSource/ory/kratos/internal/driver.go:85
        	            				D:/OpenSource/ory/kratos/internal/driver.go:62
        	            				D:/OpenSource/ory/kratos/selfservice/strategy/oidc/strategy_test.go:63
        	Error:      	Received unexpected error:
        	            	could not create new connection: sqlite3 support was not compiled into the binary
        	            	<http://github.com/ory/kratos/driver.(*RegistryDefault).Init.func1|github.com/ory/kratos/driver.(*RegistryDefault).Init.func1>
        	            		D:/OpenSource/ory/kratos/driver/registry_default.go:679
        	            	<http://github.com/cenkalti/backoff.RetryNotify|github.com/cenkalti/backoff.RetryNotify>
        	            		C:/Users/Tim/go/pkg/mod/github.com/cenkalti/backoff@v2.2.1+incompatible/retry.go:37
        	            	<http://github.com/cenkalti/backoff.Retry|github.com/cenkalti/backoff.Retry>
        	            		C:/Users/Tim/go/pkg/mod/github.com/cenkalti/backoff@v2.2.1+incompatible/retry.go:24
        	            	<http://github.com/ory/kratos/driver.(*RegistryDefault).Init|github.com/ory/kratos/driver.(*RegistryDefault).Init>
        	            		D:/OpenSource/ory/kratos/driver/registry_default.go:659
        	            	<http://github.com/ory/kratos/internal.NewRegistryDefaultWithDSN|github.com/ory/kratos/internal.NewRegistryDefaultWithDSN>
        	            		D:/OpenSource/ory/kratos/internal/driver.go:85
        	            	<http://github.com/ory/kratos/internal.NewFastRegistryWithMocks|github.com/ory/kratos/internal.NewFastRegistryWithMocks>
        	            		D:/OpenSource/ory/kratos/internal/driver.go:62
        	            	<http://github.com/ory/kratos/selfservice/strategy/oidc_test.TestStrategy|github.com/ory/kratos/selfservice/strategy/oidc_test.TestStrategy>
        	            		D:/OpenSource/ory/kratos/selfservice/strategy/oidc/strategy_test.go:63
        	            	testing.tRunner
        	            		E:/Go/src/testing/testing.go:1595
        	            	runtime.goexit
        	            		E:/Go/src/runtime/asm_amd64.s:1650
        	Test:       	TestStrategy
--- FAIL: TestStrategy (303.88s)
Asking uncle Google this seems to be related to some framework called Buffalo, which is in the dependencies as well, but I can't figure out what actually is going wrong. Has anybody seen this before and knows a way around it?
1
b
How are you compiling the binary? Typically, to enable sqlite you’ll need to add
-tags sqlite
to the
go build
command.
q
It seems GoLand's default is to execute
go test -c ...
, that one doesn't like the -tags option
Ah, I've put it into the wrong input box, damn you UIs 😄 Different error:
Copy code
GOROOT=E:\Go #gosetup
GOPATH=C:\Users\Tim\go #gosetup
E:\Go\bin\go.exe test -c -tags sqlite -o C:\Users\Tim\AppData\Local\JetBrains\GoLand2023.3\tmp\GoLand\___1TestStrategy_in_github_com_ory_kratos_selfservice_strategy_oidc.test.exe <http://github.com/ory/kratos/selfservice/strategy/oidc|github.com/ory/kratos/selfservice/strategy/oidc> #gosetup
# <http://github.com/ory/x/sqlcon|github.com/ory/x/sqlcon>
C:\Users\Tim\go\pkg\mod\<http://github.com|github.com>\ory\x@v0.0.604\sqlcon\error_sqlite.go:18:22: undefined: sqlite3.Error
C:\Users\Tim\go\pkg\mod\<http://github.com|github.com>\ory\x@v0.0.604\sqlcon\error_sqlite.go:20:16: undefined: sqlite3.ErrConstraintUnique
C:\Users\Tim\go\pkg\mod\<http://github.com|github.com>\ory\x@v0.0.604\sqlcon\error_sqlite.go:22:16: undefined: sqlite3.ErrConstraintPrimaryKey
C:\Users\Tim\go\pkg\mod\<http://github.com|github.com>\ory\x@v0.0.604\sqlcon\error_sqlite.go:28:16: undefined: sqlite3.ErrError
C:\Users\Tim\go\pkg\mod\<http://github.com|github.com>\ory\x@v0.0.604\sqlcon\error_sqlite.go:32:16: undefined: sqlite3.ErrLocked
I'm wondering if
-tags sqlite
works with
go test -c
as well? It does seem to do something with it
I've tried following the installation steps from https://github.com/mattn/go-sqlite3, installing gcc etc., which succeeded, but still get the same error 😞 I got it to run on my Mac, though, should be good enough. Thanks for your input 🙂
So I reached the "registration flow returns redirect to Steam" milestone now and I'd really appreciate some first feedback on whether I'm on a good way here. I've opened a draft PR at http://github.com/ory/kratos/pull/3762