Yay: Build Failure with `go` Package

Created on 24 Oct 2019  路  7Comments  路  Source: Jguer/yay

I removed go as @Jguer suggested in Comment to let it reinstall as a dependency with makepkg -si for yay. I cloned a fresh copy of yay, and it still failed to build. go version go1.13.3 linux/amd6

I also tried gcc-go as suggested; it built fine with gcc-go. go version go1.12.2 gccgo (GCC) 9.2.0 linux/amd64

$ sudo pacman -Rscc go
$ git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg -si
==> WARNING: PACKAGER should have the format 'Example Name <[email protected]
d>'
==> Making package: yay 9.4.2-1 (Thu 24 Oct 2019 08:03:50 AM CDT)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Packages (1) go-2:1.13.3-1

Total Installed Size:  478.81 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                     [######################] 100%
(1/1) checking package integrity                   [######################] 100%
(1/1) loading package files                        [######################] 100%
(1/1) checking for file conflicts                  [######################] 100%
(1/1) checking available disk space                [######################] 100%
:: Processing package changes...
(1/1) installing go                                [######################] 100%
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Retrieving sources...
  -> Downloading yay-9.4.2.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   117    0   117    0     0    541      0 --:--:-- --:--:-- --:--:--   541
100  351k  100  351k    0     0   638k      0 --:--:-- --:--:-- --:--:--  638k
==> Validating source files with sha1sums...
    yay-9.4.2.tar.gz ... Passed
==> Extracting sources...
  -> Extracting yay-9.4.2.tar.gz with bsdtar
==> Starting build()...
go build -v -mod=vendor -ldflags '-s -w -linkmode external -extldflags "-Wl,-O1,
--sort-common,--as-needed,-z,relro,-z,now" -X "main.version=9.4.2"' -gcflags all
=-trimpath=/tmp/yay/src/yay-9.4.2 -asmflags all=-trimpath=/tmp/yay/src/yay-9.4.2
 -o yay
runtime
# runtime
/usr/lib/go/src/runtime/stubs_x86.go:10:6: stackcheck redeclared in this block
        previous declaration at /usr/lib/go/src/runtime/stubs_amd64x.go:10:6
/usr/lib/go/src/runtime/unaligned1.go:11:6: readUnaligned32 redeclared in this b
lock
        previous declaration at /usr/lib/go/src/runtime/alg.go:321:40
/usr/lib/go/src/runtime/unaligned1.go:15:6: readUnaligned64 redeclared in this b
lock
        previous declaration at /usr/lib/go/src/runtime/alg.go:329:40
make: *** [Makefile:47: yay] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
Upstream Issue Bug

Most helpful comment

Changing from go-pie to gcc-go fixed it for me.

All 7 comments

This is a go install issue probably, all mentions I've read on this type of error are unclean upgrades of go.
Possibly removing your ${HOME}/go could help it but I'm grasping at straws here

yay is the only thing I use that depends on go. I don't have a ~/go/ directory. I'll uninstall gcc-go, search for and remove any remnants of go in ${HOME}, and try to build with go again.

@crh23, are you also still having trouble?

So no hand installations of go, no exotic hardware, no minimalistic arch build missing things like linux-api-headers?

The only thing I have removed from base is systemd-sysvcompat. Everything else I would say is pretty normal. linux-api-headers is installed.

I also hit this error today. I have go-bindata and go-pie installed, but I did not install go manually.

Changing from go-pie to gcc-go fixed it for me.

@Jguer, I am closing this because I tried building it in docker, and it built fine. Something on my 5+ years old installation of Arch Linux must be causing this. I appreciate your help.

$ sudo docker pull archlinux/base
$ sudo docker run -ti --rm archlinux/base sh
# pacman -Syu git go sudo make gcc fakeroot binutils file awk
# useradd -m test
# su test
$ cd /tmp/
$ git clone https://aur.archlinux.org/yay.git
$ cd yay/
$ makepkg
==> WARNING: PACKAGER should have the format 'Example Name <[email protected]>'
==> Making package: yay 9.4.2-1 (Fri 25 Oct 2019 04:39:34 PM UTC)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading yay-9.4.2.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   117    0   117    0     0    573      0 --:--:-- --:--:-- --:--:--   573
100  351k  100  351k    0     0   682k      0 --:--:-- --:--:-- --:--:--  682k
==> Validating source files with sha1sums...
    yay-9.4.2.tar.gz ... Passed
==> Extracting sources...
  -> Extracting yay-9.4.2.tar.gz with bsdtar
==> Starting build()...
go build -v -mod=vendor -ldflags '-s -w -linkmode external -extldflags "-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" -X "main.version=9.4.2"' -gcflags all=-trimpath=/tmp/yay/src/yay-9.4.2 -asmflags all=-trimpath=/tmp/yay/src/yay-9.4.2 -o yay
==> Entering fakeroot environment...
==> WARNING: PACKAGER should have the format 'Example Name <[email protected]>'
==> Starting package()...
install -Dm755 yay /tmp/yay/pkg/yay/usr/bin/yay
install -Dm644 doc/yay.8 /tmp/yay/pkg/yay/usr/share/man/man8/yay.8
install -Dm644 completions/bash /tmp/yay/pkg/yay/usr/share/bash-completion/completions/yay
install -Dm644 completions/zsh /tmp/yay/pkg/yay/usr/share/zsh/site-functions/_yay
install -Dm644 completions/fish /tmp/yay/pkg/yay/usr/share/fish/vendor_completions.d/yay.fish
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "yay"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: yay 9.4.2-1 (Fri 25 Oct 2019 04:39:48 PM UTC)
Was this page helpful?
5 / 5 - 1 ratings

Related issues

ricochet1k picture ricochet1k  路  4Comments

muesli picture muesli  路  4Comments

Qyriad picture Qyriad  路  4Comments

mmirate picture mmirate  路  3Comments

captn3m0 picture captn3m0  路  4Comments