Chore: Disable cgo by default for local builds (#111807)

* disable cgo by default for local builds, also set cgo variable in either case

* actually do not set the default value

* disable cgo for darwin, display sqlite driver in logs

* fix linter warning, although I do not fully agree with it
This commit is contained in:
Serge Zaitsev
2025-09-30 23:06:40 +02:00
committed by GitHub
parent 901dd9506f
commit 174e924e15
5 changed files with 22 additions and 8 deletions
+4
View File
@@ -16,6 +16,7 @@ import (
_ "github.com/lib/pq"
"github.com/prometheus/client_golang/prometheus"
"github.com/grafana/grafana/pkg/util/sqlite"
"github.com/grafana/grafana/pkg/util/xorm"
"github.com/grafana/grafana/pkg/util/xorm/core"
@@ -248,6 +249,9 @@ func (ss *SQLStore) initEngine(engine *xorm.Engine) error {
}
ss.log.Info("Connecting to DB", "dbtype", ss.dbCfg.Type)
if ss.dbCfg.Type == migrator.SQLite {
ss.log.Info("Using SQLite driver", "driver", sqlite.DriverType())
}
if ss.dbCfg.Type == migrator.SQLite && strings.HasPrefix(ss.dbCfg.ConnectionString, "file:") &&
!strings.HasPrefix(ss.dbCfg.ConnectionString, "file::memory:") {
exists, err := fs.Exists(ss.dbCfg.Path)