New Upstream Release - golang-github-petermattis-goid
Ready changes
Summary
Merged new upstream version: 0.0~git20230518.80aa455 (was: 0.0~git20221018.354ef7f).
Resulting package
Built on 2023-05-25T13:45 (took 5m12s)
The resulting binary packages can be installed (if you have the apt repository enabled) by running one of:
apt install -t fresh-releases golang-github-petermattis-goid-dev
Lintian Result
- golang-github-petermattis-goid-dev_0.0~git20230518.80aa455-1~jan+nur1_all.deb
- golang-github-petermattis-goid_0.0~git20230518.80aa455-1~jan+nur1.dsc
- golang-github-petermattis-goid_0.0~git20230518.80aa455-1~jan+nur1_amd64.buildinfo
- golang-github-petermattis-goid_0.0~git20230518.80aa455-1~jan+nur1_amd64.changes
Diff
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 0000000..1230149
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,6 @@
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "daily"
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
new file mode 100644
index 0000000..1a3bf8f
--- /dev/null
+++ b/.github/workflows/go.yml
@@ -0,0 +1,247 @@
+name: Go
+
+on:
+ push:
+ branches:
+ - master
+ pull_request:
+ branches:
+ - master
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ strategy:
+ fail-fast: false
+ matrix:
+ arch:
+ - armv6
+ - armv7
+ - aarch64
+ - 386
+ - x64
+ go:
+ - '1.5'
+ - '1.6'
+ - '1.7'
+ - '1.8'
+ - '1.9'
+ - '1.10'
+ - '1.11'
+ - '1.12'
+ - '1.13'
+ - '1.14'
+ - '1.15'
+ - '1.16'
+ - '1.17'
+ - '1.18'
+ - '1.19'
+ - '1.20'
+ # Race detector binaries crash with:
+ #
+ # FATAL: ThreadSanitizer: unsupported VMA range
+ #
+ # See https://github.com/golang/go/issues/29948.
+ arm64_unsupported_vma_range:
+ - true
+ include:
+ # Race builds are pretty much busted on Go 1.4 and below on systems
+ # with newer C compilers. A number of fixes were backported to
+ # go1.4-bootstrap but not any released version. See
+ # https://github.com/golang/go/compare/go1.4.3...release-branch.go1.4.
+ #
+ # Race builds aren't supported on linux/386.
+ #
+ # Cross-compilation became possible in go1.5 with the removal of C
+ # code from the compiler. See https://go.dev/doc/go1.5#c.
+ #
+ # Race builds aren't supported in gccgo.
+ #
+ # Cross-compilation isn't supported in gccgo.
+ - arch: x64
+ go: '1.3'
+ x64_race_broken: true
+ - arch: x64
+ go: '1.4'
+ x64_race_broken: true
+ - arch: x64
+ go: gccgo-9
+ x64_race_broken: true
+ - arch: x64
+ go: gccgo-10
+ x64_race_broken: true
+ - arch: x64
+ go: gccgo-11
+ x64_race_broken: true
+ - arch: x64
+ go: gccgo-12
+ x64_race_broken: true
+ - arch: x64
+ go: gccgo-13
+ x64_race_broken: true
+ # Go binaries built with Go 1.8 and below are incompatible with QEMU
+ # user-level emulation. See
+ # https://github.com/golang/go/commit/2673f9e.
+ - arch: armv6
+ go: '1.5'
+ qemu_emulation_broken: true
+ - arch: armv6
+ go: '1.6'
+ qemu_emulation_broken: true
+ - arch: armv6
+ go: '1.7'
+ qemu_emulation_broken: true
+ - arch: armv6
+ go: '1.8'
+ qemu_emulation_broken: true
+ - arch: armv7
+ go: '1.5'
+ qemu_emulation_broken: true
+ - arch: armv7
+ go: '1.6'
+ qemu_emulation_broken: true
+ - arch: armv7
+ go: '1.7'
+ qemu_emulation_broken: true
+ - arch: armv7
+ go: '1.8'
+ qemu_emulation_broken: true
+ - arch: aarch64
+ go: '1.5'
+ qemu_emulation_broken: true
+ - arch: aarch64
+ go: '1.6'
+ qemu_emulation_broken: true
+ - arch: aarch64
+ go: '1.7'
+ qemu_emulation_broken: true
+ - arch: aarch64
+ go: '1.8'
+ qemu_emulation_broken: true
+ # Race detector support on linux/arm64 was added in go1.12. See
+ # https://go.dev/doc/go1.12.
+ - arch: aarch64
+ go: '1.5'
+ arm64_race_unsupported: true
+ - arch: aarch64
+ go: '1.6'
+ arm64_race_unsupported: true
+ - arch: aarch64
+ go: '1.7'
+ arm64_race_unsupported: true
+ - arch: aarch64
+ go: '1.8'
+ arm64_race_unsupported: true
+ - arch: aarch64
+ go: '1.9'
+ arm64_race_unsupported: true
+ - arch: aarch64
+ go: '1.10'
+ arm64_race_unsupported: true
+ - arch: aarch64
+ go: '1.11'
+ arm64_race_unsupported: true
+ steps:
+ - uses: actions/checkout@v3
+ - name: Set up Go
+ if: ${{ !startsWith(matrix.go, 'gccgo-') }}
+ uses: actions/setup-go@v4.0.1
+ with:
+ go-version: ${{ matrix.go }}
+ - name: Set up gccgo
+ if: ${{ startsWith(matrix.go, 'gccgo-') }}
+ run: |
+ sudo apt update && \
+ sudo apt install -y ${{ matrix.go }} && \
+ echo ${{ matrix.go }} | sed 's/^gcc//' | xargs -I % ln -s /usr/bin/% /usr/local/bin/go && \
+ go version
+ - name: 'Build with ${{ matrix.go }}'
+ if: ${{ matrix.arch == 'x64' }}
+ run: go build -v ./...
+ - name: 'Build with ${{ matrix.go }}'
+ if: ${{ matrix.arch == '386' }}
+ env:
+ GOARCH: 386
+ run: go build -v ./...
+ - name: 'Check that Get is inlined with ${{ matrix.go }}'
+ if: ${{ !startsWith(matrix.go, 'gccgo-') && matrix.arch == 'x64' }}
+ run: |
+ if echo -e '${{ matrix.go }}\n1.12' | sort -V | head -n1 | xargs test 1.12 = ; then
+ go build -gcflags='-m' 2>&1 | grep 'can inline Get$' > /dev/null
+ fi
+ - name: 'Check that Get is inlined with ${{ matrix.go }}'
+ if: ${{ !startsWith(matrix.go, 'gccgo-') && matrix.arch == '386' }}
+ env:
+ GOARCH: 386
+ run: |
+ if echo -e '${{ matrix.go }}\n1.12' | sort -V | head -n1 | xargs test 1.12 = ; then
+ go build -gcflags='-m' 2>&1 | grep 'can inline Get$' > /dev/null
+ fi
+ - name: 'BuildRace with ${{ matrix.go }}'
+ if: ${{ matrix.arch == 'x64' && !matrix.x64_race_broken }}
+ run: go build -race -v ./...
+ - name: 'Test with ${{ matrix.go }}'
+ if: ${{ matrix.arch == 'x64' }}
+ run: go test -v ./...
+ - name: 'Test with ${{ matrix.go }}'
+ if: ${{ matrix.arch == '386' }}
+ env:
+ GOARCH: 386
+ run: go test -v ./...
+ - name: 'TestRace with ${{ matrix.go }}'
+ if: ${{ matrix.arch == 'x64' && !matrix.x64_race_broken }}
+ run: go test -race -v ./...
+ - name: 'Bench with ${{ matrix.go }}'
+ if: ${{ matrix.arch == 'x64' }}
+ run: go test -bench=. -benchmem -v ./...
+ - name: 'Bench with ${{ matrix.go }}'
+ if: ${{ matrix.arch == '386' }}
+ env:
+ GOARCH: 386
+ run: go test -bench=. -benchmem -v ./...
+ - name: 'BenchRace with ${{ matrix.go }}'
+ if: ${{ matrix.arch == 'x64' && !matrix.x64_race_broken }}
+ run: go test -bench=. -benchmem -race -v ./...
+ - name: 'BuildTest with ${{ matrix.go }} for armv6'
+ if: ${{ matrix.arch == 'armv6' }}
+ env:
+ GOARCH: arm
+ GOARM: 6
+ run: go test -c ./...
+ - name: 'BuildTest with ${{ matrix.go }} for armv7'
+ if: ${{ matrix.arch == 'armv7' }}
+ env:
+ GOARCH: arm
+ GOARM: 7
+ run: go test -c ./...
+ - name: 'BuildTest with ${{ matrix.go }} for aarch64'
+ if: ${{ matrix.arch == 'aarch64' }}
+ env:
+ GOARCH: arm64
+ run: go test -c ./...
+ - name: 'BuildTestRace with ${{ matrix.go }} for aarch64'
+ if: ${{ matrix.arch == 'aarch64' && !matrix.arm64_race_unsupported }}
+ env:
+ GOARCH: arm64
+ CGO_ENABLED: 1
+ run: |
+ # Non-host *.syso files are missing from the Go toolchains provided
+ # by setup-go. See https://github.com/actions/setup-go/issues/181.
+ curl --location --output $(go env GOROOT)/src/runtime/race/race_linux_arm64.syso \
+ https://github.com/golang/go/raw/release-branch.go${{ matrix.go }}/src/runtime/race/race_linux_arm64.syso && \
+ sudo apt update && \
+ sudo apt install gcc-aarch64-linux-gnu && \
+ CC=aarch64-linux-gnu-gcc CC_FOR_TARGET=gcc-aarch64-linux-gnu go test -c -race -o goid.race.test ./...
+ - name: 'DeleteTestRace with $$ {{ matrix.go}} for aarch64'
+ if: ${{ matrix.arch == 'aarch64' && !matrix.arm64_race_unsupported && matrix.arm64_unsupported_vma_range }}
+ run: rm goid.race.test
+ - name: 'Test and Bench with ${{ matrix.go }} on ${{ matrix.arch }}'
+ if: ${{ matrix.arch != '386' && matrix.arch != 'x64' && !matrix.qemu_emulation_broken }}
+ uses: uraimo/run-on-arch-action@v2
+ with:
+ arch: ${{ matrix.arch }}
+ distro: bullseye
+ dockerRunArgs: --mount type=bind,source="$(pwd)",target=/checkout,readonly
+ run: |
+ find /checkout -name '*.test' -type f -executable -print0 | \
+ xargs -t -0 -I '{}' sh -c '{} -test.v && {} -test.bench=. -test.benchmem -test.v'
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index c63ef93..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,11 +0,0 @@
-language: go
-
-go:
- - 1.3.x
- - 1.4.x
- - 1.5.x
- - 1.6.x
- - 1.7.x
- - 1.8.x
- - 1.9.x
- - master
diff --git a/README.md b/README.md
index 828fe95..3fd144c 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,4 @@
-# goid [![Build Status](https://travis-ci.org/petermattis/goid.svg?branch=master)](https://travis-ci.org/petermattis/goid)
+# goid ![Build Status](https://github.com/petermattis/goid/actions/workflows/go.yml/badge.svg)
Programatically retrieve the current goroutine's ID. See [the CI
-configuration](.travis.yml) for supported Go versions. In addition,
-gccgo 7.2.1 (Go 1.8.3) is supported.
+configuration](.github/workflows/go.yml) for supported Go versions.
diff --git a/debian/changelog b/debian/changelog
index 58c395e..dca9f6e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+golang-github-petermattis-goid (0.0~git20230518.80aa455-1) UNRELEASED; urgency=low
+
+ * New upstream snapshot.
+ * New upstream snapshot.
+
+ -- Debian Janitor <janitor@jelmer.uk> Thu, 25 May 2023 13:40:38 -0000
+
golang-github-petermattis-goid (0.0~git20180202.b0b1615-3) unstable; urgency=medium
[ Debian Janitor ]
diff --git a/go.mod b/go.mod
new file mode 100644
index 0000000..1b14bfe
--- /dev/null
+++ b/go.mod
@@ -0,0 +1,3 @@
+module github.com/petermattis/goid
+
+go 1.17
diff --git a/goid_gccgo.go b/goid_gccgo.go
index e655e06..31c14d9 100644
--- a/goid_gccgo.go
+++ b/goid_gccgo.go
@@ -13,6 +13,7 @@
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
+//go:build gccgo
// +build gccgo
package goid
diff --git a/goid_go1.3.go b/goid_go1.3.go
index 9202099..d73b699 100644
--- a/goid_go1.3.go
+++ b/goid_go1.3.go
@@ -13,6 +13,7 @@
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
+//go:build !go1.4
// +build !go1.4
package goid
diff --git a/goid_go1.4.go b/goid_go1.4.go
index ec7fc52..4798980 100644
--- a/goid_go1.4.go
+++ b/goid_go1.4.go
@@ -13,6 +13,7 @@
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
+//go:build go1.4 && !go1.5
// +build go1.4,!go1.5
package goid
diff --git a/goid_go1.5_arm.go b/goid_go1.5.go
similarity index 79%
rename from goid_go1.5_arm.go
rename to goid_go1.5.go
index 97fb816..0938a95 100644
--- a/goid_go1.5_arm.go
+++ b/goid_go1.5.go
@@ -13,13 +13,15 @@
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
-// +build arm
-// +build gc,go1.5
+//go:build (386 || amd64 || amd64p32 || arm || arm64) && gc && go1.5
+// +build 386 amd64 amd64p32 arm arm64
+// +build gc
+// +build go1.5
package goid
-// Backdoor access to runtime·getg().
-func getg() *g // in goid_go1.5plus.s
+// Defined in goid_go1.5.s.
+func getg() *g
func Get() int64 {
return getg().goid
diff --git a/goid_go1.5_arm.s b/goid_go1.5.s
similarity index 67%
rename from goid_go1.5_arm.s
rename to goid_go1.5.s
index edab4d8..40795e4 100644
--- a/goid_go1.5_arm.s
+++ b/goid_go1.5.s
@@ -1,4 +1,4 @@
-// Copyright 2016 Peter Mattis.
+// Copyright 2021 Peter Mattis.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -14,14 +14,28 @@
// for names of contributors.
// Assembly to mimic runtime.getg.
-// This should work on arm64 as well, but it hasn't been tested.
-// +build arm
-// +build gc,go1.5
+//go:build (386 || amd64 || amd64p32 || arm || arm64) && gc && go1.5
+// +build 386 amd64 amd64p32 arm arm64
+// +build gc
+// +build go1.5
#include "textflag.h"
// func getg() *g
TEXT ·getg(SB),NOSPLIT,$0-8
+#ifdef GOARCH_386
+ MOVL (TLS), AX
+ MOVL AX, ret+0(FP)
+#endif
+#ifdef GOARCH_amd64
+ MOVQ (TLS), AX
+ MOVQ AX, ret+0(FP)
+#endif
+#ifdef GOARCH_arm
MOVW g, ret+0(FP)
+#endif
+#ifdef GOARCH_arm64
+ MOVD g, ret+0(FP)
+#endif
RET
diff --git a/goid_go1.5_amd64.go b/goid_go1.5_amd64.go
deleted file mode 100644
index 269abb3..0000000
--- a/goid_go1.5_amd64.go
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2016 Peter Mattis.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied. See the License for the specific language governing
-// permissions and limitations under the License. See the AUTHORS file
-// for names of contributors.
-
-// +build amd64 amd64p32
-// +build gc,go1.5
-
-package goid
-
-func Get() int64
diff --git a/goid_go1.5_amd64.s b/goid_go1.5_amd64.s
deleted file mode 100644
index 416665d..0000000
--- a/goid_go1.5_amd64.s
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright 2016 Peter Mattis.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-// implied. See the License for the specific language governing
-// permissions and limitations under the License. See the AUTHORS file
-// for names of contributors.
-
-// Assembly to mimic runtime.getg.
-
-// +build amd64 amd64p32
-// +build gc,go1.5
-
-#include "go_asm.h"
-#include "textflag.h"
-
-// func Get() int64
-TEXT ·Get(SB),NOSPLIT,$0-8
- MOVQ (TLS), R14
- MOVQ g_goid(R14), R13
- MOVQ R13, ret+0(FP)
- RET
diff --git a/goid_slow.go b/goid_slow.go
index d2d3765..4c6a215 100644
--- a/goid_slow.go
+++ b/goid_slow.go
@@ -13,7 +13,8 @@
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
-// +build go1.4,!go1.5,!amd64,!amd64p32,!arm,!386 go1.5,!go1.6,!amd64,!amd64p32,!arm go1.6,!amd64,!amd64p32,!arm go1.9,!amd64,!amd64p32,!arm
+//go:build (go1.4 && !go1.5 && !amd64 && !amd64p32 && !arm && !386) || (go1.5 && !386 && !amd64 && !amd64p32 && !arm && !arm64)
+// +build go1.4,!go1.5,!amd64,!amd64p32,!arm,!386 go1.5,!386,!amd64,!amd64p32,!arm,!arm64
package goid
diff --git a/runtime_gccgo_go1.8.go b/runtime_gccgo_go1.8.go
index 42c12bc..dfcb74e 100644
--- a/runtime_gccgo_go1.8.go
+++ b/runtime_gccgo_go1.8.go
@@ -1,8 +1,9 @@
+//go:build gccgo && go1.8
// +build gccgo,go1.8
package goid
-// https://github.com/gcc-mirror/gcc/blob/gcc-7-branch/libgo/go/runtime/runtime2.go#L329-L422
+// https://github.com/gcc-mirror/gcc/blob/releases/gcc-7/libgo/go/runtime/runtime2.go#L329-L354
type g struct {
_panic uintptr
diff --git a/runtime_go1.5.go b/runtime_go1.5.go
index e1279a0..6ce2ab8 100644
--- a/runtime_go1.5.go
+++ b/runtime_go1.5.go
@@ -13,6 +13,7 @@
// permissions and limitations under the License. See the AUTHORS file
// for names of contributors.
+//go:build go1.5 && !go1.6
// +build go1.5,!go1.6
package goid
diff --git a/runtime_go1.6.go b/runtime_go1.6.go
index 6b0067b..983d55b 100644
--- a/runtime_go1.6.go
+++ b/runtime_go1.6.go
@@ -1,3 +1,4 @@
+//go:build gc && go1.6 && !go1.9
// +build gc,go1.6,!go1.9
package goid
diff --git a/runtime_go1.9.go b/runtime_go1.9.go
index bf2c696..5283ae0 100644
--- a/runtime_go1.9.go
+++ b/runtime_go1.9.go
@@ -1,3 +1,4 @@
+//go:build gc && go1.9
// +build gc,go1.9
package goid
Debdiff
[The following lists of changes regard files as different if they have different names, permissions or owners.]
Files in second set of .debs but not in first
-rw-r--r-- root/root /usr/share/gocode/src/github.com/petermattis/goid/go.mod -rw-r--r-- root/root /usr/share/gocode/src/github.com/petermattis/goid/goid_go1.5.go -rw-r--r-- root/root /usr/share/gocode/src/github.com/petermattis/goid/goid_go1.5.s
Files in first set of .debs but not in second
-rw-r--r-- root/root /usr/share/gocode/src/github.com/petermattis/goid/goid_go1.5_amd64.go -rw-r--r-- root/root /usr/share/gocode/src/github.com/petermattis/goid/goid_go1.5_amd64.s -rw-r--r-- root/root /usr/share/gocode/src/github.com/petermattis/goid/goid_go1.5_arm.go -rw-r--r-- root/root /usr/share/gocode/src/github.com/petermattis/goid/goid_go1.5_arm.s
No differences were encountered in the control files