incubator-answer icon indicating copy to clipboard operation
incubator-answer copied to clipboard

Make build fails

Open surapuramakhil opened this issue 2 years ago • 3 comments

Describe the bug

A clear and concise description of what the bug is.

cloned repo - followed documentation installed all pre-requisite

when I run make build command below is the output

akhil@Akhil-S:~/startup/incubator-answer$ make build
wire: github.com/apache/incubator-answer/cmd: wrote /home/akhil/startup/incubator-answer/cmd/wire_gen.go
internal/service/siteinfo_common/siteinfo_service.go:33: running "mockgen": exec: "mockgen": executable file not found in $PATH
make: *** [Makefile:28: generate] Error 1

To Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots or video to help explain your problem.

Platform

Not UI / app related issue. build related issue. using WSL - ubuntu

  • Device: [e.g. Desktop, Mobile]
  • OS: [e.g. macOS]
  • Browser and version: [e.g. Chrome, Safari]
  • Version: [e.g. v1.2.0]

surapuramakhil avatar Jan 21 '24 21:01 surapuramakhil

Is this supposed to run only from docker container?

another reason being in docker build file we use /data/ from source container in0order to make this run.

refer to docker build file COPY --from=golang-builder /data /data

surapuramakhil avatar Jan 21 '24 22:01 surapuramakhil

It looks like it's caused by mockgen not having to be installed successfully. Try using the make generate command to install it. Alternatively, you can use go install github.com/golang/mock/[email protected]

LinkinStars avatar Jan 22 '24 02:01 LinkinStars

i had this same issue.

you also need to add /home/<your_username>/go/bin to your path this is where go keeps all the installed binaries you can find the mockgen binary there

i think you only added the path where go was installed.

zahash avatar Feb 23 '24 11:02 zahash