HaxeFoundation / haxe

Haxe - The Cross-Platform Toolkit
https://haxe.org
6.14k stars 656 forks source link

Haxe install does not work on OS X El Capitan #4483

Closed jgranick closed 9 years ago

jgranick commented 9 years ago

After upgrading from OS X 10.10 to 10.11, I found that haxe and neko no longer worked from the terminal.

It appears that "/usr/lib" and "/usr/bin" are no longer writeable, even with sudo permissions.

We need to install to "/usr/local/lib" and "/usr/local/bin" instead

After manually installing there, things are working fine here :smile:

jgranick commented 9 years ago

For anyone who is using the beta, here is a script that will help install Haxe and Neko in the meantime :smile:

#!/bin/sh

echo “Downloading Neko”

curl -O http://nekovm.org/media/neko-2.0.0-osx64.tar.gz

echo “Installing Neko”

sudo mkdir -p /usr/local/lib/neko
sudo tar xvzf neko-2.0.0-osx64.tar.gz -C /usr/local/lib/neko --strip-components=1

sudo ln -s /usr/local/lib/neko/libneko.dylib /usr/local/lib/libneko.dylib
sudo ln -s /usr/local/lib/neko/neko /usr/local/bin/neko
sudo ln -s /usr/local/lib/neko/nekoc /usr/local/bin/nekoc
sudo ln -s /usr/local/lib/neko/nekotools /usr/local/bin/nekotools

echo “Downloading Haxe”

curl -O http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-osx.tar.gz

echo “Installing Haxe”

sudo mkdir -p /usr/local/lib/haxe
sudo tar xvzf haxe-3.2.0-osx.tar.gz -C /usr/lib/haxe --strip-components=1

sudo ln -s /usr/local/lib/haxe/haxe /usr/local/bin/haxe
sudo ln -s /usr/local/lib/haxe/haxelib /usr/local/bin/haxelib

sudo mkdir -p /usr/local/lib/haxe/lib
sudo chmod -R 777 /usr/local/lib/haxe/lib
haxelib setup /usr/local/haxe/lib
andyli commented 9 years ago

Yeah, we need to update the installer. Btw, would you check if brew install haxe works?

ruby0x1 commented 9 years ago

I tested brew install, but also worth noting is that previously installed /usr/lib/haxe becomes inaccessible, so removing or changing things from the location after upgrade isn't possible with the Rootless feature they have added.

(It is possible to boot around this but that discussion should be sought after elsewhere).

steverichey commented 9 years ago

In my case, /usr/lib/haxe was completely wiped (this is in Beta 7) and I had to reinstall Haxe entirely. However, brew install haxe --with-neko successfully installed Haxe. On a somewhat unrelated note however, I'm unable to run haxelib run lime setup due to errors with zlib, if anyone experiences similar.

steverichey commented 9 years ago

I made some changes to @jgranick's script:

#!/bin/sh

set -e

echo “Downloading Neko”

curl -O http://nekovm.org/media/neko-2.0.0-osx64.tar.gz

echo “Installing Neko”

mkdir -p /usr/local/lib/neko
tar xvzf neko-2.0.0-osx64.tar.gz -C /usr/local/lib/neko --strip-components=1

ln -s /usr/local/lib/neko/libneko.dylib /usr/local/lib/libneko.dylib
ln -s /usr/local/lib/neko/neko /usr/local/bin/neko
ln -s /usr/local/lib/neko/nekoc /usr/local/bin/nekoc
ln -s /usr/local/lib/neko/nekotools /usr/local/bin/nekotools

echo “Downloading Haxe”

curl -O http://haxe.org/website-content/downloads/3.2.0/downloads/haxe-3.2.0-osx.tar.gz

echo “Installing Haxe”

mkdir -p /usr/local/lib/haxe
tar xvzf haxe-3.2.0-osx.tar.gz -C /usr/local/lib/haxe --strip-components=1

ln -s /usr/local/lib/haxe/haxe /usr/local/bin/haxe
ln -s /usr/local/lib/haxe/haxelib /usr/local/bin/haxelib

mkdir -p /usr/local/lib/haxe/lib
chmod -R 777 /usr/local/lib/haxe/lib
haxelib setup /usr/local/haxe/lib

This fixes a typo (a missing /local), removes the use of sudo so that the installation doesn't require sudo to run, and exits the script on error.

waneck commented 9 years ago

Update: I've taken a look at this today, and it seems that Apple has obliterated PackageMaker from existence - which is VERY annoying since the package was built on top of it, and I had spent a lot of time to be able to take an existing .pkg file built with it and re-package it with updated binaries (on a Linux machine) I'll see if I can hack my way around this destination change with no need to rebuild the pkg file; otherwise we'll need to make the package again from scratch (and look if it's still compatible with updating binaries). Thanks, Apple.

ruby0x1 commented 9 years ago

There's plenty of packaging tools though, like http://s.sudre.free.fr/Software/Packages/about.html ?

waneck commented 9 years ago

can you try this installer http://hxbuilds.s3-website-us-east-1.amazonaws.com/builds/haxe/mac-installer/haxe_2015-09-01_development_e677d97.tar.gz ?

waneck commented 9 years ago

@underscorediscovery it's not about the lack of options - it's just annoying - specially since we do the repackaging on linux, which was a delicate process and depended on the [undocumented and reverse-engineered] .pkg structure that PackageMaker generated. It's just an all too common pattern of how Apple deals with its developers.

ruby0x1 commented 9 years ago

It sounds a bit like a mixture. I don't condone pulling the rug on things at all if it can be helped, but it doesn't sound like that case here. "delicate processes" tend to break when things change - it's in the definition.

I'll try the installer when I get a chance, my laptop is the one where I can mess with the settings atm - will have a run at it later if I can.

waneck commented 9 years ago

Any news? I'd like to solve this before 3.2.1

On Mon, Aug 31, 2015, 10:02 PM Sven Bergström notifications@github.com wrote:

It sounds a bit like a mixture. I don't condone pulling the rug on things at all if it can be helped, but it doesn't sound like that case here. "delicate processes" tend to break when things change - it's in the definition.

I'll try the installer when I get a chance, my laptop is the one where I can mess with the settings atm - will have a run at it later if I can.

— Reply to this email directly or view it on GitHub https://github.com/HaxeFoundation/haxe/issues/4483#issuecomment-136550169 .

ruby0x1 commented 9 years ago

Will have the laptop up a few hours from now, and will be around for more rigorous testing as needed.

ruby0x1 commented 9 years ago

Well, it at least appears to install the std lib and the haxelib binary, but the haxe binary I can't locate. The installer put the /usr/local/lib/haxe/ and /usr/local/lib/neko/ folders, and /usr/local/bin/haxelib exists but /usr/local/bin/haxe is not found.

(Checked also in /usr/bin, /usr/local/bin, find / | grep haxe etc)

waneck commented 9 years ago

Thanks! I'll see if I can fix that tonight

firmread commented 9 years ago

I'm just started learning Haxe but it seems like I'll have to wait for this issue to be closed before I can start playing around. finger crossed :))

andyli commented 9 years ago

@firmread don't wait, use homebrew (brew install haxe) ;)

firmread commented 9 years ago

@andyli Thanks for suggestion! I tried that and got haxe down with brew but not neko either brew install neko or brew install haxe --with-neko give me this:

Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Installing dependencies for haxe: neko
==> Installing haxe dependency: neko
==> Cloning https://github.com/HaxeFoundation/neko.git
Updating /Library/Caches/Homebrew/neko--git
==> Checking out revision 22c49a89b56b9f106d7162710102e9475227e882
==> make os=osx LIB_PREFIX=/usr/local INSTALL_FLAGS=
clang -Wall -O3 -fPIC -fomit-frame-pointer -I vm -D_GNU_SOURCE -I libs/common -L/usr/local/lib -L/usr/local/lib -I/usr/local/include  -o vm/threads.o -c vm/threads.c
clang  -o bin/libneko.dylib vm/alloc.o vm/builtins.o vm/callback.o vm/interp.o vm/load.o vm/objtable.o vm/others.o vm/hash.o vm/module.o vm/jit_x86.o vm/threads.o -ldl /usr/local/lib/libgc.a -lm -dynamiclib -single_module -install_name @executable_path/libneko.dylib
ld: library not found for -lgcc_s.10.4
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [bin/libneko.dylib] Error 1

READ THIS: https://git.io/brew-troubleshooting
andyli commented 9 years ago

