Skip to content

error when building on arm64 MacBook #7

Closed

Description

@jwatte

Note that there exists a fix for building on M1:
google/cpu_features#211

Also, this module is broken. The cause of the breakage (upstream or not) doesn't really matter -- unless you're saying "I never plan on fixing this," keeping the issue open helps the community understand what's going on.

Finally, I predict this will become more of a pressing issue now that Apple has stopped selling x64 MacBook Pros entirely, AND this module is a dependency of the electron installer builders.

Activity

  1. mscdex commented on Dec 22, 2021

    @mscdex
    Owner

    I'm not keen on having to patch dependencies like this because I'm not familiar with the cpu_features codebase (let alone macs), so I'm not really qualified to say whether the changes in one PR or another is correct (there are multiple PRs now to add M1 support in cpu_features, all delayed for various reasons).

  2. jwatte commented on Dec 22, 2021

    @jwatte
    Author

    That's fair, but I propose the issue is kept open until the problem no longer exists.
    One way or another, the upstream will presumably pick one of the fixes ...

  3. lxe commented on Feb 1, 2022

    @lxe

    @mscdex looks like you've fixed all the build issues for M1 Macs, but I'm not seeing the new commits published to npm. Would you mind getting a new version out? Thanks!

  4. starzou commented on Feb 22, 2022

    @starzou

    @mscdex Hello, Are there new plans?

  5. mscdex commented on Feb 22, 2022

    @mscdex
    Owner

    AFAIK there is still no M1 support upstream. The only Apple-related fixes that I originally floated and were eventually made upstream (which I pulled in awhile back) were for macOS x86.

  6. technicalpickles commented on Mar 10, 2022

    @technicalpickles

    It took me a minute to realize the dependency is bundled in deps/cpu_features. I tried grabbing the tarball and replacing the directory, but it looks like it's more involved than that.

  7. mscdex commented on Mar 17, 2022

    @mscdex
    Owner

    I've landed cpu_features v0.7.0 in the master branch. Everyone feel free to give it a whirl and let me know how it works for you.

  8. mscdex commented on Mar 24, 2022

    @mscdex
    Owner

    I'm going to assume the aforementioned upgrade fixed things. If not, let me know.

  9. ckortekaas commented on Mar 25, 2022

    @ckortekaas

    @mscdex I'm afraid after upgrading to ssh 1.8.0 which brings in cpu-features 0.3 I started getting "dyld missing symbol called" in my jest integration tests and webpack compilation. This is on a Macbook Pro M1 Max with MacOS 12.3 and Node 16.14.2. I'm happy to run any debug commands locally that might help. For now, I've pinned ssh back to 1.7.0. Thanks for your hard work on these libraries 🙇‍♂️

  10. mscdex commented on Mar 25, 2022

    @mscdex
    Owner

    @ckortekaas If you're getting them from ssh2, then please create an issue in that repo.

  11. mscdex commented on Mar 25, 2022

    @mscdex
    Owner

    If anyone here is getting those symbol errors while running the cpu-features tests, can you provide a backtrace (via gdb or lldb or similar) to show what the missing symbol is? You may need to switch from Release to Debug in lib/index.js and node-gyp --debug rebuild in order to see symbols and proper backtraces.

  12. mscdex commented on Mar 25, 2022

    @mscdex
    Owner

    FWIW I can't reproduce those errors on Github's infrastructure and I don't have any mac hardware myself to test on.

  13. alexbosworth commented on Mar 25, 2022

    @alexbosworth

    I'm not sure if this helps but here is what I get in lldb

    dyld[11400]: missing symbol called
    Process 11400 stopped
    * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
        frame #0: 0x000000010490f4dc dyld`__abort_with_payload + 8
    dyld`__abort_with_payload:
    ->  0x10490f4dc <+8>:  b.lo   0x10490f4fc               ; <+40>
        0x10490f4e0 <+12>: pacibsp 
        0x10490f4e4 <+16>: stp    x29, x30, [sp, #-0x10]!
        0x10490f4e8 <+20>: mov    x29, sp
    Target 0: (node) stopped.
    
  14. mscdex commented on Mar 25, 2022

    @mscdex
    Owner

    @alexbosworth What does bt show?

  15. alexbosworth commented on Mar 25, 2022

    @alexbosworth
    (lldb) bt
    * thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
      * frame #0: 0x000000010490f4dc dyld`__abort_with_payload + 8
        frame #1: 0x00000001049164dc dyld`abort_with_payload_wrapper_internal + 104
        frame #2: 0x0000000104916510 dyld`abort_with_payload + 16
        frame #3: 0x00000001048ce8e4 dyld`dyld4::halt(char const*) + 328
        frame #4: 0x00000001048ecf7c dyld`dyld4::APIs::_dyld_missing_symbol_abort() + 44
        frame #5: 0x0000000104ad9278 cpufeatures.node`GetCPUInfo(info=0x000000016fdfe6a0) at binding.cc:117:31
        frame #6: 0x0000000104adb244 cpufeatures.node`Nan::imp::FunctionCallbackWrapper(info=0x000000016fdfe6f0) at nan_callbacks_12_inl.h:176:3
        frame #7: 0x0000000100270d78 node`v8::internal::FunctionCallbackArguments::Call(v8::internal::CallHandlerInfo) + 276
        frame #8: 0x0000000100270870 node`v8::internal::MaybeHandle<v8::internal::Object> v8::internal::(anonymous namespace)::HandleApiCallHelper<false>(v8::internal::Isolate*, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::Handle<v8::internal::FunctionTemplateInfo>, v8::internal::Handle<v8::internal::Object>, v8::internal::BuiltinArguments) + 468
        frame #9: 0x00000001002700fc node`v8::internal::Builtin_HandleApiCall(int, unsigned long*, v8::internal::Isolate*) + 228
        frame #10: 0x00000001009b0bcc node`Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_BuiltinExit + 108
        frame #11: 0x0000000100944718 node`Builtins_InterpreterEntryTrampoline + 248
        frame #12: 0x0000000100944718 node`Builtins_InterpreterEntryTrampoline + 248
        frame #13: 0x0000000100944718 node`Builtins_InterpreterEntryTrampoline + 248
        frame #14: 0x0000000100944718 node`Builtins_InterpreterEntryTrampoline + 248
        frame #15: 0x0000000100944718 node`Builtins_InterpreterEntryTrampoline + 248
        frame #16: 0x0000000100944718 node`Builtins_InterpreterEntryTrampoline + 248
        frame #17: 0x0000000100944718 node`Builtins_InterpreterEntryTrampoline + 248
        frame #18: 0x000000010094250c node`Builtins_JSEntryTrampoline + 172
        frame #19: 0x00000001009421a4 node`Builtins_JSEntry + 164
        frame #20: 0x0000000100313d64 node`v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) + 2388
        frame #21: 0x00000001003133f8 node`v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) + 200
        frame #22: 0x0000000100220888 node`v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) + 520
        frame #23: 0x0000000100083f5c node`node::ExecuteBootstrapper(node::Environment*, char const*, std::__1::vector<v8::Local<v8::String>, std::__1::allocator<v8::Local<v8::String> > >*, std::__1::vector<v8::Local<v8::Value>, std::__1::allocator<v8::Local<v8::Value> > >*) + 104
        frame #24: 0x0000000100084fc0 node`node::StartExecution(node::Environment*, char const*) + 312
        frame #25: 0x0000000100084e6c node`node::StartExecution(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) + 1044
        frame #26: 0x0000000100005a1c node`node::LoadEnvironment(node::Environment*, std::__1::function<v8::MaybeLocal<v8::Value> (node::StartExecutionCallbackInfo const&)>) + 136
        frame #27: 0x00000001000ee580 node`node::NodeMainInstance::Run(int*, node::Environment*) + 72
        frame #28: 0x00000001000ee27c node`node::NodeMainInstance::Run(node::EnvSerializeInfo const*) + 120
        frame #29: 0x0000000100087080 node`node::Start(int, char**) + 184
        frame #30: 0x00000001048c90f4 dyld`start + 520
    
  16. mscdex commented on Mar 25, 2022

    @mscdex
    Owner

    Looks like cpu_features' support for M1 macs isn't complete then. 🤷‍♂️

    So I guess if you want to see it fixed, continue to bug them about it/test for them over on their repo.

    I guess something like this PR will fix things as that should resolve the undefined symbol issue. Whether or not additional changes are needed for reading the M1's CPU features compared to the existing solutions for arm64-based systems (e.g. Linux), I don't know.

  17. alexbosworth commented on Mar 25, 2022

    @alexbosworth

    I guess something like this PR will fix things as that should resolve the undefined symbol issue. Whether or not additional changes are needed for reading the M1's CPU features compared to the existing solutions for arm64-based systems (e.g. Linux), I don't know.

    Cool, yeah sounds like the problem derives from lack of support there and it seems like a fix is in progress

  18. mscdex commented on Mar 30, 2022

    @mscdex
    Owner

    @FabianFrank Unfortunately the support is not complete with v0.7.0.

  19. alexbosworth commented on Apr 5, 2022

    @alexbosworth

    Seems like this issue went away for me when I updated to MacOS 12.3

  20. mscdex commented on Apr 5, 2022

    @mscdex
    Owner

    @alexbosworth The underlying problem still exists (M1 support doesn't actually exist in cpu_features), the only difference is that we now explicitly report the M1 as an unknown CPU without any feature flags instead of crashing at runtime.

  21. alexbosworth commented on Apr 5, 2022

    @alexbosworth

    Ah great thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions