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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: arm64 build requires rosetta to be installed in 3d printing #2460

Open
oizone opened this issue Feb 4, 2024 · 7 comments
Open

Bug: arm64 build requires rosetta to be installed in 3d printing #2460

oizone opened this issue Feb 4, 2024 · 7 comments

Comments

@oizone
Copy link

oizone commented Feb 4, 2024

馃悶 bug report

Affected Version(s)

The issue is caused by version 4.10.2

Is this a regression?

Not working with older versions either

To Reproduce

Steps to reproduce the behavior:

  1. Using macos arm64 without rosetta installed
  2. Go to '3d printing'
  3. Click on 'open stl'
  4. UI hangs at 75%

server.log error


2024-02-04T10:52:41.588Z - error uncaughtException: spawn Unknown system error -86
Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:415:11)
    at Object.spawn (node:child_process:707:9)
    at Slicer.slice (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:1014398)
    at Slicer.end (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:1015201)
    at /Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:852808
    at handleCheckModel (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:853114)
    at t.value [as channelMiddleware] (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:194915)
    at /Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:196160
    at Socket. (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:194347)
    at Socket.emit (node:events:394:28)
    at Socket.emitUntyped (/Applications/Snapmaker Luban.app/Contents/Resources/app/node_modules/socket.io/dist/typed-events.js:69:22)
    at /Applications/Snapmaker Luban.app/Contents/Resources/app/node_modules/socket.io/dist/socket.js:614:39
    at processTicksAndRejections (node:internal/process/task_queues:78:11)
2024-02-04T10:52:41.588Z - error app uncaught exception Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:415:11)
    at Object.spawn (node:child_process:707:9)
    at Slicer.slice (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:1014398)
    at Slicer.end (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:1015201)
    at /Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:852808
    at handleCheckModel (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:853114)
    at t.value [as channelMiddleware] (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:194915)
    at /Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:196160
    at Socket. (/Applications/Snapmaker Luban.app/Contents/Resources/app/src/server/index.js:2:194347)
    at Socket.emit (node:events:394:28)
    at Socket.emitUntyped (/Applications/Snapmaker Luban.app/Contents/Resources/app/node_modules/socket.io/dist/typed-events.js:69:22)
    at /Applications/Snapmaker Luban.app/Contents/Resources/app/node_modules/socket.io/dist/socket.js:614:39
    at processTicksAndRejections (node:internal/process/task_queues:78:11) {
  errno: -86,
  code: 'Unknown system error -86',
  syscall: 'spawn'
}

Expected behavior
Was expecting the stl to be opened in the preview.

The doesn't happen if rosetta is installed, but the build should be arm64 right?

馃實 Your Environment

Platform:



- Operating System: macOS Sonoma 14.2.1
- Printer: Snapmaker A350

@neerdoc
Copy link

neerdoc commented Apr 9, 2024

I have the exact same issue. I have an M2 mac and just tried building the binary locally, and the same error occurs, so I don't think the problem is that the build is not ARM64 as I do not have Rosetta installed.

There seems to be problems with Ubuntu ARM64 builds as well: #2101

So I'm wondering if the issue is ARM64 support across the board?

I will try to dig a bit in this issue.

@neerdoc
Copy link

neerdoc commented Apr 10, 2024

@oizone You are correct in your report that the build is not arm64, at least not completely!

The root cause of the problem seems to be that the npm package @snapmaker/snapmaker-lunar contains pre-compiled binaries for only three platforms: Windows-x64, linux-x86_64 and MacOS-x86_64. Thus, when trying to execute the slicer, the spawn of the process fails since the installed binary has the wrong architecture. In my case, I'm missing a MacOS-arm64 binary.

I have not found the source of the snapmaker-lunar package anywhere so I cannot build it by myself.

Doing a file node_modules/@snapmaker/snapmaker-lunar/engine/MacOS/LunarSlicer clearly show the problem: node_modules/@snapmaker/snapmaker-lunar/engine/MacOS/LunarSlicer: Mach-O 64-bit executable x86_64 which causes the error: zsh: bad CPU type in executable: node_modules/@snapmaker/snapmaker-lunar/engine/MacOS/LunarSlicer

@parachvte Is the source code for the lunar slicer available somewhere so we can build it for arm64?

@neerdoc
Copy link

neerdoc commented Apr 11, 2024

@oizone Maybe you should change the title? The arm64 image is in fact not arm64 as it contains x86_64 binaries that are required for the software to function. "ARM64 build is broken" would perhaps be a more correct title?

@neerdoc
Copy link

neerdoc commented Apr 11, 2024

@parachvte @zjiefee
I would love to help out with compiling this for arm64 on MacOS.

The actual binary that throws the error first is the cmd: ../../node_modules/@snapmaker/snapmaker-lunar/engine/MacOS/LunarMP modelrepair -v -p -j since it has the wrong CPU architecture.

I can only assume that all three files needs to be compiled for arm64 as they are currently x86_64:

  • LunarMP
  • LunarSlicer
  • LunarTPP

@oizone
Copy link
Author

oizone commented Apr 11, 2024

@oizone Maybe you should change the title? The arm64 image is in fact not arm64 as it contains x86_64 binaries that are required for the software to function. "ARM64 build is broken" would perhaps be a more correct title?

Well, yeah, it's not a arm64 since it has x86_64 code in it, no. But I think the topic already says this, even though a bit indirect. But anyway, I don't think changing the title will fix this :)

@neerdoc
Copy link

neerdoc commented Apr 12, 2024

Is the npm package from here?
Snapmaker/LunarSlicer? I don't find it very clear if this is the case.

@hefler
Copy link

hefler commented May 2, 2024

Got the same problem! Had to downgrade to previous version.

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

No branches or pull requests

3 participants