Is there a way to download go1.18 in debian/rules?

Asked by Lonny Wong

My program have to build with go1.18.

I want to wget go1.18 in the debian/rules.

override_dh_auto_build:
 wget -P /tmp https://go.dev/dl/go1.18.3.linux-amd64.tar.gz
 tar -C /tmp -xzf /tmp/go1.18.3.linux-amd64.tar.gz
 PATH=/tmp/go/bin:${PATH} dh_auto_build

But I got an error:

Resolving go.dev (go.dev)... failed: Name or service not known.
wget: unable to resolve host address ‘go.dev’

https://launchpadlibrarian.net/607900804/buildlog_ubuntu-trusty-amd64.trzsz_0.0.2.1_BUILDING.txt.gz

Thanks for your help.

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Colin Watson
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

Manfred Hampl suggests this article as an answer to your question:
FAQ #167: “My build fails because it can't connect or download from an external URL”.

Revision history for this message
Lonny Wong (lonnywong) said :
#2

Could I use snap to install go1.18 as Build-Depends?

In the debian/control:

Build-Depends: debhelper (>=9),
                               snapd

Where to run "sudo systemctl start snapd.service" and "sudo snap install go --classic" ?

Revision history for this message
Best Colin Watson (cjwatson) said :
#3

Neither general internet access nor installing snaps is permitted in .deb package builds. You'd need to either backport golang-1.18 to trusty yourself, or edit your PPA's dependencies to use another PPA where somebody has already done that. I don't know of one specifically (trusty is a long way back - do you really need to keep supporting that?), but maybe something in https://launchpad.net/ubuntu/+ppas?name_filter=golang will be helpful.

Revision history for this message
Lonny Wong (lonnywong) said :
#4

Thanks Colin Watson, that solved my question.