go tool dist: FAILED: not a Git repo; must put a VERSION file in $GOROOT

321 views
Skip to first unread message

Lonnie TC

unread,
Aug 27, 2022, 3:06:32 PM8/27/22
to golang-nuts
Hi All,

I hope that everyone is doing well today.
I am working on a Golang project to port go-pmem over to MSYS2 using MinGW 64:


In trying to build the patched Go distro toolchain, I am getting some strange error in the build that I do not know how to handle and am hoping that someone can answer this for me.

go tool dist: FAILED: not a Git repo; must put a VERSION file in $GOROOT

any help would be truly appreciate.

Have a great day,
Lonnie



Ian Lance Taylor

unread,
Aug 27, 2022, 3:21:15 PM8/27/22
to Lonnie TC, golang-nuts
I don't know what go-pmem is, but a Go distribution should have a file
$GOROOT/VERSION that contains the version number of the release. If
you download the sources of, say, the Go 1.19 release, you will see a
VERSION file. For development purposes, if that VERSION file does not
exist, the Go build will pull the version from the git repo. You seem
to have Go sources that are not in a git repo and also do not have a
VERSION file. That setup is not expected or supported. The simple
fix is to create your own VERSION file.

Ian

twp...@gmail.com

unread,
Nov 8, 2023, 7:00:55 PM11/8/23
to golang-nuts
For info, this is broken in Fedora 39, released a day or two ago:

$ docker pull fedora:latest
$ docker run -it fedora:latest /bin/bash
[root@01330dfaac82 /]# dnf update && dnf install -y golang
...
[root@01330dfaac82 /]# go version
go version go1.21.3 linux/amd64
[root@01330dfaac82 /]# go tool dist list

go tool dist: FAILED: not a Git repo; must put a VERSION file in $GOROOT

twp...@gmail.com

unread,
Nov 8, 2023, 7:13:57 PM11/8/23
to golang-nuts
Reply all
Reply to author
Forward
0 new messages