Skip to content

Compilation on M1 mac #39

@jonaustin

Description

@jonaustin

Just to note this solution somewhere in case someone else runs into it:

I was unable to compile the golang tool pistol on an M1 mac because homebrew installs files to /opt/homebrew/include† and /usr/local/include simply doesn't exist.
† or whatever your brew --prefix is set to.

❯ go install github.com/doronbehar/pistol/cmd/pistol@latest
# github.com/doronbehar/magicmime
Users/jonaustin/opt/_go/pkg/mod/github.com/doronbehar/magicmime@v0.1.1-0.20211127135329-3de4ff29dc49/magicmime.go:28:11: fatal error: 'magic.h' file not found
 #include <magic.h>
          ^~~~~~~~~
1 error generated.

Was able to fix this by simply symlinking things:

sudo ln -s /opt/homebrew/include /usr/local

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions