Closed mikomize closed 10 years ago
It seems you're using ST build (normally Ctrl+B / F7). You need to make sure you're in an .hx file. On some installations, some of the bundle's shortcuts are overriden by ST, so you may need to copy them from this file : https://github.com/clemos/haxe-sublime-bundle/blob/master/Support/Default.sublime-keymap to your user key bindings preference file (Preferences > Key Bindings - User)
Hi,
I'm having the same issue with ST3, OSX Mavericks & homebrew.
CTRL+Shift+B Brings up the build selection as expected, but CTRL+Enter gives the following output...
[Errno 2] No such file or directory: 'haxelib'
[cmd: ['haxelib', 'run', 'openfl', 'test', 'project.xml', 'neko', '-64', '-debug']]
[dir: /Users/username/Documents/haxe/DisplayingABitmap]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
[Finished]
The path above doesn't reflect what I have in my ~/.profile path, nor in /etc/paths...
I managed to get it working by making symlinks pointing to haxe/haxelib and neko in the /usr/bin dir...
I should probably also mention that I tried the shortcuts mentioned above by Clemos, but they didn't make any noticable difference to me.
Solution that worked for me:
uninstall homebrew haxe.
install haxe manually from repo.
also, for long time autocomplete didnt work for me, it took me long time to solve it since there wasnt any useful error shown in console.
my build.hxml looked like that: -js Server.js -main Server -lib minject nodejs -D minject nodejs
and thats valid build.hxml file for haxe, but for some reasons i had to change it to: -js Server.js -main Server -lib minject -D minject -lib nodejs -D nodejs to make sublime plugin autocomplete works.
I didn't know it was possible to add several libs or defines after -lib
or -D
...
I think this is really an edge case, I'll look into escaping / splitting these arguments properly if I have some time...
Meanwhile, and I think more generally, you'd better have one argument per flag.
The problem is that OSX GUI applications does not get the env PATH unless you open the app from the command line. They use a special built in PATH set from launchd.
And since mavericks they also removed /usr/local/bin
from that built in path so that's why the homebrew haxe binary cannot be found. But /usr/bin
is still there which is why I think the installer works.
This little workaround updates the GUI env PATH with the one you might have set in your shell but I need to figure out a way for it to be run automatically on boot, now after a reboot you have to run it again:
launchctl setenv PATH $PATH
killall Dock && killall SystemUIServer && killall Finder
You should be able to set the path to the haxe
executable through your ST settings, see :
https://github.com/clemos/haxe-sublime-bundle#settings
(haxe_path
, you'll probably need to restart ST after that)
I haven't really tested that much, so don't hesitate to open other issues in case it doesn't work
@clemos That setting only fixes the haxe
binary. Not haxelib
which @danielhudson had problems with above. Maybe it could be a haxe directory instead of pointing to the binary?
Right. I'll add another setting, then (to avoid breaking other people's settings...)
I've just set up a new laptop and added "haxe_path": "/usr/local/bin/"
& "haxe_library_path": "/usr/local/bin/"
added into my Settings - User in ST3... Still getting the same output as above.
@slaskis thanks for GUI info, I wasn't aware that that the GUI didn't get the PATH...
I made some symlinks again...
haxe_path
should be the full path to the executable, so probably /usr/local/bin/haxe
and haxe_library_path
should most probably end with std
...
@danielhudson no problem, I was stumped about this recently myself...
"haxe_path": "/usr/local/Cellar/haxe/3.1.3/bin/haxe",
"haxe_library_path": "/usr/local/Cellar/haxe/3.1.3/lib/haxe/std"
FYI, still not working when i hit CTRL + Enter, same error... Not that fussed since it's easy to just make symlinks in /usr/bin anyway...
Yeah I still haven't added the haxelib_path
config variable :S
I think symlinks are better, though, because if haxelib
is run by the haxe
executable, I don't think I'll be able to override its path...
I've added an haxelib_path
variable, let me know how it goes ;)
In ST3, it all works great so far - with symlinks removed... Many thanks!!!!
Closing this issue.
I don't think I'll fix the "second" one from @mikomize (related to several lib / flags per single -D
or -lib
)
but feel free to create yet another issue for that, if you believe it's critical :p
Sublime native build is still not working on OSX because of homebrew and $PATH stuff, and I don't want to fix it through messing with os settings. So I hacked the package itself:
~/Library/Application Support/Sublime Text 3/Installed Packages
~/Library/Application Support/Sublime Text 3/Packages
~/Library/Application Support/Sublime Text 3/Packages/Haxe/Support/Hxml.sublime-build
haxe
with /usr/local/bin/haxe
Because I can. Worked like a charm.
i have got haxe installed via homebrew and ive set settings in sublime:
{ "haxe_path": "/usr/local/opt/haxe/bin/haxe", "haxe_library_path": "/usr/lib/haxe/lib/" }
and while trying to build project im getting error:
[Errno 2] No such file or directory [cmd: [u'haxe', u'build.hxml']] [dir: /Users/miko/projects/haxenode] [path: /usr/bin:/bin:/usr/sbin:/sbin] [Finished]
typing "/usr/local/opt/haxe/bin/haxe build.hxml" in console works fine. What am i doing wrong?