npm-haxe icon indicating copy to clipboard operation
npm-haxe copied to clipboard

Segmentation Fault with haxelib on MacOSX

Open chipbell4 opened this issue 4 years ago • 6 comments

Hello, I'm trying to install this package on my Mac and it's currently failing. Here's my package.json:

{
  "dependencies": {
    "haxe": "^5.0.0"
  },
  "haxeDependencies": {
    "haxe": "3.4.7",
    "haxelib": "3.3.0",
    "neko": "2.2.0"
  }
}

npm install finishes with no errors, but when I run npx haxelib it fails:

$ npx haxelib
Called from C:\Users\nadako\Code\haxe\std/neko/_std/Date.hx line 98
Uncaught exception - Segmentation fault

Some info about my setup:

  • Node: 10.7.0
  • NPM: 6.4.1
  • OS: 10.14.4

Let me know if I can help in any way! Thanks!

chipbell4 avatar Apr 13 '20 15:04 chipbell4

Sorry, i don't no much about npx. Why do you need it ?

damoebius avatar Apr 13 '20 17:04 damoebius

Ah, npx ships with npm as a shortcut for running bin files from other modules. npx haxelib is the same as:

$ ./node_modules/.bin/haxelib

chipbell4 avatar Apr 13 '20 18:04 chipbell4

does it work from your package.json like that ?

"scripts":{ "postinstall": "haxelib --always install build.hxml", "build": "haxe build.hxml" },

damoebius avatar Apr 15 '20 16:04 damoebius

Updating my package.json to this:

{
  "dependencies": {
    "haxe": "^5.0.0"
  },
  "haxeDependencies": {
    "haxe": "3.4.7",
    "haxelib": "3.3.0",
    "neko": "2.2.0"
  },
  "scripts":{
    "postinstall": "haxelib --always install build.hxml"
  }
}

And creating a dummy build.hxml:

--js main-javascript.js
--main Main

And running npm install gives me the following log:

> [email protected] install /Users/cbell/git/haxe/node_modules/haxe
> node install.js

clean folder
Getting Haxe 3.4.7 for darwin
https://haxe.org/website-content/downloads/3.4.7/downloads/haxe-3.4.7-osx.tar.gz
using cached version
Getting Haxelib 3.3.0
https://github.com/HaxeFoundation/haxelib/archive/3.3.0.tar.gz
using cached version
Getting NekoVM 2.2.0
https://github.com/HaxeFoundation/neko/releases/download/v2-2-0/neko-2.2.0-osx64.tar.gz
using cached version
Installing Haxelib Dependencies

> undefined postinstall /Users/cbell/git/haxe
> haxelib --always install build.hxml

Called from C:\Users\nadako\Code\haxe\std/neko/_std/Date.hx line 98
Uncaught exception - Segmentation fault

Looks like it's still failing. I haven't looked at that particular line in Date.hx yet, so I'll go take a look in a bit.

chipbell4 avatar Apr 20 '20 14:04 chipbell4

Did you find a solution?

sakarit-zz avatar Jun 25 '20 06:06 sakarit-zz

I unfortunately, did not. It's been a while, but IIRC I resorted to use a docker container with a global haxe install to run the build. Not ideal, but it got me unstuck at the moment.

chipbell4 avatar Jun 25 '20 16:06 chipbell4