apache / incubator-answer

A Q&A platform software for teams at any scales. Whether it's a community forum, help center, or knowledge management platform, you can always count on Apache Answer.
https://answer.apache.org
Apache License 2.0
12.68k stars 962 forks source link

Make build fails #734

Closed surapuramakhil closed 4 months ago

surapuramakhil commented 8 months ago

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

surapuramakhil commented 8 months ago

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

LinkinStars commented 8 months ago

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/mockgen@v1.6.0

zahash commented 7 months ago

i had this same issue.

you also need to add /home//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.