fix garble with newer Go tip versions

Some big changes landed in Go for the upcoming 1.20.

While here, remove the use of GOGC=off with make.bash,
as https://go.dev/cl/436235 makes that unnecessary now.
pull/608/head
Daniel Martí 2 years ago
parent ff521782f1
commit e61317e7ae

@ -78,7 +78,7 @@ jobs:
steps:
- name: Install Go
env:
GO_COMMIT: 5f566d35bf7d590c95f4d1b685b995deeb9ba957 # 2022-10-01
GO_COMMIT: 122a22e0e9eba7fe712030d429fc4bcf6f447f5e # 2022-11-12
run: |
cd $HOME
mkdir $HOME/gotip
@ -89,8 +89,7 @@ jobs:
echo "devel go1.20-${GO_COMMIT}" >VERSION
cd src
# GOGC=off helps Go build about 20% faster, if we can spare memory.
GOGC=off ./make.bash
./make.bash
echo "GOROOT=$HOME/gotip" >>$GITHUB_ENV
echo "$HOME/gotip/bin" >>$GITHUB_PATH
- uses: actions/checkout@v3

@ -729,8 +729,12 @@ func replaceAsmNames(buf *bytes.Buffer, remaining []byte) {
// If the name was qualified, fetch the package, and write the
// obfuscated import path if needed.
// Note that runtime/internal/startlinetest refers to runtime_test in
// one of its assembly files, and we currently do not always collect
// test packages in appendListedPackages for the sake of performance.
// We don't care about testing the runtime just yet, so work around it.
lpkg := curPkg
if asmPkgPath != "" {
if asmPkgPath != "" && asmPkgPath != "runtime_test" {
var err error
lpkg, err = listPackage(goPkgPath)
if err != nil {

@ -336,14 +336,18 @@ func listPackage(path string) (*listedPackage, error) {
panic(fmt.Sprintf("package %q still missing after go list call", path))
}
startTime := time.Now()
// Obtained via scripts/runtime-linknamed-nodeps.sh as of 2022-10-01.
// Obtained via scripts/runtime-linknamed-nodeps.sh as of 2022-11-01.
runtimeLinknamed := []string{
"arena",
"crypto/internal/boring",
"crypto/internal/boring/bcache",
"crypto/internal/boring/fipstls",
"crypto/x509/internal/macos",
"internal/godebug",
"internal/poll",
"internal/reflectlite",
"internal/syscall/unix",
"math/rand",
"net",
"os",
"os/signal",

@ -30,7 +30,8 @@ cp stderr build-error.stderr
stdin build-error.stderr
garble reverse ./build-error
cmp stdout build-error-reverse.stdout
[!go1.20] cmp stdout build-error-reverse.stdout-go1.19
[go1.20] cmp stdout build-error-reverse.stdout-go1.20
[short] stop # no need to verify this with -short
@ -158,8 +159,13 @@ main.main(...)
test/main/long_main.go:11 +0x??
main filename: test/main/long_main.go
-- build-error-reverse.stdout --
-- build-error-reverse.stdout-go1.19 --
# test/main/build-error
test/main/build-error/error.go:18: cannot convert UnobfuscatedStruct{} (value of type UnobfuscatedStruct) to type struct{SomeField int}
exit status 2
exit status 2
-- build-error-reverse.stdout-go1.20 --
go build test/main/build-error: # test/main/build-error
test/main/build-error/error.go:18: cannot convert UnobfuscatedStruct{} (value of type UnobfuscatedStruct) to type struct{SomeField int}
exit status 2
exit status 1

Loading…
Cancel
Save