yay-12.3.0 fails to compile from AUR package
Affected Version
12.3.0
Describe the bug
$ makepkg --skippgpcheck --nocheck --nosign --holdver
#7 3.4[97](https://github.com/jackrosenthal/pkgbuild/actions/runs/7968559893/job/21753060462#step:8:98) ==> Making package: yay 12.3.0-1 (Tue Feb 20 04:45:17 2024)
#7 3.500 ==> Checking runtime dependencies...
#7 3.554 ==> Checking buildtime dependencies...
#7 3.608 ==> Retrieving sources...
#7 3.616 -> Downloading yay-12.3.0.tar.gz...
#7 3.621 % Total % Received % Xferd Average Speed Time Time Time Current
#7 3.621 Dload Upload Total Spent Left Speed
#7 3.622
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
#7 3.759
2 445k 2 12191 0 0 88745 0 0:00:05 --:--:-- 0:00:05 88745
[100](https://github.com/jackrosenthal/pkgbuild/actions/runs/7968559893/job/21753060462#step:8:101) 445k 100 445k 0 0 2720k 0 --:--:-- --:--:-- --:--:-- 16.2M
#7 3.796 ==> WARNING: Skipping verification of source file PGP signatures.
#7 3.800 ==> Validating source files with sha256sums...
#7 3.801 yay-12.3.0.tar.gz ... Passed
#7 3.812 ==> Extracting sources...
#7 3.833 -> Extracting yay-12.3.0.tar.gz with bsdtar
#7 3.867 ==> Starting build()...
#7 3.946 go build -trimpath -mod=readonly -modcacherw -ldflags '-X "main.yayVersion=12.3.0" -X "main.localePath=/usr/share/locale/" -linkmode=external' -buildmode=pie -o yay
#7 3.967 go: downloading github.com/Jguer/aur v1.2.3
#7 3.967 go: downloading github.com/Jguer/votar v1.0.0
#7 3.967 go: downloading github.com/Jguer/go-alpm/v2 v2.2.1
#7 3.976 go: downloading github.com/Morganamilo/go-srcinfo v1.0.0
#7 4.173 go: downloading github.com/deckarep/golang-set/v2 v2.6.0
#7 4.178 go: downloading github.com/leonelquinteros/gotext v1.5.2
#7 4.209 go: downloading github.com/pkg/errors v0.9.1
#7 4.227 go: downloading golang.org/x/sys v0.17.0
#7 4.314 go: downloading github.com/Morganamilo/go-pacmanconf v0.0.0-202[105](https://github.com/jackrosenthal/pkgbuild/actions/runs/7968559893/job/21753060462#step:8:106)02[114](https://github.com/jackrosenthal/pkgbuild/actions/runs/7968559893/job/21753060462#step:8:115)700-cff030e927a5
#7 4.362 go: downloading github.com/adrg/strutil v0.3.1
#7 4.385 go: downloading github.com/hashicorp/go-multierror v1.1.1
#7 4.386 go: downloading golang.org/x/term v0.17.0
#7 4.430 go: downloading golang.org/x/text v0.14.0
#7 4.504 go: downloading github.com/itchyny/gojq v0.12.14
#7 4.504 go: downloading github.com/mitchellh/mapstructure v1.5.0
#7 4.525 go: downloading github.com/ohler55/ojg v1.21.2
#7 4.549 go: downloading github.com/hashicorp/errwrap v1.1.0
#7 4.615 go: downloading github.com/itchyny/timefmt-go v0.1.5
#7 5.245 error obtaining VCS status: exit status 128
#7 5.245 Use -buildvcs=false to disable VCS stamping.
#7 5.247 make: *** [Makefile:[117](https://github.com/jackrosenthal/pkgbuild/actions/runs/7968559893/job/21753060462#step:8:118): yay] Error 1
#7 5.253 ==> ERROR: A failure occurred in build().
#7 5.256 Aborting...
#7 ERROR: process "/bin/sh -c makepkg --skippgpcheck --nocheck --nosign --holdver" did not complete successfully: exit code: 4
Reproduction Steps
- Clone https://aur.archlinux.org/packages/yay
- Install build dependencies (
pacman -S --needed --noconfirm git 'go>=1.19' 'pacman>5') - Run
makepkg
Expected behavior
Build completes succesfully
Output
See above
Hey @jackrosenthal , I couldn't reproduce this, could you share your /etc/makepkg.conf and output of go version?
I had the same issue.
Realized I had go v1.20 installed through homebrew. Uninstalling that with brew uninstall go and yay -S go got me v1.22 and yay updated without errors.
In my case, I eventually figured out that it was caused by a .git directory located inside of a directory owned by root.
How I found it: I strace'd the build and eventually found this:
8.636 strace: Process 3224 attached
8.637 [pid 3224] chdir("/pkgbuild") = 0
8.637 [pid 3224] execve("/usr/bin/git", ["git", "status", "--porcelain"], 0xc0000d8820 /* 51 vars */) = 0
8.640 [pid 3224] write(2, "fatal: detected dubious ownershi"..., 162) = 162
An improvement that could be made: the build shouldn't suppress stderr of git. Would've figured this one out way earlier if the error message actually got printed.