Skip to content

packer cannot build and run on m5 cpu with cgo #13604

@Talor-A

Description

@Talor-A

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

Overview of the Issue

packer transitively depends on go-m1cpu v0.1.5 in go.mod. this version does not support new apple m5 CPUs, and so compiling with cgo enabled causes null pointer errors.

shoenig/go-m1cpu#25

this can be fixed by upgrading to go-m1cpu v0.2.1+ which adds support for m5 processors.

A paragraph or two about the issue you're experiencing.

Reproduction Steps

Steps to reproduce this issue

  1. Build packer v1.15.0 from source on an Apple M5 with CGO_ENABLED=1
  2. execute the built packer binary
  3. Observe SIGSEGV in github.com/shoenig/go-m1cpu.init.0()
  4. Repeat with CGO_ENABLED=0
  5. no segfault

Packer version

1.15.0

Simplified Packer Template

If the file is longer than a few dozen lines, please include the URL to the
gist of the log or use the Github detailed
format

instead of posting it directly in the issue.

Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.

Apple M5 Pro chip, MacOS Tahoe 26.4 (25E246)

Log Fragments and crash.log files

Include appropriate log fragments. If the log is longer than a few dozen lines,
please include the URL to the gist of the log or
use the Github detailed format instead of posting it directly in the issue.

Set the env var PACKER_LOG=1 for maximum log detail.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions