Skip to content

Manual build fails on macOS with modern Go (invalid reference to syscall.recvmsg) #55

@s41r4j

Description

@s41r4j

Steps to reproduce (from README):
- git clone https://github.com/pwnesia/dnstake
- cd dnstake/cmd/dnstake
- go build .


Build fails with: link: golang.org/x/net/internal/socket: invalid reference to syscall.recvmsg
(seen on macOS/darwin arm64 with newer Go toolchains).

In restricted/sandboxed environments it can also fail earlier with “operation not permitted”
trying to write Go caches under the default GOCACHE/GOMODCACHE paths.


  • Root cause:
    • The dependency tree pulls very old golang.org/x/net / golang.org/x/sys versions (2019-era)
      that don’t link correctly with current Go on macOS.
    • Some environments don’t allow writing to the default Go cache/module cache directories.
  • Proposed fix:
    • Update/pin deps in go.mod (and regenerate go.sum) to newer compatible versions, e.g.
      golang.org/x/net v0.35.0 and golang.org/x/sys v0.30.0, and bump the module go version to at
      least 1.18.
    • Update README manual build steps to build from repo root: go build ./cmd/dnstake.
    • Document a cache workaround for sandboxed builds, e.g. GOCACHE="$PWD/.cache/go-build"
      GOMODCACHE="$PWD/.cache/gomod" go build ./cmd/dnstake, and ignore .cache/ in .gitignore.
  • Expected result:
    • go build succeeds on macOS with current Go versions following the README steps.

(Can work for diff linux as well!)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions