slnm
July 8, 2021, 4:21pm
1
I’m trying to build ratel.
$ go get -u github.com/dgraph-io/ratel
go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc/server/server.go:99:13: undefined: Asset
go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc/server/server.go:107:13: undefined: Asset
go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc/server/server.go:112:15: undefined: AssetInfo
go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc/server/server.go:154:14: undefined: Asset
go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc/server/server.go:160:16: undefined: AssetInfo
$ cd go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc
I have go installed locally and my GOPATH is this:
%echo $GOPATH
/home/me/dgraph/go:/home/me/dgraph/go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc
When I run scripts/build.prod.sh I get an error:
fatal: Needed a single revision
Here’s some relevant info:
$ echo $dir
/home/me/dgraph/go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc
$ echo $rootDir
/home/me/dgraph/go/pkg/mod/github.com/dgraph-io/ratel@v0.0.0-20210528215746-9debcc4717cc
$ echo $version
21.03.0
$ git rev-parse --short HEAD
fatal: Needed a single revision
I did a git init in the directory I cd’d to.
How can I fix this?
MichelDiz
(Michel Diz)
July 8, 2021, 7:44pm
2
it runs just fine on my end. Try to remove the src in the go path and clone it directly instead of “go get”.
slnm
July 8, 2021, 8:10pm
3
Thanks for your help.
I cloned the repo and tried building the code. It errors out with the following.
70050 verbose stack Error: node-sass@5.0.0 postinstall: node scripts/build.js
70050 verbose stack Exit status 1
70050 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/
node_modules/npm-lifecycle/index.js:332:16)
70050 verbose stack at emitTwo (events.js:126:13)
70050 verbose stack at EventEmitter.emit (events.js:214:7)
70050 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/
node_modules/npm-lifecycle/lib/spawn.js:55:14)
70050 verbose stack at emitTwo (events.js:126:13)
70050 verbose stack at ChildProcess.emit (events.js:214:7)
70050 verbose stack at maybeClose (internal/child_process.js:915:16)
70050 verbose stack at Process.ChildProcess.handle.onexit (internal/child
process.js:209:5)
MichelDiz
(Michel Diz)
July 8, 2021, 8:13pm
4
Hard to say, are you using master? have you updated the nodejs? npm? and so on? What are the steps you are doing?
slnm
July 8, 2021, 8:23pm
5
I cloned ratel this way:
git clone GitHub - dgraph-io/ratel: Dgraph Data Visualizer and Cluster Manager
And then, from the ratel directory I ran the build script:
. scripts/build.prod.sh
I’ll have to talk to the systems folks re version of things. I’ll assume this is a nodejs or npm problem and proceed accordingly.
joaquin
(Joaquin Menchaca)
July 8, 2021, 8:58pm
6
I wouldn’t recommend using the build.prod.sh
as this is heavily dependent on an exact build environment. I had encapsulated the build environment so that only docker is needed:
make build
After you can copy the binary out of the image. Of course, this builds a linux-only binary. If you need a darwin version, the Dockerfile provides hints how to walk through the process, which is essentially two parts, the react assets and the small go service that embeds those assets.
slnm
July 9, 2021, 7:57pm
7
Ok, I’ll get the image out of Docker. Thanks!