yingshaoxo / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
6 stars 0 forks source link

Failed build test #1

Open hacker-szabo opened 1 year ago

hacker-szabo commented 1 year ago

Hi,

first of all, thank you very much for solving this problem of go!

I tried to build from source but I got the following failed test:

vcs-test.golang.org rerouted to http://127.0.0.1:42021
https://vcs-test.golang.org rerouted to https://127.0.0.1:33791
go test proxy running at GOPROXY=http://127.0.0.1:34815/mod
--- FAIL: TestScript (0.09s)
    --- FAIL: TestScript/list_issue_59905 (0.16s)
        script_test.go:132: 2023-08-29T21:50:59Z
        script_test.go:134: $WORK=/tmp/cmd-go-test-2600848869/tmpdir968179353/list_issue_599052550368108
        script_test.go:156: 
            # Expect no panic (0.155s)
            > go list -f '{{if .DepsErrors}}{{.DepsErrors}}{{end}}' -export -e -deps
            [stdout]
            [# test/main/level1a
            level1a/pkg.go:5:2: level2x redeclared in this block
                level1a/pkg.go:4:2: other declaration of level2x
            level1a/pkg.go:8:39: undefined: level2y
             # test/main/level1b
            level1b/pkg.go:5:2: level2x redeclared in this block
                level1b/pkg.go:4:2: other declaration of level2x
            level1b/pkg.go:8:39: undefined: level2y
            ]
            > cmpenv stdout wanterr
            diff stdout wanterr
            --- stdout
            +++ wanterr
            @@ -1,9 +1,11 @@
             [# test/main/level1a
             level1a/pkg.go:5:2: level2x redeclared in this block
                level1a/pkg.go:4:2: other declaration of level2x
            +level1a/pkg.go:5:2: "test/main/level1a/level2y" imported as level2x and not used
             level1a/pkg.go:8:39: undefined: level2y
              # test/main/level1b
             level1b/pkg.go:5:2: level2x redeclared in this block
                level1b/pkg.go:4:2: other declaration of level2x
            +level1b/pkg.go:5:2: "test/main/level1b/level2y" imported as level2x and not used
             level1b/pkg.go:8:39: undefined: level2y
             ]

        script_test.go:156: FAIL: testdata/script/list_issue_59905.txt:3: cmpenv stdout wanterr: stdout and wanterr differ
FAIL
FAIL    cmd/go  41.705s

I cloned this repo, navigated to the src/ folder and ran all.bash

I could build the original go sources on my PC.

I am using Linux Mint 20.1, AMD64

I commented out the line at script_test.go:156 and it compiled and seems to work without error with the following code:

package main

import (
    "fmt"
)

func main() {
    test := "test"
    fmt.Println("Hello World")
}

But commenting out the line does not seem to be the good solution and it may will have weird issues in the future.

yingshaoxo commented 9 months ago

Have you tried commit 2a2c258

The release version should be fine, I am going to reverse it back

yingshaoxo commented 9 months ago

You can check this docker build script:

https://gitlab.com/yingshaoxo/use_docker_to_build_static_python3_binary_executable/-/blob/master/Dockerfile_go?ref_type=heads