Skip to content

Error when building the arduino-cli on macOS #938

@rhaidiz

Description

@rhaidiz

Bug Report

Current behavior

While compiling the arduino-cli I got the following error message:

go build runtime/cgo: copying /Users/rhaidiz/Library/Caches/go-build/70/70103aa484e2078f8a107341c9592bc9d3a6e6c27e2aaf432b56c2a5e6bc0051-d: open /usr/local/go/pkg/darwin_amd64/runtime/cgo.a: permission denied

It looks like something is wrong with the go installation when it comes to runtime/cgo and go is trying to replace a file by picking it from the cache. In fact, I get this explanation from go:

go list -f '{{.Stale}}' runtime/cgo
true
go list -f '{{.StaleReason}}' runtime/cgo
not installed but available in build cache

Which is odd because the file in /usr/local/go/pkg/darwin_amd64/runtime/cgo.a exists.

I tried to reinstall the go package (by downloading the pkg from the go website), hoping that maybe something got corrupted the first time around, but I stil got the same error message.

Environment

  • CLI version (output of arduino-cli version): arduino-cli Version: 0.0.0-git Commit: f1877efe
  • OS and platform: macOS 10.14.6
  • Go version: go version go1.15.1 darwin/amd64

Workaround

I still don't know why this is happening, however, after some digging, it looks like that the -i flag in the go build is not needed anymore to improve compilation speed since version 1.10. (https://golang.org/doc/go1.10#build)

I thus removed the -i flag from Taskfile.yml and after running task build I could successfully compile the arduino-cli.

Metadata

Metadata

Assignees

Labels

os: macosSpecific to macOS operating system

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions