Release 0.54.0 not building for me

Go install does not create executable.
Am I missing something?

mkdir $HOME/src
cd $HOME/src
git clone https://github.com/gohugoio/hugo.git
cd hugo
go install
root@fedvm src54]# cd hugo
[root@fedvm hugo]# ls
bench.sh      cache     config           Dockerfile  go.mod                   helpers   i18n        magefile.go  minifiers  pull-docs.sh  requirements.txt  tpl
benchSite.sh  commands  CONTRIBUTING.md  docs        goreleaser-extended.yml  htesting  langs       main.go      output     README.md     resources         transform
bepdock.sh    common    create           docshelper  goreleaser.yml           hugofs    LICENSE     media        parser     related       snap              watcher
bufferpool    compare   deps             examples    go.sum                   hugolib   livereload  metrics      publisher  releaser      source
[root@fedvm hugo]# go install
go: finding github.com/spf13/afero v1.2.1
go: downloading github.com/spf13/afero v1.2.1
[root@fedvm hugo]# go version
go version go1.11.1 linux/amd64
[root@fedvm hugo]# 

Hmm. I just built fine on Windows 10. But I use mage. Here’s my batch build script if it’s helpful.

Build script
@echo off

REM set HUGO_BUILD_TAGS=extended
set HUGO_BUILD_TAGS=

if exist "src\hugo" (
  echo ==================================================
  echo Hugo repo is already cloned, pulling latest
  echo ==================================================
) else (
  echo ==================================================
  echo Hugo repo not found, cloning it
  echo ==================================================
  git clone https://github.com/gohugoio/hugo.git src/hugo
  echo.
)

cd src\hugo
git pull
echo.

echo ==================================================
echo Building Hugo binary
echo ==================================================
go get github.com/magefile/mage
go mod download
mage -v hugo
echo.

echo ==================================================
echo Hugo binary version 
echo ==================================================
ren hugo.exe hugodev.exe
hugodev.exe version
echo.

echo ==================================================
echo Copying Hugo binary (hugo.exe) to C:\Hugo\bin
echo ==================================================
xcopy /y hugodev.exe C:\Hugo\bin\
echo.

cd ..\..

Thanks!

I am trying to follow the documentation explicitly to also check if it needs updating. :wink:

Also something to look at, the Contributing doc has mage steps https://github.com/gohugoio/hugo/blob/master/CONTRIBUTING.md#building-hugo-with-your-changes

Thanks,

One thing I noticed is that the go install command never output success or failure, just exited.

I looked for a go verbose switch but I don’t see one.

I haven’t tried the go install. Here’s the relevant bits of my script above, if you wanna try them:

go get github.com/magefile/mage
go mod download
mage -v hugo

Not sure what is happening here:

“Go Install” builds a new go directory in my home directory and builds a dev 55 version Hugo.

[ktst@fedvm hugo]$ pwd
/home/ktst/src54/hugo
[ktst@fedvm hugo]$ 
[ktst@fedvm hugo]$ git config --list
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/gohugoio/hugo.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
[ktst@fedvm hugo]$ 
[ktst@fedvm ~]$ mkdir src54
[ktst@fedvm ~]$ cd src54
[ktst@fedvm src54]$ git clone https://github.com/gohugoio/hugo.git
Cloning into 'hugo'...
remote: Enumerating objects: 37325, done.
remote: Total 37325 (delta 0), reused 0 (delta 0), pack-reused 37325
Receiving objects: 100% (37325/37325), 63.24 MiB | 4.61 MiB/s, done.
Resolving deltas: 100% (25778/25778), done.

[ktst@fedvm src54]$ ls
hugo
[ktst@fedvm src54]$ cd hugo
[ktst@fedvm hugo]$ ls
bench.sh      cache     config           Dockerfile  go.mod                   helpers   i18n        magefile.go  minifiers  pull-docs.sh  requirements.txt  tpl
benchSite.sh  commands  CONTRIBUTING.md  docs        goreleaser-extended.yml  htesting  langs       main.go      output     README.md     resources         transform
bepdock.sh    common    create           docshelper  goreleaser.yml           hugofs    LICENSE     media        parser     related       snap              watcher
bufferpool    compare   deps             examples    go.sum                   hugolib   livereload  metrics      publisher  releaser      source
[ktst@fedvm hugo]$ go version
go version go1.11.5 linux/amd64
[ktst@fedvm hugo]$ go install
[ktst@fedvm hugo]$ ls -lrt
total 224
### Many Files .....
drwxrwxr-x  5 ktst ktst  4096 Feb  1 14:34 transform
[ktst@fedvm hugo]$ cd ~
[ktst@fedvm ~]$ pwd
/home/ktst
[ktst@fedvm ~]$ 
drwxrwxr-x   3 ktst ktst 4096 Feb  1 14:33 src54
drwxrwxr-x   4 ktst ktst 4096 Feb  1 14:35 go
[ktst@fedvm ~]$ cd go
[ktst@fedvm go]$ ls -ltr
total 8
drwxrwxr-x 3 ktst ktst 4096 Feb  1 14:34 pkg
drwxrwxr-x 2 ktst ktst 4096 Feb  1 14:35 bin
[ktst@fedvm go]$ cd bin
[ktst@fedvm bin]$ ls -ltr
-rwxrwxr-x 1 ktst ktst 28523544 Feb  1 14:35 hugo
[ktst@fedvm bin]$ ./hugo version
Hugo Static Site Generator v0.55.0-DEV linux/amd64 BuildDate: unknown

Which is correct if you build from the latest source.

Sorry to bother you…

I was under the impression from the readme.md that I would be loading the latest GA release. I guess I have to specify a branch.

I will do some more GIT reading.

Regards,

Go works off of Git. If you git clone a repo, by default you get the latest commit from the default branch. Typically this is master, which is the development branch. If you wanted to build a specific release, you’d need to download the source tarball from the releases page or git checkout a Git tag corresponding to the release.

For example, to checkout the source code for Hugo v0.53, you would do git checkout v0.53. Then, you could go build or go install that source and it would be Hugo at that version.

Thanks,

That is what I ended up doing. I have no problem with tar files.

I found myself in GIT command line hell trying to git clone the desired 0.54.0 branch with the corresponding hours of wasted time… :slight_smile:

Go install always ended up building the DEV.0.55.0 version… For me…

Certainly not a Hugo problem…

git clone -b release-0.54.0 --single-branch https://github.com/gohugoio/hugo.git

You need to use the tag v0.54.0. The branch is not the version, so to speak.

I can add that the main reason we now addedd a 0 to the main version is to get it to behave correctly with Go Modules. From Go 1.12 you can do:

GO111MODULE=on  go get github.com/gohugoio/hugo

And you will get and install the latest tagged version.