brutella / hkcam

Open-Source HomeKit Surveillance Camera
https://hochgatterer.me/hkcam/
Apache License 2.0
920 stars 141 forks source link

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

Closed ikester closed 2 years ago

ikester commented 2 years ago

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.

brutella commented 2 years ago

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.