Packaging usql - help to limit the scope of the build?
Hi,
I am currently drafting the packaging of usql at
https://salsa.debian.org/go-team/packages/usql/-/merge_requests/1
It has in go.mod a massive list of requires, mainly because it has
support for so many database drivers. I am not interested in packaging
all of them, and I see that e.g. in Arch the maintainer limited the
build by passing custom tags to 'go build'
(https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=usql). This
does not work in Debian as dh_golang will always try to include and
build everything before starting 'go build'. I also tried limiting the
scope with having just a subset of Go project paths in
DH_GOLANG_BUILDPKG, which does the first 'go install' run with a
smaller scope, but the next step want's to build everything anyway.
Any suggestions on what to try next?
Build log at https://salsa.debian.org/go-team/packages/usql/-/jobs/7283520
Error output for context:
# dpkg-buildpackage -b
dpkg-buildpackage: info: source package usql
dpkg-buildpackage: info: source version 0.19.19-1
dpkg-buildpackage: info: source distribution UNRELEASED
dpkg-buildpackage: info: source changed by Otto Kekäläinen <otto@debian.org>
dpkg-buildpackage: info: host architecture amd64
dpkg-source --before-build .
debian/rules clean
dh clean --builddirectory=debian/build --buildsystem=golang
dh_auto_clean -O--builddirectory=debian/build -O--buildsystem=golang
dh_autoreconf_clean -O--builddirectory=debian/build -O--buildsystem=golang
dh_clean -O--builddirectory=debian/build -O--buildsystem=golang
debian/rules binary
dh binary --builddirectory=debian/build --buildsystem=golang
dh_update_autotools_config -O--builddirectory=debian/build
-O--buildsystem=golang
dh_autoreconf -O--builddirectory=debian/build -O--buildsystem=golang
dh_auto_configure -O--builddirectory=debian/build -O--buildsystem=golang
dh_auto_build -O--builddirectory=debian/build -O--buildsystem=golang
cd debian/build && go install -trimpath -v -p 8 github.com/xo/usql
github.com/xo/usql/drivers github.com/xo/usql/drivers/metadata
github.com/xo/usql/drivers/metadata/informationschema
github.com/xo/usql/drivers/metadata/mysql
github.com/xo/usql/drivers/metadata/postgres
github.com/xo/usql/drivers/moderncsqlite
github.com/xo/usql/drivers/mymysql github.com/xo/usql/drivers/mysql
github.com/xo/usql/drivers/sqlite3
github.com/xo/usql/drivers/sqlite3/sqshared github.com/xo/usql/env
github.com/xo/usql/handler github.com/xo/usql/internal
github.com/xo/usql/metacmd github.com/xo/usql/metacmd/charts
github.com/xo/usql/rline github.com/xo/usql/stmt
github.com/xo/usql/styles github.com/xo/usql/text
src/github.com/xo/usql/run.go:14:2: cannot find package
"github.com/go-git/go-billy/v5" in any of:
/usr/lib/go-1.24/src/github.com/go-git/go-billy/v5 (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/go-git/go-billy/v5 (from $GOPATH)
src/github.com/xo/usql/run.go:15:2: cannot find package
"github.com/go-git/go-billy/v5/memfs" in any of:
/usr/lib/go-1.24/src/github.com/go-git/go-billy/v5/memfs (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/go-git/go-billy/v5/memfs
(from $GOPATH)
src/github.com/xo/usql/run.go:16:2: cannot find package
"github.com/go-git/go-billy/v5/osfs" in any of:
/usr/lib/go-1.24/src/github.com/go-git/go-billy/v5/osfs (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/go-git/go-billy/v5/osfs
(from $GOPATH)
src/github.com/xo/usql/run.go:21:2: cannot find package
"github.com/xo/dburl" in any of:
/usr/lib/go-1.24/src/github.com/xo/dburl (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/xo/dburl (from $GOPATH)
src/github.com/xo/usql/drivers/drivers.go:19:2: cannot find package
"github.com/gohxs/readline" in any of:
/usr/lib/go-1.24/src/github.com/gohxs/readline (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/gohxs/readline (from $GOPATH)
src/github.com/xo/usql/drivers/metadata/writer.go:11:2: cannot find
package "github.com/xo/tblfmt" in any of:
/usr/lib/go-1.24/src/github.com/xo/tblfmt (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/xo/tblfmt (from $GOPATH)
src/github.com/xo/usql/env/types.go:17:2: cannot find package
"github.com/jeandeaual/go-locale" in any of:
/usr/lib/go-1.24/src/github.com/jeandeaual/go-locale (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/jeandeaual/go-locale (from $GOPATH)
src/github.com/xo/usql/env/env.go:18:2: cannot find package
"github.com/kenshaw/rasterm" in any of:
/usr/lib/go-1.24/src/github.com/kenshaw/rasterm (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/kenshaw/rasterm (from $GOPATH)
src/github.com/xo/usql/env/env.go:19:2: cannot find package
"github.com/xo/dburl/passfile" in any of:
/usr/lib/go-1.24/src/github.com/xo/dburl/passfile (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/xo/dburl/passfile (from $GOPATH)
src/github.com/xo/usql/text/text.go:163:12: pattern logo.png: no
matching files found
src/github.com/xo/usql/env/types.go:20:2: cannot find package
"github.com/yookoala/realpath" in any of:
/usr/lib/go-1.24/src/github.com/yookoala/realpath (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/yookoala/realpath (from $GOPATH)
src/github.com/xo/usql/drivers/clickhouse/clickhouse.go:12:2: cannot
find package "github.com/ClickHouse/clickhouse-go/v2" in any of:
/usr/lib/go-1.24/src/github.com/ClickHouse/clickhouse-go/v2 (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/ClickHouse/clickhouse-go/v2
(from $GOPATH)
src/github.com/xo/usql/drivers/csvq/csvq.go:12:2: cannot find package
"github.com/mithrandie/csvq-driver" in any of:
/usr/lib/go-1.24/src/github.com/mithrandie/csvq-driver (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/mithrandie/csvq-driver (from $GOPATH)
src/github.com/xo/usql/drivers/csvq/csvq.go:13:2: cannot find package
"github.com/mithrandie/csvq/lib/query" in any of:
/usr/lib/go-1.24/src/github.com/mithrandie/csvq/lib/query (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/mithrandie/csvq/lib/query
(from $GOPATH)
src/github.com/xo/usql/drivers/oracle/oracle.go:12:2: cannot find
package "github.com/sijms/go-ora/v2" in any of:
/usr/lib/go-1.24/src/github.com/sijms/go-ora/v2 (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/sijms/go-ora/v2 (from $GOPATH)
src/github.com/xo/usql/drivers/sqlserver/sqlserver.go:15:2: cannot
find package "github.com/microsoft/go-mssqldb" in any of:
/usr/lib/go-1.24/src/github.com/microsoft/go-mssqldb (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/microsoft/go-mssqldb (from $GOPATH)
src/github.com/xo/usql/drivers/sqlserver/sqlserver.go:21:2: cannot
find package "github.com/microsoft/go-mssqldb/azuread" in any of:
/usr/lib/go-1.24/src/github.com/microsoft/go-mssqldb/azuread (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/microsoft/go-mssqldb/azuread
(from $GOPATH)
src/github.com/xo/usql/drivers/sqlserver/sqlserver.go:22:2: cannot
find package "github.com/microsoft/go-mssqldb/namedpipe" in any of:
/usr/lib/go-1.24/src/github.com/microsoft/go-mssqldb/namedpipe (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/microsoft/go-mssqldb/namedpipe
(from $GOPATH)
src/github.com/xo/usql/drivers/sqlserver/sqlserver.go:23:2: cannot
find package "github.com/microsoft/go-mssqldb/sharedmemory" in any of:
/usr/lib/go-1.24/src/github.com/microsoft/go-mssqldb/sharedmemory (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/microsoft/go-mssqldb/sharedmemory
(from $GOPATH)
src/github.com/xo/usql/drivers/moderncsqlite/moderncsqlite.go:16:2:
cannot find package "modernc.org/sqlite" in any of:
/usr/lib/go-1.24/src/modernc.org/sqlite (from $GOROOT)
/tmp/test/usql/debian/build/src/modernc.org/sqlite (from $GOPATH)
src/github.com/xo/usql/metacmd/charts/charts.go:11:2: cannot find
package "github.com/kenshaw/colors" in any of:
/usr/lib/go-1.24/src/github.com/kenshaw/colors (from $GOROOT)
/tmp/test/usql/debian/build/src/github.com/kenshaw/colors (from $GOPATH)
dh_auto_build: error: cd debian/build && go install -trimpath -v -p 8
github.com/xo/usql github.com/xo/usql/drivers
github.com/xo/usql/drivers/metadata
github.com/xo/usql/drivers/metadata/informationschema
github.com/xo/usql/drivers/metadata/mysql
github.com/xo/usql/drivers/metadata/postgres
github.com/xo/usql/drivers/moderncsqlite
github.com/xo/usql/drivers/mymysql github.com/xo/usql/drivers/mysql
github.com/xo/usql/drivers/sqlite3
github.com/xo/usql/drivers/sqlite3/sqshared github.com/xo/usql/env
github.com/xo/usql/handler github.com/xo/usql/internal
github.com/xo/usql/metacmd github.com/xo/usql/metacmd/charts
github.com/xo/usql/rline github.com/xo/usql/stmt
github.com/xo/usql/styles github.com/xo/usql/text returned exit code 1
make: *** [debian/rules:28: binary] Error 1
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
Reply to: