You are not logged in.
Core go packages are recognised as stale after package upgrade which results in build failing (building tries to update files in /usr/lib/go/pkg/ and fails due to permission error)
Example:
$ go list -f '{{.Stale}}: {{.StaleReason }}' runtime
true: not installed but available in build cache
Build output:
go build errors: open /usr/lib/go/pkg/linux_amd64/errors.a: permission denied
go build unicode: open /usr/lib/go/pkg/linux_amd64/unicode.a: permission denied
go build encoding: open /usr/lib/go/pkg/linux_amd64/encoding.a: permission denied
go build unicode/utf16: open /usr/lib/go/pkg/linux_amd64/unicode/utf16.a: permission denied
go build crypto/internal/subtle: open /usr/lib/go/pkg/linux_amd64/crypto/internal/subtle.a: permission denied
go build crypto/subtle: open /usr/lib/go/pkg/linux_amd64/crypto/subtle.a: permission denied
go build runtime/internal/sys: open /usr/lib/go/pkg/linux_amd64/runtime/internal/sys.a: permission denied
go build internal/nettrace: open /usr/lib/go/pkg/linux_amd64/internal/nettrace.a: permission denied
....
Downgrading to go-2:1.11.4-1 solves the issue. Upgrading to go-2:1.11.5-1 brings it back.
Offline
I don't understand. Provide an example of code that fails to build. I have no problem building my projects.
https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...
Online
anything with CGO, ie https://github.com/ethereum/go-ethereum
Offline
I have couple projects that use CGO and they build just fine.
So maybe give us step by step directions on how to reproduce the issue, including error messages.
Also are you building as root?
Last edited by ugjka (2019-01-26 07:41:08)
https://ugjka.net
paru > yay | webcord > discord
pacman -S spotify-launcher
mount /dev/disk/by-...
Online
$ pacman -Q go
go-pie 2:1.11.5-1
I don't suspect go vs. go-pie should cause any issues here.
Building go-ethereum which you claim does not work, works for me.
I used "build/env.sh go run build/ci.go install", which not only works fine and results in 17 binaries in build/bin without reporting the errors you described, but also emits a gcc -Wformat-overflow warning when cgo successfully compiled github.com/ethereum/go-ethereum/vendor/gopkg.in/olebedev/go-duktape.v3
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
I am seeing the same thing with all of the exercism.io exercises on the go track (even hello_world since it imports testing). Opening old exercises that did not have this issue when submitted are now displaying errors very similar to those posted above in VSCode.
I have also found that downgrading to go 1.11.4 fixes this issue.
Worth noting is that even though the errors are displayed in vscode, running "go test" passes the tests.
"go test internal/race: open /usr/lib/go/pkg/linux_amd64/internal/race.a: permission denied\ngo test math/bits: open /usr/lib/go/pkg/linux_amd64/math/bits.a: permission denied\ngo test unicode/utf8: open /usr/lib/go/pkg/linux_amd64/unicode/utf8.a: permission denied\ngo test sync/atomic: open /usr/lib/go/pkg/linux_amd64/sync/atomic.a: permission denied\ngo test errors: open /usr/lib/go/pkg/linux_amd64/errors.a: permission denied\ngo test runtime/internal/sys: open /usr/lib/go/pkg/linux_amd64/runtime/internal/sys.a: permission denied\ngo test internal/cpu: open /usr/lib/go/pkg/linux_amd64/internal/cpu.a: permission denied\ngo test unicode: open /usr/lib/go/pkg/linux_amd64/unicode.a: permission denied\ngo test runtime/internal/atomic: open /usr/lib/go/pkg/linux_amd64/runtime/internal/atomic.a: permission denied\n"
Update....
In order to eliminate VSCode as a problem I extracted one of the exercises, and built it stand-alone.
Using 1.11.5 and building without -i option seems to be no problem, building with -i option the following errors are produced.
go build errors: open /usr/lib/go/pkg/linux_amd64/errors.a: permission denied
go build internal/race: open /usr/lib/go/pkg/linux_amd64/internal/race.a: permission denied
go build math/bits: open /usr/lib/go/pkg/linux_amd64/math/bits.a: permission denied
go build unicode: open /usr/lib/go/pkg/linux_amd64/unicode.a: permission denied
go build runtime/internal/sys: open /usr/lib/go/pkg/linux_amd64/runtime/internal/sys.a: permission denied
go build internal/cpu: open /usr/lib/go/pkg/linux_amd64/internal/cpu.a: permission denied
go build runtime/internal/atomic: open /usr/lib/go/pkg/linux_amd64/runtime/internal/atomic.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
After downgrading to 1.11.4 using the -i switch is not a problem.
Here is some test code that I was using to reproduce the errors.
package main
import (
"strings"
"unicode"
"fmt"
)
// Split returns true if rune is delimeter.
func split(r rune) bool {
return r == ' ' || r == '-'
}
// Abbreviate converts phrase into acronym.
func Abbreviate(s string) string {
acronym := ""
words := strings.FieldsFunc(s, split)
for _, word := range words {
if unicode.IsLetter(rune(word[0])) {
acronym += string(unicode.ToUpper(rune(word[0])))
}
}
return acronym
}
func main() {
fmt.Println("Laugh out loud =>", Abbreviate("Laugh out loud"))
}
Last edited by MikeW (2019-01-27 04:35:09)
Offline
What neither of you mentioned was the command line you used to build with.
Having now seen https://bugs.archlinux.org/task/61541 I suppose this is probably the answer -- you used "go build -i".
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
What neither of you mentioned was the command line you used to build with.
Having now seen https://bugs.archlinux.org/task/61541 I suppose this is probably the answer -- you used "go build -i".
That turns out to be the problem in my case. We shall have to wait and see if it also solves the OPs problem too.
Another note, that after figuring out the cause turning off the option "Go: Install Dependencies When Building" in VSCode solves the problem there too.
Offline
go-2:1.11.5-2 or go-2:1.11.5-3 fixed the issue.
Offline