HaxeFoundation / npm-haxe

Install Haxe using Node Package Manager aka npm
MIT License
46 stars 18 forks source link

Segmentation Fault with haxelib on MacOSX #34

Open chipbell4 opened 4 years ago

chipbell4 commented 4 years ago

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:

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

damoebius commented 4 years ago

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

chipbell4 commented 4 years ago

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
damoebius commented 4 years ago

does it work from your package.json like that ?

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

chipbell4 commented 4 years ago

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:

> haxe@5.2.1 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.

sakarit-zz commented 4 years ago

Did you find a solution?

chipbell4 commented 4 years ago

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.