Skip to content

Commit 641cc20

Browse files
committed
chore: update to 1.62deepin1
Log: if (_go1_has_minor(21)) ---> if (_go1_has_minor(20))
1 parent a88966c commit 641cc20

File tree

5 files changed

+73
-20
lines changed

5 files changed

+73
-20
lines changed

.mailmap

Lines changed: 0 additions & 1 deletion
This file was deleted.

debian/.gitignore

Lines changed: 0 additions & 7 deletions
This file was deleted.

debian/changelog

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
dh-golang (1.62deepin1) unstable; urgency=medium
2+
3+
* add patch support go list -e in go 1.20
4+
5+
-- xiangzelong <[email protected]> Tue, 16 Jan 2024 15:17:54 +0800
6+
7+
dh-golang (1.62) unstable; urgency=medium
8+
9+
* Team upload.
10+
* Don't capture verbose log when get builddir in autopkgtest.
11+
Regression by ffbfb830: Set GO_TEST_TIMEOUT_SCALE for slow architecture
12+
13+
-- Shengjing Zhu <[email protected]> Tue, 29 Aug 2023 11:04:48 +0800
14+
15+
dh-golang (1.61) unstable; urgency=medium
16+
17+
* Team upload.
18+
* Ignore erroneous packages when listing build packages on Go1.21.
19+
See https://github.com/golang/go/issues/59186
20+
21+
-- Shengjing Zhu <[email protected]> Sat, 26 Aug 2023 23:32:17 +0800
22+
23+
dh-golang (1.60) unstable; urgency=medium
24+
25+
* Team upload.
26+
* Set GOTOOLCHAIN=local to prevent Go1.21+ downloading new version
27+
* Set GO_TEST_TIMEOUT_SCALE for slow architecture.
28+
Go1.21 removes arch-specific timeout scale heuristics.
29+
See https://github.com/golang/go/issues/57117
30+
* Avoid calling go command in global variable (Closes: #1021111)
31+
32+
-- Shengjing Zhu <[email protected]> Thu, 17 Aug 2023 17:37:47 +0800
33+
134
dh-golang (1.59) unstable; urgency=medium
235

336
[ Shengjing Zhu ]

lib/Debian/Debhelper/Buildsystem/golang.pm

Lines changed: 37 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,8 @@ sub set_go_env {
333333
$this->_set_gocache();
334334
$this->_set_go111module();
335335
$this->_set_goproxy();
336+
$this->_set_gotoolchain();
337+
$this->_set_go_test_timeout();
336338
$this->_set_cgo_flags();
337339
$this->_set_gocross();
338340
}
@@ -366,6 +368,26 @@ sub _set_goproxy {
366368
$ENV{GOPROXY} = "off";
367369
}
368370

371+
sub _set_gotoolchain {
372+
# Prevent Go1.21+ downloading new version.
373+
$ENV{GOTOOLCHAIN} = "local";
374+
}
375+
376+
my %GO_TEST_TIMEOUT_MAPPING = (
377+
'arm' => '3',
378+
'mips64el' => '4',
379+
'mipsel' => '4',
380+
'riscv64' => '3',
381+
);
382+
383+
sub _set_go_test_timeout{
384+
my $host_cpu = dpkg_architecture_value("DEB_HOST_ARCH_CPU");
385+
if (defined(my $timeout = $GO_TEST_TIMEOUT_MAPPING{$host_cpu})) {
386+
verbose_print("Set GO_TEST_TIMEOUT_SCALE to $timeout");
387+
$ENV{"GO_TEST_TIMEOUT_SCALE"} = $timeout;
388+
}
389+
}
390+
369391
sub _set_cgo_flags {
370392
my $bf = Dpkg::BuildFlags->new();
371393
$bf->load_config();
@@ -440,16 +462,17 @@ sub _set_gocross {
440462
}
441463
}
442464

443-
my ($_go1_minor) = (qx(go version) =~ /go version go1\.([0-9]+)/);
444-
if (!defined $_go1_minor) {
445-
# Possible pre-release version of gccgo with "go version unknown".
446-
# Derive Go minor version from from GCC major version, e.g.
447-
# "go-12 env GOTOOLDIR" returns "/usr/lib/gcc/x86_64-linux-gnu/12".
448-
# See https://go.dev/doc/install/gccgo#Releases
449-
my ($_gcc_major) = (qx(go env GOTOOLDIR) =~ /\/([0-9]+)$/);
450-
$_go1_minor = $_gcc_major * 2 - 6;
451-
}
452465
sub _go1_has_minor {
466+
my ($_go1_minor) = (qx(go version) =~ /go version go1\.([0-9]+)/);
467+
if (!defined $_go1_minor) {
468+
# Possible pre-release version of gccgo with "go version unknown".
469+
# Derive Go minor version from from GCC major version, e.g.
470+
# "go-12 env GOTOOLDIR" returns "/usr/lib/gcc/x86_64-linux-gnu/12".
471+
# See https://go.dev/doc/install/gccgo#Releases
472+
my ($_gcc_major) = (qx(go env GOTOOLDIR) =~ /\/([0-9]+)$/);
473+
$_go1_minor = $_gcc_major * 2 - 6;
474+
}
475+
453476
my ($minor) = @_;
454477
return $_go1_minor >= $minor;
455478
}
@@ -604,7 +627,11 @@ sub get_targets {
604627
my $this = shift;
605628

606629
my $buildpkg = $ENV{DH_GOLANG_BUILDPKG} || "$ENV{DH_GOPKG}/...";
607-
my $output = qx(go list $buildpkg);
630+
my $listopt = "";
631+
if (_go1_has_minor(20)) {
632+
$listopt = "-e";
633+
}
634+
my $output = qx(go list $listopt $buildpkg);
608635
my @excludes = (exists($ENV{DH_GOLANG_EXCLUDES}) ?
609636
split(' ', $ENV{DH_GOLANG_EXCLUDES}) : ());
610637
my @targets = split(/\n/, $output);

script/dh_golang_autopkgtest

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,9 @@ add_configure_override() {
8787
# Copy instead of symlink as `go list` can't deal with symlinks.
8888
cat >> debian/rules <<'END'
8989
90-
APT_BDIR := $(shell perl -w -MDebian::Debhelper::Dh_Buildsystems -e \
91-
'buildsystems_init(); print load_buildsystem("golang")->get_builddir()')
90+
APT_BDIR := $(shell env --unset=DH_VERBOSE perl -w \
91+
-MDebian::Debhelper::Dh_Buildsystems \
92+
-e 'buildsystems_init(); print load_buildsystem("golang")->get_builddir()')
9293
9394
override_dh_auto_configure:
9495
mkdir -p "${APT_BDIR}"

0 commit comments

Comments
 (0)