Ratel build: fatal: Needed a single revision

I’m trying to build ratel.

$ go get -u github.com/dgraph-io/ratel

github.com/dgraph-io/ratel/server

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?

it runs just fine on my end. Try to remove the src in the go path and clone it directly instead of “go get”.

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)

Hard to say, are you using master? have you updated the nodejs? npm? and so on? What are the steps you are doing?

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.

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.

Ok, I’ll get the image out of Docker. Thanks!