Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails on sitemap.go #93

Closed
gytisrepecka opened this issue Apr 15, 2019 · 11 comments · Fixed by #95
Closed

Build fails on sitemap.go #93

gytisrepecka opened this issue Apr 15, 2019 · 11 comments · Fixed by #95
Labels

Comments

@gytisrepecka
Copy link
Contributor

Describe the bug

Building WriteFreely from source (version 0.9) fails with following error:

go-bindata -pkg writefreely -ignore=\\.gitignore schema.sql sqlite.sql
go get -tags='sqlite' -d -v ./...
go get: warning: modules disabled by GO111MODULE=auto in GOPATH/src;
	ignoring go.mod;
	see 'go help modules'
github.com/mattn/go-sqlite3 (download)
cd cmd/writefreely; go build -ldflags="-X 'github.com/writeas/writefreely.softwareVer=`git describe --tags | cut -c 2-`'" -v -tags='sqlite'
github.com/mattn/go-sqlite3
github.com/writeas/writefreely/parse
github.com/writeas/writefreely
# github.com/writeas/writefreely
../../sitemap.go:23:22: not enough arguments in call to stm.NewSitemap
	have ()
	want (int)
../../sitemap.go:78:4: index must be non-negative integer constant
../../sitemap.go:78:4: cannot use p.Post.Slug.NullString.String (type string) as type []interface {} in array or slice literal
../../sitemap.go:79:4: index must be non-negative integer constant
../../sitemap.go:79:18: cannot use "weekly" (type string) as type []interface {} in array or slice literal
../../sitemap.go:80:4: index must be non-negative integer constant
../../sitemap.go:80:4: cannot use true (type bool) as type []interface {} in array or slice literal
../../sitemap.go:81:4: index must be non-negative integer constant
../../sitemap.go:81:4: cannot use p.Post.Updated (type time.Time) as type []interface {} in array or slice literal
../../sitemap.go:86:33: index must be non-negative integer constant
../../sitemap.go:86:33: too many errors
make: *** [build] Error 2

Steps to reproduce (if necessary)

Steps to reproduce the behavior:

  1. go get -d -u github.com/writeas/writefreely/cmd/writefreely
  2. cd go/src/src/github.com/writeas/writefreely
  3. make build

Building on CentOS 7.

Expected behavior

Build succeeded and writefreely available in go/bin.

Version or last commit:
0.9

@yalh76
Copy link
Contributor

yalh76 commented Apr 15, 2019

Same error trying to build for linux/arm64 and linux/amd64

@thebaer
Copy link
Member

thebaer commented Apr 15, 2019

Can you try building with Go Modules enabled and see if you still get this error?

@yalh76
Copy link
Contributor

yalh76 commented Apr 15, 2019

Can you try building with Go Modules enabled and see if you still get this error?

Do you have the command line for that ?
I'm like having no knowledge of Golang....

@diazepan
Copy link

It's by adding GO111MODULE=on

What I do is the following:

  1. go get -d github.com/writeas/writefreely/cmd/writefreely
  2. GO111MODULE=on go build github.com/writeas/writefreely/cmd/writefreely
  3. wait until it has errors
  4. Making the assets and the ui
  5. Running again GO111MODULE=on go build github.com/writeas/writefreely/cmd/writefreely

And that worked for me

@gytisrepecka
Copy link
Contributor Author

In my case prepending all make commands with GO111MODULE=on helped, e.g.:

GO111MODULE=on make build

Thanks, I will make a detailed build documentation as there are few little details (at least on CentOS) :)

@thebaer
Copy link
Member

thebaer commented Apr 16, 2019

@gytisrepecka That would be great! I'll create a "developer" section in the documentation repo that you can add to.

@yalh76
Copy link
Contributor

yalh76 commented Apr 16, 2019

In my case prepending all make commands with GO111MODULE=on helped, e.g.:

GO111MODULE=on make build

Thanks, I will make a detailed build documentation as there are few little details (at least on CentOS) :)

For me too, build for ARM64 working

@gytisrepecka
Copy link
Contributor Author

I have drafted full building walkthrough with mentioned fix, would be nice if someone would also try out on CentOS/RHEL :)

@kaiyou
Copy link
Collaborator

kaiyou commented Apr 19, 2019

Just pushed the related fixes for the Docker build, thank you for the walkthrough :)

@joicemjoseph
Copy link

joicemjoseph commented Jul 13, 2019

GO111MODULE=on make build

After trying this, I am getting
Makefile:60: recipe for target 'deps' failed error.

on ubuntu 18.04

@gytisrepecka
Copy link
Contributor Author

Did you use go get to update sources and dependencies from Git?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

6 participants