New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing yay broken when GO111MODULE=on #704

Closed
SamWhited opened this Issue Sep 14, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@SamWhited
Copy link

SamWhited commented Sep 14, 2018

Affected Version

$ yay -V
yay v8.1115 - libalpm v11.0.1

This is after I worked around the problem and upgraded. It's more about the build than the version of yay though, so it will still happen on this version upgrading to a newer one or when attempting to rebuild.

Issue

Steps to reproduce

  1. export GO111MODULE=on – enable Go modules (even if we're in GOPATH)
  2. yay -Su yay (or similar: attempt to upgrade yay from an older version anyways)
…
==> Starting build()...
go build -v -ldflags '-s -w -X main.version=8.1115' -o yay
go: cannot determine module path for source directory /home/sam/.cache/yay/yay/src/yay-8.1115 (outside GOPATH, no import comments)
make: *** [Makefile:46: build] Error 1

Adding an import directive (eg. package main // import "github.com/Jguer/yay") should fix this. Alternatively, switching to go modules from dep (or adding a step to the build to generate go mod files from the dep files if you're not ready to switch entirely) would fix it.

@Morganamilo

This comment has been minimized.

Copy link
Collaborator

Morganamilo commented Sep 15, 2018

You had me at.

developers are no longer confined to working inside GOPATH

I'll look into switching to modules then. I don't really follow golang development and this seems brand new. So I'll need to read up on it first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment