go-internal icon indicating copy to clipboard operation
go-internal copied to clipboard

Using golang.org/dl/go1.12 with testscript

Open pwaller opened this issue 5 years ago • 3 comments

Hi, I have go in my $PATH by symlinking to a golang.org/dl/go* binary. The problem is, that binary seems to locate itself by using the home directory.

The net result is that when I run this, exec go build doesn't work, because:

> exec go build
[stderr]
go1.12: not downloaded. Run 'go1.12 download' to install to /no-home/sdk/go1.12

... i.e, it thinks it isn't yet installed. Any tricks for working around this?

pwaller avatar Mar 16 '19 22:03 pwaller

@mvdan - do you use golang.org/dl/go*?

I'm afraid I don't use it. Instead I have full installs and use process mount namespaces to flip between versions (largely to avoid any issues with binaries being called go1.12 etc)

myitcv avatar Mar 21 '19 16:03 myitcv

Hmm, I do use golang.org/dl/go* for old Go versions. Right now, I have go1.11.5 set up via that.

Perhaps a way to work around this would be to run testscript with an explicit GOROOT, and then teach programs like go1.11.5 to look there.

mvdan avatar Mar 21 '19 16:03 mvdan