New ARM Builds for the compiler

I’m happy to announce that we are now building and publishing ARM64 releases for the compiler, for both Linux and macOS.
These builds are courtesy of the M2 machine running in our office at id3as.

How to get these builds:

  • they are not yet included in a stable release, but they are already available for the pre-release versions.
  • the npm installer picks them up as well, so e.g. you can do
    npm install purescript@0.15.9-6
    
    …and you’ll get the right binary if you’re running on a mac M1/M2 or a Linux ARM64 machine.
  • if you are using easy-purescript-nix to fetch your compilers, my fork has a patch to fetch the latest prerelease (you can also get spago-next from there).
    I will upstream this patch once we have a stable release out with the new builds.

Happy building! :slightly_smiling_face:

13 Likes

Hi, since yesterday, I cannot install PureScript at all. It always gives the same error. Here the output on WSL:

~ $ npm i -g purescript
npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm ERR! code 1
npm ERR! path /home/mwu/.nvm/versions/node/v18.16.0/lib/node_modules/purescript
npm ERR! command failed
npm ERR! command sh -c install-purescript --purs-ver=0.15.8
npm ERR! [ FAILURE ] Check if a prebuilt 0.15.8 binary is provided for linux-x86_64
npm ERR! No prebuilt PureScript binary is provided for linux.
npm ERR!
npm ERR! See troubleshooting suggestions in https://github.com/purescript/purescript/blob/master/INSTALL.md
npm ERR!
npm ERR! ↓ Fallback: building from source
npm ERR! /home/mwu/.nvm/versions/node/v18.16.0/lib/node_modules/purescript/node_modules/zen-observable/lib/Observable.js:65
npm ERR!       throw e;
npm ERR!       ^
npm ERR!
npm ERR! TypeError: Cannot read properties of undefined (reading 'has')
..

Specifying the version explicitly does not help. Is there a known problem at the moment?

Kind regards,
Markus

1 Like

same problem on Windows

@f-f hi - I think there is a problem with the new getBuildProfile function in npm-installer

@mwu-mcs for now I think it should work to fix the version of npm-installer to 0.3.3 - so something like this in your package.json:

  "devDependencies": {
    "purescript": "^0.15.8",
    "purescript-installer": "0.3.3"
  }

this should do the job although you’ll have to move to a local instead of global package

@f-f I think I might have found the problem:

you are now (well almost certainly when people have current node versions) using os.mchine() instead of process.arch to find the architecture

But this gives x86_64 instead of x64 so the mappings are off


I’m not sure how you’d want me to fix this but I can open an issue or give you a PR if you like


I opened an PR - it’s only 3 lines and probably not up to your standard - feel free to reject it but maybe it helps you.

1 Like

Thanks @CarstenKoenig, your fix has been merged and released. Installer should work for folks now, with any version on non-ARM machines and the latest 0.15.9 prereleases on ARM machines.

M1 User here. yesterday I tried npm i purescript -g and It occurs error like below

npm WARN deprecated @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
npm ERR! code 1
npm ERR! path /Users/gukbeomlee/.nvm/versions/node/v20.0.0/lib/node_modules/purescript
npm ERR! command failed
npm ERR! command sh -c install-purescript --purs-ver=0.15.8
npm ERR! [ FAILURE ] Check if a prebuilt 0.15.8 binary is provided for darwin-arm64 (317ms)
npm ERR! Error: 404 Not Found
npm ERR!     at /Users/gukbeomlee/.nvm/versions/node/v20.0.0/lib/node_modules/purescript/node_modules/purescript-installer/dl-tar/index.js:193:13
npm ERR!     at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
npm ERR!     at async /Users/gukbeomlee/.nvm/versions/node/v20.0.0/lib/node_modules/purescript/node_modules/purescript-installer/dl-tar/index.js:190:17
npm ERR! 
npm ERR! See troubleshooting suggestions in https://github.com/purescript/purescript/blob/master/INSTALL.md

and Thanks to this article, I solved the problem. npm install purescript@0.15.9-6 works well.

but I think many people will struggle with install like me

Hello and welcome,

yes you are right here.
This was discussed briefly in the issue.

This should be fixed once 0.15.9 is released (which will be the first version with official support for ARM).

Feel free to chime in there.