Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for darwin/arm64 (Apple Silicon) #9408

Closed
shoenig opened this issue Nov 20, 2020 · 2 comments · Fixed by #9640 or #16672
Closed

Support for darwin/arm64 (Apple Silicon) #9408

shoenig opened this issue Nov 20, 2020 · 2 comments · Fixed by #9640 or #16672

Comments

@shoenig
Copy link
Member

shoenig commented Nov 20, 2020

Please note support for these M1 chips won't be officially supported by Go until the release of 1.16 (golang/go#38485)

With a little cross compiling, fixed build targets, and codesign kludging we can start to play around with building Go programs.

At the moment, nomad compiles but launching results in some runtime crash

runtime: out of memory: cannot allocate 1729382219220254720-byte block (0 in use)
fatal error: out of memory

runtime stack:
runtime.throw(0x1016921a2, 0xd)
	runtime/panic.go:1112 +0x54 fp=0x16fc63730 sp=0x16fc63700 pc=0x1001d2f84
runtime.(*mcache).allocLarge(0x1039b0108, 0x17fffff7394083e0, 0x1, 0xfffffe730b194fe5)
	runtime/mcache.go:226 +0x2f0 fp=0x16fc637a0 sp=0x16fc63730 pc=0x1001b53c0
runtime.mallocgc(0x17fffff7394083e0, 0x101201800, 0x16fc63801, 0x1001f2ec4)
	runtime/malloc.go:1078 +0x82c fp=0x16fc63850 sp=0x16fc637a0 pc=0x1001ab94c
runtime.newobject(0x101201800, 0x10315a320)
	runtime/malloc.go:1177 +0x38 fp=0x16fc63880 sp=0x16fc63850 pc=0x1001abae8
runtime.malg(0x100008000, 0x1022359c8)
	runtime/proc.go:3870 +0x2c fp=0x16fc638d0 sp=0x16fc63880 pc=0x1001dde5c
runtime.mpreinit(0x10315a320)
	runtime/os_darwin.go:284 +0x28 fp=0x16fc638f0 sp=0x16fc638d0 pc=0x1001d0098
runtime.mcommoninit(0x10315a320, 0xffffffffffffffff)
	runtime/proc.go:708 +0xdc fp=0x16fc63940 sp=0x16fc638f0 pc=0x1001d69ec
runtime.schedinit()
	runtime/proc.go:601 +0x98 fp=0x16fc639a0 sp=0x16fc63940 pc=0x1001d6548
runtime.rt0_go(0x0, 0x0, 0x0, 0x0, 0x10019c000, 0x2, 0x16fc63b68, 0x16fc63b6e, 0x0, 0x16fc63b76, ...)
	runtime/asm_arm64.s:82 +0xd0 fp=0x16fc639d0 sp=0x16fc639a0 pc=0x100207f30

Looks like it's a cgo thing golang/go#42738

@shoenig
Copy link
Member Author

shoenig commented Nov 20, 2020

If I disable cgo, we can at least get past the runtime error.

% nomad version 
Nomad v1.0.0-dev (25c59e637c7d864b493cb54cc40c3d221c94a526+CHANGES)

However we then fail at CPU fingerprinting

    2020-11-20T07:57:15.173-0600 [WARN]  client.fingerprint_mgr.cpu: failed initializing stats collector: error="1 error occurred:
	* Unable to obtain CPU information: no such file or directory

"
    2020-11-20T07:57:15.173-0600 [DEBUG] client.fingerprint_mgr.cpu: detected core count: cores=8

shoenig added a commit that referenced this issue Dec 15, 2020
Add a build target for Apple Silicon (m1) macs.

Note that Go must have been built with c4f497da6f for
Nomad to work on darwin/arm64 (i.e. wait for go1.16).

Closes #9408
backspace pushed a commit that referenced this issue Jan 22, 2021
Add a build target for Apple Silicon (m1) macs.

Note that Go must have been built with c4f497da6f for
Nomad to work on darwin/arm64 (i.e. wait for go1.16).

Closes #9408
@tgross
Copy link
Member

tgross commented Dec 13, 2021

Going to reopen this issue so that we have a place to gather information about what would be needed to get these builds back. Cross-compiling seems to be running into gopsutil issues: #11046. It might not be a bad idea to investigate getting M1 builders on CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants