mirror of
https://github.com/netbirdio/netbird.git
synced 2026-10-14 01:19:09 +02:00
merge main\
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
//go:build cgo
|
||||
|
||||
package dex
|
||||
|
||||
import (
|
||||
sql "github.com/dexidp/dex/storage/sql"
|
||||
)
|
||||
|
||||
// newSQLite3 builds the dex SQLite3 config. CGO builds use the upstream
|
||||
// struct that takes a File path. Non-CGO builds (see sqlite_nocgo.go) build
|
||||
// the empty stub — `Open()` then returns the dex "SQLite not available"
|
||||
// error, which is correct behaviour for binaries that can't link sqlite3.
|
||||
//
|
||||
// Wrapping the construction this way keeps the call sites in config.go /
|
||||
// provider.go compilable under both build modes — the upstream stub for
|
||||
// !cgo has no File field, so a bare `sql.SQLite3{File: file}` literal fails
|
||||
// the cross-compile for targets like linux/arm/v6 in the release pipeline.
|
||||
func newSQLite3(file string) *sql.SQLite3 {
|
||||
return &sql.SQLite3{File: file}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
//go:build !cgo
|
||||
|
||||
package dex
|
||||
|
||||
import (
|
||||
sql "github.com/dexidp/dex/storage/sql"
|
||||
)
|
||||
|
||||
// newSQLite3 for non-CGO builds. The dex SQLite3 stub has no fields and its
|
||||
// Open() returns an error documenting the missing CGO support, which is the
|
||||
// right behaviour for the cross-compiled artefacts (linux/arm, wasm, etc.)
|
||||
// — those targets never actually run the embedded IdP.
|
||||
//
|
||||
// The `file` argument is ignored intentionally; keeping the signature
|
||||
// matched with sqlite_cgo.go lets the call sites stay identical.
|
||||
func newSQLite3(_ string) *sql.SQLite3 {
|
||||
return &sql.SQLite3{}
|
||||
}
|
||||
Reference in New Issue
Block a user