protostar icon indicating copy to clipboard operation
protostar copied to clipboard

Protostar seems to be incompatible with new M2 chip

Open Th0rgal opened this issue 2 years ago • 4 comments

Hello there. I just installed protostar on a new M2 macbook air. When trying to run protostar I got this message:

zsh: bad CPU type in executable: protostar

Protostar version

Name Version
Protostar 3.0.0
Cairo-lang not sure
Git 2.36.0

Current Behavior

zsh: bad CPU type in executable: protostar

Expected Behavior

It should start protostar

Steps to Reproduce

  1. Install protostar on a M2 mac computer
  2. profits

Th0rgal avatar Aug 12 '22 09:08 Th0rgal

We may look on it in the future(we have no m2 machine to test it though). For now i suggest building it by yourself based on https://github.com/software-mansion/protostar#development

MaksymilianDemitraszek avatar Aug 12 '22 09:08 MaksymilianDemitraszek

We may look on it in the future(we have no m2 machine to test it though). For now i suggest building it by yourself based on https://github.com/software-mansion/protostar#development

Thank you, I'm available if you need me to try things. I tried to build it but couldn't get the poe command. Where does it come from?

Th0rgal avatar Aug 12 '22 20:08 Th0rgal

When building it by myself and calling it:

  • init works
  • build works
  • test doesn't work

When performing the tests directly from source code in a newly created protostar project via python ~/workspace/protostar/binary_entrypoint.py test, I got this error: https://gist.github.com/Th0rgal/03c6902c65fe5afbbe2010792145d2ec

Th0rgal avatar Aug 14 '22 20:08 Th0rgal

When building it by myself and calling it:

  • init works
  • build works
  • test doesn't work

When performing the tests directly from source code in a newly created protostar project via python ~/workspace/protostar/binary_entrypoint.py test, I got this error: https://gist.github.com/Th0rgal/03c6902c65fe5afbbe2010792145d2ec

I've been able to fix the tests issue by replacing multiprocessing from standardlib by multiprocess, a fork which uses the dill serializer instead of pickle (it's the only difference). You can find more info about it here: https://pypi.org/project/multiprocess/

Testing by calling binary_entrypoint was fixed, but when I tried to build protostar via poe build, the generated dist folder didn't contain multiprocess and I kept an issue with "multiprocessing" so I probably didn't do it correctly, I would really appreciate if you could show me how to correctly build it, or even replace multiprocessing by multiprocess in the final version @MaksymilianDemitraszek .

Th0rgal avatar Aug 14 '22 21:08 Th0rgal

Maks is not available this week. poe build should've work. Maybe some tweaking needs to be done in the protostar.spec? Did you replace all multiprocessing imports?

kasperski95 avatar Aug 16 '22 08:08 kasperski95

Maks is not available this week. poe build should've work. Maybe some tweaking needs to be done in the protostar.spec? Did you replace all multiprocessing imports?

Alright. Yep I replaced all multiprocessing imports in the folder. I am not sure what I should tweak in protostar.spec.

Th0rgal avatar Aug 16 '22 09:08 Th0rgal

My hypothesis: the dist folder is outdated because e.g. the build failed, but that information was lost in logs

(TBH, I can't debug this problem without access to M2.)

kasperski95 avatar Aug 16 '22 09:08 kasperski95

My hypothesis: the dist folder is outdated because e.g. the build failed, but that information was lost in logs

(TBH, I can't debug this problem without access to M2.)

If you want to try things on M2 we can have a call and I could share you my terminal by ssh.

Th0rgal avatar Aug 16 '22 09:08 Th0rgal

Thanks, the problem with the dist folder is not obvious. It can take some time, so I'd rather work on it locally. I've just requested M2, so I'll take a look at this issue soon.

kasperski95 avatar Aug 16 '22 10:08 kasperski95

poe build works on M2: protostar--0-3-3-mac-arm--prerelease.zip

I've managed to reproduce the issue with zsh: bad CPU type in executable: protostar.

kasperski95 avatar Aug 22 '22 15:08 kasperski95

That works perfectly, thank you so much sir.

Th0rgal avatar Aug 23 '22 14:08 Th0rgal

To fix zsh: bad CPU type in executable: protostar install Rosetta: softwareupdate --install-rosetta

kasperski95 avatar Sep 16 '22 12:09 kasperski95