On 11/04/25 2:33 am, Nilesh Patra wrote:
> 
> 
> On 11/04/25 2:04 am, Nilesh Patra wrote:
>> On 10 April 2025 10:44:01 pm IST, "Otto Kekäläinen" <o...@debian.org> wrote:
>>> I am reading dh_golang to figure out if there is a way to get around
>>> this.. I guess I could also make a patch that disables those files
>>> with a "go:build" header.
>>
>> That is not a good solution either. Since we are awfully close to get this 
>> building, can you try the approach in docker.io to see if it works?
>>
>> I suspect the exported DH_GOLANG_BUILDPKG does not make it to dh_golang call 
>> for some weird reason.
>>
>> Can you try to override dh_golang and manually pass this like the way it is 
>> done in docker.io? (Avoid the 3 dots ofcourse otherwise it takes up the 
>> subdir as well)
>>
>> My hunch is that it will work.
> 
> My bad -- I looked at your commit and observed that is exactly what you seem 
> to have tried.
> 
> The only other idea I have is to add in DH_GOLANG_EXCLUDES and see if that 
> somehow works.
> the dh_golang script seems to consume targets which seemingly considers the 
> excluded dirs.

I guess doing a "go:build ignore" will be the cheapest and least time consuming 
workaround here.
The below patch gets things building for me but this is sub-optimal and not 
good.

OTOH, adding a -tags options here can fix this isssue w/o go:build ignore

https://salsa.debian.org/go-team/packages/dh-golang/-/blob/debian/sid/script/dh_golang?ref_type=heads#L89


diff --git a/debian/rules b/debian/rules
index 606598f..ec7ef63 100755
--- a/debian/rules
+++ b/debian/rules
@@ -4,8 +4,6 @@ export DH_VERBOSE = 1
 
 # DEBUG: This decreases the scope of "go install"
 export DH_GOLANG_BUILDPKG = \
-       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 \
@@ -16,7 +14,6 @@ export DH_GOLANG_BUILDPKG = \
        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 \
@@ -68,4 +65,4 @@ override_dh_golang:
 # Workaround a dh-golang bug. dh_golang would invoke `go list` and in 
dh_golang, there is no
 # Provision yet to actually pass any tags from d/rules. It also does not 
honour DH_GOLANG_EXCLUDES for
 # listing go mods (via go list).
-       @echo "Skip dh_golang for now" # 
DH_GOLANG_BUILDPKG="$(DH_GOLANG_BUILDPKG)" dh_golang -O--buildsystem=golang 
-O--builddirectory=debian/.build/upstream -- -tags "$(TAGS)"
+       DH_GOLANG_BUILDPKG="$(DH_GOLANG_BUILDPKG)" dh_golang 
-O--buildsystem=golang -O--builddirectory=debian/.build/upstream

Reply via email to