-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add native builds for ARM-based Macs #820
Conversation
@@ -81,4 +81,4 @@ fs.read = function () { | |||
}; | |||
|
|||
const argv = ['node', wasm_exec, esbuild_wasm].concat(process.argv.slice(2)); | |||
wrapper(require, require.main, Object.assign(Object.create(process), { argv }), { instantiate }); | |||
wrapper(require, require.main, Object.assign(Object.create(process), { argv }), Object.assign(Object.create(WebAssembly), { instantiate })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of Golang 1.16.0, the wasm_exec.js run
function now has this check:
if (!(instance instanceof WebAssembly.Instance)) {
throw new Error("Go.run: WebAssembly.Instance expected");
}
This seemed like the simplest solution as opposed to patching the generated code like in
Line 61 in add2790
wasm_exec_js = wasm_exec_js.replace(toReplace, ` |
Thanks so much for putting this together. However, it's missing the most important part: has anyone with a M1 processor tried this build command on Go 1.16.0 and checked that esbuild works? I don't want to ship a broken build if no one has tested it, but I don't have a M1 myself. A good check could be to build one of the benchmarks (e.g. I'm also curious to hear what the build times are like for native vs. Rosetta emulated. For example, what the build times are like for |
That's awesome. Thanks for checking. |
Resolves #550