sirupsen / logrus

Structured, pluggable logging for Go.
MIT License
24.8k stars 2.27k forks source link

[BUG] macOS build failing #1320

Closed bafko closed 2 years ago

bafko commented 2 years ago

Hi, After the recent update to Go 1.18, apps using logrus are unable to start due to golang.org/x/sys dependency in version v0.0.0-20191026070338-33540a1f603. This happens on macOS (both GOOS=darwin GOARCH=amd64 and GOOS=darwin GOARCH=arm64 tested) with enabled CGO:

go: downloading github.com/sirupsen/logrus v1.8.1
go: downloading golang.org/x/sys v0.0.0-20191026070338-33540a1f6037
# golang.org/x/sys/unix
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/syscall_darwin.1_13.go:25:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.1_13.go:27:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.1_13.go:40:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.go:28:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.go:43:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.go:59:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.go:75:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.go:90:3: //go:linkname must refer to declared function or variable
Error: ../../../go/pkg/mod/golang.org/x/sys@v0.0.0-20191026070338-33540a1f6037/unix/zsyscall_darwin_amd64.go:105:3: //go:linkname must refer to declared function or variable

It looks like that simple update to the latest version v0.0.0-20220317061510-51cd9980dadf solves the issue.

cryshado commented 2 years ago

Same problem. Go 1.18, mac os (m1)

bafko commented 2 years ago

Hi @cryshado, you can manually update golang.org/x/sys in your go.mod (it is an indirect dependency) as a temporary workaround.

cryshado commented 2 years ago

@bafko Thank you! It really helped :)

bafko commented 2 years ago

@dgsb

github-actions[bot] commented 2 years ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 2 years ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

golangrustnode commented 1 year ago

go get -u golang.org/x/sys update the sys package version. Then it works