FS#61541 - [go] "go build -i" broken in 1.11.5

Attached to Project: Community Packages
Opened by Allen Wild (aswild) - Saturday, 26 January 2019, 18:47 GMT
Last edited by Morten Linderud (Foxboron) - Wednesday, 30 January 2019, 22:57 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Bartłomiej Piotrowski (Barthalion)
Morten Linderud (Foxboron)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The "-i" flag of "go build" causes builds to fail with "permission denied" errors for files in /usr/lib/go/pkg/...
Building without the -i flag works fine.

$ cat main.go
package main
import "fmt"
func main() {
fmt.Println("Hello World")
}

$ go build -v -i
errors
internal/race
unicode/utf8
math/bits
runtime/internal/sys
sync/atomic
unicode
runtime/internal/atomic
internal/cpu
go build internal/race: open /usr/lib/go/pkg/linux_amd64/internal/race.a: permission denied
go build errors: open /usr/lib/go/pkg/linux_amd64/errors.a: permission denied
go build runtime/internal/sys: open /usr/lib/go/pkg/linux_amd64/runtime/internal/sys.a: permission denied
go build unicode/utf8: open /usr/lib/go/pkg/linux_amd64/unicode/utf8.a: permission denied
go build sync/atomic: open /usr/lib/go/pkg/linux_amd64/sync/atomic.a: permission denied
go build math/bits: open /usr/lib/go/pkg/linux_amd64/math/bits.a: permission denied
go build runtime/internal/atomic: open /usr/lib/go/pkg/linux_amd64/runtime/internal/atomic.a: permission denied
go build internal/cpu: open /usr/lib/go/pkg/linux_amd64/internal/cpu.a: permission denied
go build unicode: open /usr/lib/go/pkg/linux_amd64/unicode.a: permission denied

$ go clean
$ go clean -cache
$ go list -f '{{.Stale}}' errors
true
$ go list -f '{{.StaleReason}}' errors
build ID mismatch


Additional info:
* go and go-pie version 2:1.11.5-1 have this bug, 1.11.4 does not
* the prebuilt go1.11.5.linux-amd64.tar.gz from https://golang.org/dl does not show this bug
* version 1.11.5 added 'export GO_GCFLAGS="-trimpath=$GOPATH"' to the PKGBUILD. If I remove
this line, some of the gdb tests in check() fail. If I build anyway with --nocheck, the resulting
package works and doesn't have this bug.

Steps to reproduce: compile any go program with the "-i" flag.
This task depends upon

Closed by  Morten Linderud (Foxboron)
Wednesday, 30 January 2019, 22:57 GMT
Reason for closing:  Fixed
Additional comments about closing:  2:1.11.5-2
Comment by Eli Schwartz (eschwartz) - Sunday, 27 January 2019, 04:14 GMT
Thanks for the easy reproducer!
Comment by Allen Wild (aswild) - Monday, 28 January 2019, 14:25 GMT

Loading...