Skip to content

Conversation

lpar
Copy link
Contributor

@lpar lpar commented Dec 25, 2022

This removes the use of go-bindata for the SQL schema files, in favor of standard go:embed.


  • I have signed the CLA

@thebaer thebaer added this to the 1.0 milestone Dec 25, 2022
@thebaer
Copy link
Member

thebaer commented Dec 25, 2022

Looks great. Thank you for tackling this! Will merge now.

@thebaer thebaer merged commit 93d5fd1 into writefreely:develop Dec 25, 2022
@lpar lpar deleted the remove-go-bindata branch December 26, 2022 16:20
@gytisrepecka
Copy link
Contributor

I have a feeling this change causes building on develop branch to fail as of now:

$ make build
go get -tags='sqlite' -d -v ./...
cd cmd/writefreely; go build -ldflags="-s -w -X 'github.com/writefreely/writefreely.softwareVer=`git describe | cut -c 2-`'" -v -tags='netgo sqlite'
github.com/writefreely/writefreely
# github.com/writefreely/writefreely
../../bindata.go:34:6: schemaSql redeclared in this block
        ../../app.go:928:5: other declaration of schemaSql
../../bindata.go:52:6: sqliteSql redeclared in this block
        ../../app.go:931:5: other declaration of sqliteSql
../../bindata.go:121:16: cannot use schemaSql (variable of type string) as type func() (*asset, error) in map literal
../../bindata.go:122:16: cannot use sqliteSql (variable of type string) as type func() (*asset, error) in map literal
../../bindata.go:165:25: cannot use schemaSql (variable of type string) as type func() (*asset, error) in struct literal
../../bindata.go:166:25: cannot use sqliteSql (variable of type string) as type func() (*asset, error) in struct literal
make: *** [build] Error 2

@lpar
Copy link
Contributor Author

lpar commented Aug 21, 2023

@gytisrepecka You shouldn't have a bindata.go file any more, it was a file generated by the old go-bindata system. You can just delete it, it's in .gitignore and isn't part of the project.

@gytisrepecka
Copy link
Contributor

Thanks, removing bindata.go solves the issue and WriteFreely build from develop now succeeds 👍

thebaer added a commit to writefreely/documentation that referenced this pull request Feb 2, 2024
@prologic
Copy link

I just cloned the this repo and tried to run make build and this is still using go-bindata hmmm

prologic@JamessMacStudio
Sun Feb 11 17:01:27
~/Contributions/writefreely
 (develop) 0
$ make build
go: downloading github.com/jteeuwen/go-bindata v3.0.7+incompatible
go: added github.com/jteeuwen/go-bindata v3.0.7+incompatible
go-bindata -pkg writefreely -ignore=\\.gitignore -tags="!wflib" schema.sql sqlite.sql
/bin/sh: go-bindata: command not found
make: *** [assets] Error 127

prologic@JamessMacStudio
Sun Feb 11 17:01:34
~/Contributions/writefreely
 (develop) 2
$ git id
b7f732b

@prologic
Copy link

Looks like this PR (all intentions good) was incomplete?

prologic@JamessMacStudio
Sun Feb 11 17:05:11
~/Contributions/writefreely
 (develop) 130
$ sift go-bindata
Dockerfile:6:RUN go get -u github.com/go-bindata/go-bindata/...
Makefile:137:	go-bindata -pkg writefreely -ignore=\\.gitignore -tags="!wflib" schema.sql sqlite.sql
Makefile:140:	go-bindata -pkg writefreely -ignore=\\.gitignore -tags="!wflib" schema.sql
Makefile:143:	go-bindata -pkg writefreely -ignore=\\.gitignore -debug -tags="!wflib" schema.sql sqlite.sql
Makefile:146:	go-bindata -pkg writefreely -ignore=\\.gitignore -o bindata-lib.go -tags="wflib" schema.sql
Makefile:149:	@hash go-bindata > /dev/null 2>&1; if [ $$? -ne 0 ]; then \
Makefile:150:		$(GOGET) -u github.com/jteeuwen/go-bindata/go-bindata; \
Makefile:156:$(TMPBIN)/go-bindata: deps $(TMPBIN)
Makefile:157:	$(GOBUILD) -o $(TMPBIN)/go-bindata github.com/jteeuwen/go-bindata/go-bindata
Makefile:162:ci-assets : $(TMPBIN)/go-bindata
Makefile:163:	$(TMPBIN)/go-bindata -pkg writefreely -ignore=\\.gitignore -tags="!wflib" schema.sql sqlite.sql
go.sum:71:github.com/jteeuwen/go-bindata v3.0.7+incompatible h1:91Uy4d9SYVr1kyTJ15wJsog+esAZZl7JmEfTkwmhJts=
go.sum:72:github.com/jteeuwen/go-bindata v3.0.7+incompatible/go.mod h1:JVvhzYOiGBnFSYRyV00iY8q7/0PThjIYav1p9h5dmKs=
bindata-lib.go:65:// directory embedded in the file by go-bindata.
bindata-lib.go:66:// For example if you run go-bindata on data/... and data contains the
go.mod:18:	github.com/jteeuwen/go-bindata v3.0.7+incompatible // indirect
Error: 2 files skipped due to very long lines (>= 262144 bytes). See options --blocksize, --err-show-line-length and --err-skip-line-length.

@prologic
Copy link

Ahh ooops, looks like I forgot I had a clone from years ago 🤦‍♂️

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

Successfully merging this pull request may close these issues.

4 participants