brutella / hkcam

Open-Source HomeKit Surveillance Camera

Home Page:https://hochgatterer.me/hkcam/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Fixed] Build fails with recent version of Golang: "go build: -i flag is deprecated"

ikester opened this issue · comments

I could not build the from master using the Makefile. I got the following error:

go build: -i flag is deprecated go build runtime/cgo: copying /home/pi/.cache/go-build/07/0743c60c14fabbaab2d08b008b52952f73aec4c781f754197f9384f27691d92c-d: open /usr/local/go/pkg/linux_arm/runtime/cgo.a: permission denied make: *** [Makefile:27: build] Error 1

Some searching suggested getting rid of the -i in the build command, so I removed it from the Makefile and was able to build the project.

Do you still build the project using an older version of Golang for any particular reason? I'm happy to submit a pull request with this simple change.

I've now switched to Task to build the project.

If you just want to run hkcam, you can do that with go run cmd/hkcam/main.go.
If you want to build for a Raspberry Pi, you can do that with GOOS=linux GOARCH=arm GOARM=6 go build cmd/hkcam/main.go.
You can also run task pack to create packages for all supported platform, and then just use the one for the Raspberry Pi ..._linux_arm.tar.gz.