hashicorp / hashicorp/packer

packer cannot build and run on m5 cpu with cgo

Open
#13,604 0 comments 5 reactions 0 assignees View on GitHub
bug
Dominant language
Go
Stars
15.8k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

#### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) 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.

https://github.com/shoenig/go-m1cpu/issues/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](https://gist.github.com/) of the log or use the [Github detailed
format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d)
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](https://gist.github.com/) of the log or
use the [Github detailed format](https://gist.github.com/ericclemmons/b146fe5da72ca1f706b2ef72a20ac39d) instead of posting it directly in the issue.

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

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.