uber / cadence

Cadence is a distributed, scalable, durable, and highly available orchestration engine to execute asynchronous long-running business logic in a scalable and resilient way.
https://cadenceworkflow.io
MIT License
8k stars 777 forks source link

Building the CLI locally from scratch may require more steps that aren't documented #3538

Open JacobCrofts opened 3 years ago

JacobCrofts commented 3 years ago

Describe the bug

When I run make bins, I get the following dependency issue. I don't know how to debug it because I haven't worked with Go before. I think it's worth documenting how to fix this, as I'm sure there are other devs out there who want to use the CLI, prefer not using the docker image for whatever reason, and have not yet embraced The Way of the Gopher.

make: thriftrw: No such file or directory

I would appreciate some help figuring out why this is happening. Once we do, I'll update the CLI README for the benefit of anyone else who has this problem.

EDIT

I tried go get -u go.uber.org/thriftrw as a shot in the dark, but it didn't seem to change anything.

To Reproduce Is the issue reproducible?

Steps to reproduce the behavior:

Here is exactly what I did, having never installed Go before:

➜  brew install go
# (output omitted)

# my coworker told me he needed to do this
➜  go get -u golang.org/x/lint/golint
# (output omitted)

➜  make bins
GO111MODULE=off go get -u github.com/myitcv/gobin
GOOS= GOARCH= gobin -mod=readonly go.uber.org/thriftrw
Installed go.uber.org/thriftrw@v1.20.2 to /Users/jcroft/go/bin/thriftrw
GOOS= GOARCH= gobin -mod=readonly go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc
Installed go.uber.org/yarpc/encoding/thrift/thriftrw-plugin-yarpc@v1.42.0 to /Users/jcroft/go/bin/thriftrw-plugin-yarpc
git submodule update --init --recursive
Submodule 'idls' (https://github.com/uber/cadence-idl.git) registered for path 'idls'
Cloning into '/Users/jcroft/code/cadence/idls'...
Submodule path 'idls': checked out '87b3154c204df27e6055a5a1cf840973b627877f'
thriftrw --plugin=yarpc --pkg-prefix=github.com/uber/cadence/.gen/go/ --out=.gen/go idls/thrift/cadence.thrift
make: thriftrw: No such file or directory
make: *** [.gen/go/cadence/cadence.go] Error 1

Expected behavior

I would expect this to build an executable file that I can use to run the Cadence CLI.

Screenshots n/a

Additional context n/a

longquanzheng commented 3 years ago

Is it because of old version of golang? what version are you using?

spmistry commented 3 years ago

This did the trick for me Download all dependencies: go mod tidy or go mod download Download thriftrw explicitly: go get -u go.uber.org/thriftrw Then add the go binary path to bash path: export PATH=$PATH:/Users/me/go/bin (This is where the thriftrw executable will be found on a mac)

Then run make bins credits: @longquanzheng

longquanzheng commented 3 years ago

@JacobCrofts I added some more documentation https://github.com/uber/cadence/pull/3832 Can you try it again. And thanks @spmistry for helping out.

JacobCrofts commented 3 years ago

@longquanzheng @spmistry thank you both for your help! I followed the doc improvements in #3832 and this resolved my issue. Previously, my $GOPATH was empty so I'm guessing that was the problem.