Yay: go: mod=mod not supported

Created on 29 Feb 2020  路  9Comments  路  Source: Jguer/yay

Affected Version

9.4.6

Issue

I am on a fresh manjaro 19 install and yay can not be installed because mod type is not supported.

Steps to reproduce

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

Output

[kpfromer@kpfromer-manjaro-xps yay]$ makepkg -si
==> Making package: yay 9.4.6-1 (Sat 29 Feb 2020 02:06:59 PM MST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading yay-9.4.6.tar.gz...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   117  100   117    0     0    422      0 --:--:-- --:--:-- --:--:--   422
100  295k  100  295k    0     0   409k      0 --:--:-- --:--:-- --:--:-- 1653k
==> Validating source files with sha1sums...
    yay-9.4.6.tar.gz ... Passed
==> Extracting sources...
  -> Extracting yay-9.4.6.tar.gz with bsdtar
==> Starting build()...
go build -v -mod=mod -ldflags '-s -w -linkmode external -extldflags "-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now" -X "main.version=9.4.6"' -gcflags all=-trimpath=/home/kpfromer/Downloads/yay/src/yay-9.4.6 -asmflags all=-trimpath=/home/kpfromer/Downloads/yay/src/yay-9.4.6 -o yay
-mod=mod not supported (can be '', 'readonly', or 'vendor')
make: *** [Makefile:49: yay] Error 1
==> ERROR: A failure occurred in build().
    Aborting...
stale

Most helpful comment

Well while they are fixing it here is a way to install it manually:

  1. After it fails to install with that error go to src/yay-/Makefile and remove the mod flag from the "GOFLAGS :=" line.
  2. Run this command in the yay folder from the terminal to build yay:
  EXTRA_GOFLAGS="-gcflags all=-trimpath=${PWD} -asmflags all=-trimpath=${PWD}" \
    LDFLAGS="-linkmode external -extldflags \"${LDFLAGS}\"" \
    make VERSION=$pkgver DESTDIR="$pkgdir" build
  1. run the follwing command to install it (or fakeroot it):
    sudo make VERSION=$pkgver DESTDIR="$pkgdir" PREFIX=/usr install
  2. Enjoy yay

All 9 comments

Can confirm having the same issue on a fresh Manjaro install as well

Just removing the -mod flag from the GOFLAGS in the Makefile made the project build with no problems:

# Makefile
#...
GOFLAGS := -v # -mod=mod
EXTRA_GOFLAGS ?=
LDFLAGS := $(LDFLAGS) -X "main.version=${VERSION}"

Well while they are fixing it here is a way to install it manually:

  1. After it fails to install with that error go to src/yay-/Makefile and remove the mod flag from the "GOFLAGS :=" line.
  2. Run this command in the yay folder from the terminal to build yay:
  EXTRA_GOFLAGS="-gcflags all=-trimpath=${PWD} -asmflags all=-trimpath=${PWD}" \
    LDFLAGS="-linkmode external -extldflags \"${LDFLAGS}\"" \
    make VERSION=$pkgver DESTDIR="$pkgdir" build
  1. run the follwing command to install it (or fakeroot it):
    sudo make VERSION=$pkgver DESTDIR="$pkgdir" PREFIX=/usr install
  2. Enjoy yay

Manjaro Stable is on go1.13.8 and packages the latest compatible version of yay in its repositories. I see the latest version of yay is already in the testing repositories of Manjaro, so either we hold and let things fix themselves or we find something that isn't vendoring that works for go 1.12+

(I'm really getting tired of go breaking module management every release)

I see no issue here. Manjaro have a working yay in their repos. And while I'm fine with yay supporting manjaro. Technically the AUR is only supported by arch.

@Morganamilo While I agree, the real problem seems to be with Go (namely, it's module system) itself and not with Manjaro.

I'm still using Go 1.13 in my Arch installation and the build breaks there as well.

Really a bummer to still have these sorts of issues in Go :confused:

  • Arch updated to go1.14
  • this broke yay's go1.13 go vendor
  • instead of pushing to duct tape this, we removed vendoring and use go1.14's -mod=mod
  • So yay and Arch Linux are on 1.14

It's the type of situation where partial upgrades don't work

I think this is related to #1201

The most recent gcc-go package on Arch from core still provides go1.12

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

AdrienLemaire picture AdrienLemaire  路  3Comments

torvic9 picture torvic9  路  4Comments

parkerlreed picture parkerlreed  路  3Comments

makeworld-the-better-one picture makeworld-the-better-one  路  3Comments

ixevix picture ixevix  路  3Comments