Skip to content

chore: update to 1.62deepin1 #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .mailmap

This file was deleted.

7 changes: 0 additions & 7 deletions debian/.gitignore

This file was deleted.

33 changes: 33 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
dh-golang (1.62deepin1) unstable; urgency=medium

* add patch support go list -e in go 1.20

-- xiangzelong <[email protected]> Tue, 16 Jan 2024 15:17:54 +0800

dh-golang (1.62) unstable; urgency=medium

* Team upload.
* Don't capture verbose log when get builddir in autopkgtest.
Regression by ffbfb830: Set GO_TEST_TIMEOUT_SCALE for slow architecture

-- Shengjing Zhu <[email protected]> Tue, 29 Aug 2023 11:04:48 +0800

dh-golang (1.61) unstable; urgency=medium

* Team upload.
* Ignore erroneous packages when listing build packages on Go1.21.
See https://github.com/golang/go/issues/59186

-- Shengjing Zhu <[email protected]> Sat, 26 Aug 2023 23:32:17 +0800

dh-golang (1.60) unstable; urgency=medium

* Team upload.
* Set GOTOOLCHAIN=local to prevent Go1.21+ downloading new version
* Set GO_TEST_TIMEOUT_SCALE for slow architecture.
Go1.21 removes arch-specific timeout scale heuristics.
See https://github.com/golang/go/issues/57117
* Avoid calling go command in global variable (Closes: #1021111)

-- Shengjing Zhu <[email protected]> Thu, 17 Aug 2023 17:37:47 +0800

dh-golang (1.59) unstable; urgency=medium

[ Shengjing Zhu ]
Expand Down
47 changes: 37 additions & 10 deletions lib/Debian/Debhelper/Buildsystem/golang.pm
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,8 @@ sub set_go_env {
$this->_set_gocache();
$this->_set_go111module();
$this->_set_goproxy();
$this->_set_gotoolchain();
$this->_set_go_test_timeout();
$this->_set_cgo_flags();
$this->_set_gocross();
}
Expand Down Expand Up @@ -366,6 +368,26 @@ sub _set_goproxy {
$ENV{GOPROXY} = "off";
}

sub _set_gotoolchain {
# Prevent Go1.21+ downloading new version.
$ENV{GOTOOLCHAIN} = "local";
}

my %GO_TEST_TIMEOUT_MAPPING = (
'arm' => '3',
'mips64el' => '4',
'mipsel' => '4',
'riscv64' => '3',
);

sub _set_go_test_timeout{
my $host_cpu = dpkg_architecture_value("DEB_HOST_ARCH_CPU");
if (defined(my $timeout = $GO_TEST_TIMEOUT_MAPPING{$host_cpu})) {
verbose_print("Set GO_TEST_TIMEOUT_SCALE to $timeout");
$ENV{"GO_TEST_TIMEOUT_SCALE"} = $timeout;
}
}

sub _set_cgo_flags {
my $bf = Dpkg::BuildFlags->new();
$bf->load_config();
Expand Down Expand Up @@ -440,16 +462,17 @@ sub _set_gocross {
}
}

my ($_go1_minor) = (qx(go version) =~ /go version go1\.([0-9]+)/);
if (!defined $_go1_minor) {
# Possible pre-release version of gccgo with "go version unknown".
# Derive Go minor version from from GCC major version, e.g.
# "go-12 env GOTOOLDIR" returns "/usr/lib/gcc/x86_64-linux-gnu/12".
# See https://go.dev/doc/install/gccgo#Releases
my ($_gcc_major) = (qx(go env GOTOOLDIR) =~ /\/([0-9]+)$/);
$_go1_minor = $_gcc_major * 2 - 6;
}
sub _go1_has_minor {
my ($_go1_minor) = (qx(go version) =~ /go version go1\.([0-9]+)/);
if (!defined $_go1_minor) {
# Possible pre-release version of gccgo with "go version unknown".
# Derive Go minor version from from GCC major version, e.g.
# "go-12 env GOTOOLDIR" returns "/usr/lib/gcc/x86_64-linux-gnu/12".
# See https://go.dev/doc/install/gccgo#Releases
my ($_gcc_major) = (qx(go env GOTOOLDIR) =~ /\/([0-9]+)$/);
$_go1_minor = $_gcc_major * 2 - 6;
}

my ($minor) = @_;
return $_go1_minor >= $minor;
}
Expand Down Expand Up @@ -604,7 +627,11 @@ sub get_targets {
my $this = shift;

my $buildpkg = $ENV{DH_GOLANG_BUILDPKG} || "$ENV{DH_GOPKG}/...";
my $output = qx(go list $buildpkg);
my $listopt = "";
if (_go1_has_minor(20)) {
$listopt = "-e";
}
my $output = qx(go list $listopt $buildpkg);
my @excludes = (exists($ENV{DH_GOLANG_EXCLUDES}) ?
split(' ', $ENV{DH_GOLANG_EXCLUDES}) : ());
my @targets = split(/\n/, $output);
Expand Down
5 changes: 3 additions & 2 deletions script/dh_golang_autopkgtest
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@ add_configure_override() {
# Copy instead of symlink as `go list` can't deal with symlinks.
cat >> debian/rules <<'END'

APT_BDIR := $(shell perl -w -MDebian::Debhelper::Dh_Buildsystems -e \
'buildsystems_init(); print load_buildsystem("golang")->get_builddir()')
APT_BDIR := $(shell env --unset=DH_VERBOSE perl -w \
-MDebian::Debhelper::Dh_Buildsystems \
-e 'buildsystems_init(); print load_buildsystem("golang")->get_builddir()')

override_dh_auto_configure:
mkdir -p "${APT_BDIR}"
Expand Down