Hi Vincent, Vincent Bernat <ber...@debian.org> writes: > I have a package (log4go, https://code.google.com/p/log4go/) which > contains an "example" directory. When building with dh-golang, it > tries to build it as a module and fails with an error: > > cd > /tmp/buildd/golang-log4go-0.0~hg48/obj-x86_64-linux-gnu/src/code.google.com/p/log4go/examples > /usr/lib/go/pkg/tool/linux_amd64/6g -o > $WORK/code.google.com/p/log4go/examples/_obj/_go_.6 -p > code.google.com/p/log4go/examples -complete -D > _/tmp/buildd/golang-log4go-0.0~hg48/obj-x86_64-linux-gnu/src/code.google.com/p/log4go/examples > -I $WORK -I > /tmp/buildd/golang-log4go-0.0~hg48/obj-x86_64-linux-gnu/pkg/linux_amd64 > ./ConsoleLogWriter_Manual.go ./FileLogWriter_Manual.go > ./SimpleNetLogServer.go ./SocketLogWriter_Manual.go > ./XMLConfigurationExample.go > # code.google.com/p/log4go/examples > src/code.google.com/p/log4go/examples/FileLogWriter_Manual.go:17: main > redeclared in this block > previous declaration at > src/code.google.com/p/log4go/examples/ConsoleLogWriter_Manual.go:9 > src/code.google.com/p/log4go/examples/SimpleNetLogServer.go:21: main > redeclared in this block > previous declaration at > src/code.google.com/p/log4go/examples/FileLogWriter_Manual.go:17 > src/code.google.com/p/log4go/examples/SimpleNetLogServer.go:25: not enough > arguments in call to net.ResolveUDPAddr > src/code.google.com/p/log4go/examples/SocketLogWriter_Manual.go:9: main > redeclared in this block > previous declaration at > src/code.google.com/p/log4go/examples/SimpleNetLogServer.go:21 > src/code.google.com/p/log4go/examples/XMLConfigurationExample.go:5: main > redeclared in this block > previous declaration at > src/code.google.com/p/log4go/examples/SocketLogWriter_Manual.go:9 > dh_auto_build: go install -x -v code.google.com/p/log4go/... returned exit > code 2 > make: *** [build] Error 2 > dpkg-buildpackage: error: debian/rules build gave error exit status 2 > > Looking at how dh-golang works, I see it asks to build > code/google/com/p/log4go/... I am unsure of the correct way to handle > this. Either this should not be the default or this should be > configurable or maybe upstream should do something to declare the > directory as not a module? I think upstream should make the entire code buildable, even if it’s only examples. After all, having them buildable catches mistakes/errors in those files. To achieve that, upstream can simply move each of these files into a separate directory. After doing that, I get:
go build code.google.com/p/log4go/... # code.google.com/p/log4go/examples/simplenet simplenet/SimpleNetLogServer.go:25: not enough arguments in call to net.ResolveUDPAddr So yeah, there actually is an error in these examples :). Also upstream writes about “goinstall” on their website. Are you sure that project is still alive? I do agree that it would be better if the behavior of dh-golang in that respect was configurable, though, so I’ll see what I can do and close this ticket when it’s done. -- Best regards, Michael -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org