@firmread Try brew install neko --HEAD. We really need a new neko release (https://github.com/HaxeFoundation/neko/issues/69) :P

firmread commented 9 years ago

@andyli I'm still stuck with the same error. It seems 10.11 GM Candidate is already coming out today though. Will try it again after updating. Thank you!

andyli commented 9 years ago

@firmread As suggested in https://github.com/Homebrew/homebrew/issues/40653, may be you can try installing Xcode 7 and configure Xcode 7 as the default toolchain.

firmread commented 9 years ago

@andyli Wow, finally got it! thanks you so much!

just as an easy reference for my future self. to set Xcode 7 as default toolchain, simply runs:

$ sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer

then to check current default toolchain:

$ xcode-select -p

in which it should return /Applications/Xcode-beta.app/Contents/Developer

ruby0x1 commented 9 years ago

@waneck I didn't want to make a separate issue for this but the license file in haxe installer has some things that should be addressed.

Is there anything else to test on El Capitan? I've installed the GM and can test more. The latest installer (as of now) still doesn't create the haxe command (correctly?) even on Yosemite (from nightly downloads). Actually, it seems the haxe binary is just not in the installer, it's not in the folder.

waneck commented 9 years ago

I'll try to fix those issues today

On Sat, Sep 12, 2015, 3:59 PM Sven Bergström notifications@github.com wrote:

@waneck https://github.com/waneck I didn't want to make a separate issue for this but the license file in haxe installer has some things that should be addressed.

  • Spelling of license (The MIT Licence)
  • Dates (Copyright (C)2005-2012 Haxe Foundation) (2012)

Is there anything else to test on El Capitan? I've installed the GM and can test more.

— Reply to this email directly or view it on GitHub https://github.com/HaxeFoundation/haxe/issues/4483#issuecomment-139815208 .

waneck commented 9 years ago

@underscorediscovery, can you try latest installer - http://hxbuilds.s3-website-us-east-1.amazonaws.com/builds/haxe/mac-installer/ ?

ruby0x1 commented 9 years ago

Some strange results make me wonder,

These two files download a 3.2.0 installer, just named "3.2.0", they also don't mention snapshot information or git revisions. Upon installing the haxe -version shows 3.2.0 as well. This means at least, it installed correctly (it seems).

After removing everything, I tried haxe_2015-09-13_development_2a75f0b.tar.gz which downloads as haxe-3.2.0-dev-2a75f0b.pkg - it was minutes difference on the site.

This one installed and the haxe -version command was 3.3.0 (git build development @ 2a75f0b) It seems the installer worked ok for the haxe command line and everything too.

ThIs is what the development one shows: screen shot 2015-09-13 at 12 25 29 pm

This is what the "latest" one shows. screen shot 2015-09-13 at 12 28 32 pm

So either the "latest" installer is just confused about it's identity it's got a problem, but the latest development snapshot installer seemed to work as expected.

waneck commented 9 years ago

this must have something to do with how I forcefully kickstarted the builds - it ended up building master instead of development. Anyway, good to know it's working! We can make a release now then

ruby0x1 commented 9 years ago

If you have a "final" build to test before it's up let me know, but sounds good.

What about users that install when they have it installed in /usr/lib/haxe from before? At minimum there should be information regarding the difference in the installer.

leshido commented 8 years ago

Any chance we can have the latest working installer on the Haxe website? The one there still doesn't work on El Capitan, which by now is officially released. Also, just noticed that when running haxelib setup it prompts to default install on the now non-writable location /usr/lib/haxelib.

jangdan commented 8 years ago

yeah, please update the Haxe website installer. a lot of confusion here, especially for those who are like me who got their disks formatted (for a FRESH start) while updating and are in the process of reinstalling all these tools.

I couldn't even install the LAME mp3 library because of this new restriction. Apple is so weird sometimes.

deers commented 8 years ago

i follow @jgranick step and it's work, i can compile to flash target, but when i compile to android target i got this error:

Called from ? line 1 Called from CommandLineTools.hx line 1385 Called from CommandLineTools.hx line 25 Called from a C function Called from CommandLineTools.hx line 126 Called from CommandLineTools.hx line 604 Called from lime/project/PlatformTarget.hx line 70 Called from lime/tools/platforms/AndroidPlatform.hx line 262 Called from lime/tools/helpers/PathHelper.hx line 422 Called from /usr/lib/haxe/std/neko/_std/sys/FileSystem.hx line 81 Uncaught exception - std@sys_create_dir

seem there's some script still calling to /usr/lib/haxe

any idea how to fix this?