@jmooring I bumped the global module to v1.0.1 to fix a small configuration error. Go is still defined to 1.22. Netlify is still complaining about the hash, but when I run the build locally, I have no errors. I’m puzzled, maybe you shed some light into this. How did you get that error locally? I usually delete both go.mod and go.sum to let them be generated with I import the modules.
My local output:
$ hugo --gc --minify -s ./docs --logLevel debug
Start building sites …
hugo v0.126.1+extended darwin/arm64 BuildDate=2024-05-15T10:42:34Z VendorInfo=brew
INFO build: step process substep collect files 1 files_total 1 pages_total 1 resources_total 0 duration 2.169459ms
INFO build: step process duration 2.346584ms
INFO build: step assemble duration 1.402416ms
INFO static: syncing static files to / duration 6.080416ms
WARN deprecated: .Site.GoogleAnalytics was deprecated in Hugo v0.120.0 and will be removed in a future release. Use .Site.Config.Services.GoogleAnalytics.ID instead.
INFO deprecated: .Site.IsMultiLingual was deprecated in Hugo v0.124.0 and will be removed in a future release. Use hugo.IsMultilingual instead.
INFO build: step render substep pages site en outputFormat html duration 22.682292ms
INFO build: step render substep pages site en outputFormat rss duration 836.25µs
INFO build: step render pages 8 content 3 duration 25.873583ms
INFO build: step postProcess duration 4.208µs
INFO build: duration 29.898708ms
| EN
-------------------+-----
Pages | 8
Paginator pages | 0
Non-page files | 0
Static files | 13
Processed images | 0
Aliases | 0
Cleaned | 0
Total in 112 ms
Related to the Go version, as soon as I change go 1.22.3 to go 1.22 in go.mod and run hugo --gc --minify -s ./docs at repo root directory, it changes it back to go 1.22.3. I have no idea where is the issue. Is Hugo caching something in the background?
@jmooring I have a Mac, so I installed Hugo and golang with homebrew.
$ go env GOTOOLCHAIN
auto
Well, please do a git pull on main repo branch, it should refresh the global module to v1.0.1. I’m not getting any of the hash errors you mention, on my Mac.
Should I remove the go.sum file from repo, since this is getting generated anyways by build? I think what matters is the go.mod to have the correct modules in pace.
I just deleted the entire repo locally and did a git clone, no errors related to module hash. When I change the Go version from 1.22.3 to 1.22, same bad luck happens, Hugo reverts it back to 1.22.3.
I’m not sure what to tell you. I removed the local copy of your test repo, and then cloned it again:
git clone --recurse-submodules https://github.com/axivo/hugo-module
cd hugo-module/
hugo --gc --minify -s docs
Result…
verifying github.com/axivo/website/global@v1.0.1/go.mod: checksum mismatch
downloaded: h1:QQk2/AIFUOQIGv0YQivBp1qa9aQeAjHHljwIJCGc1fk=
go.sum: h1:8vfk0VdWE74VvYV5zdHYpQBp9lO6S/BFuTDVbSfPSVk=
SECURITY ERROR
This download does NOT match an earlier download recorded in go.sum.
The bits may have been replaced on the origin server, or an attacker may
have intercepted the download attempt.
@jmooring I did the same thing, except the --recurse-submodules flag, since I don’t have any submodules in that repo. Well, ignoring the go.sum file fixes at least the deployment.
I’m still puzzled by the Go version forced change. Do you have a Mac by any chance?
I see, then I still have a problem. When I deploy the website locally, the file is getting generated with the wrong hash. Mac is still Linux, what is the export GOTOOLCHAIN you have set in your .bash_profile? I just want to replicate your exact environment.