Hi all, I’m new to Go programming and want to contribute to Hugo.
Working my way through the Contribute to Hugo Development article and I’ve run into a problem:
mage -v check fails in go1.17.1 on Windows with this error: cgo: C compiler "gcc" not found: exec: "gcc": executable file not found in %PATH%
I think the root cause is this Golang issue: https://github.com/golang/go/issues/47257 and I have the beginnings of an idea to resolve it in Hugo. I’m keen for any input and guidance the community can offer, and looking forward to getting involved!
You no longer need mage to build Hugo from source.
No idea what’s going on with that article (I don’t contribute to the Docs) maybe the others have reasons for not updating it (cc: @jmooring ).
Provided that you have Go installed and an up-to-date local clone of the Hugo master repository then from within that directory simply execute the following command in the console:
go build
Or if you need the Hugo extended version run:
go build -tags extended
With the above you will get the latest Hugo-DEV version from source.
And that’s it really.
P.S. Since GitHub introduced a simple button in their web GUI to fetch the latest from upstream I simply use it and then locally from within my Hugo fork I simply run git pull to fetch the latest.
This worked - thank you!
I did have GCC installed but incorrectly by the looks of things, and I guess Go wasn’t finding it.
So the install command succeeds and hugo version returns this:
Hugo Static Site Generator v0.56.3/extended windows/amd64 BuildDate: unknown
The version’s a long way behind yours but hopefully not unexpected (remember I’m following the steps here: https://gohugo.io/contribute/development/ so am in a fork of master (currently unchanged).)
No doubt I’ll have more questions - need to get the tests running and passing now - but will start a new thread for anything arising from that.