COMMUNITY

How to implement new Haxe target?


#21

Hi all,

Trying to set up my Haxe build environment, I’m running into some problems (not helped by the fact that I don’t necessarily know what I’m doing in every step)…

Before I share what I’ve done, as well as what’s failing:
I am using Windows 10, I would prefer using this if possible.
Alternatively, I could install any Linux flavour in a VirtualBox instance, if that works better.

So, here goes…

Steps according to https://github.com/HaxeFoundation/haxe/blob/development/extra/BUILDING.md:

=======

No problems there.

=======

No problems here.

========

  • Installing dependencies: Windows (Cygwin): Run the Cygwin setup-x86_64.exe against the Cygwin installation directory

I run this, it comes up with:

  • Choose A Download Source; the option selected by default is “Install from Local Directory”. Is this correct? I don’t know what it means…

Okay, I leave it as-is, click Next.

  • Root Directory: C:\OCaml64; probably correct, as this is where OCaml is actually installed. Having said that: I don’t know how OCaml and CygWin interact.
  • Install for: All Users.

Again I leave everything as-is, click Next.

  • Local Package Directory: C:\Users(my user name)\AppData\Local\Temp\cygwin.

No idea. Correct? Probably, hopefully.

I leave as-is, click Next.
It does stuff, then comes up with CygWin Setup – Select Packages (a GUI).
When I change View to Full, there’s a substantial list of packages, and all are “Keep”. I take it this means they’re all installed?

But when I go through the list as mentioned on the Haxe page, not everything is there!

  • make: ok

  • git: ok

  • zlib-devel: NOT THERE. There is a zlib0. Is that it?

  • libpcre-devel: NOT THERE There is a libpcre1. Is that it?

  • mingw64-x86_64-gcc-core: ok

  • mingw64-x86_64-zlib: NOT THERE, and there’s nothing that looks like it.

  • mingw64-x86_64-pcre: NOT THERE, and there’s nothing that looks like it.

========

  • Copy zlib1.dll and libpcre-1.dll from path/to/cygwin/usr/x86_64-w64-mingw32/sys-root/mingw/bin to the checked out Haxe source directory.

NOPE: C:\OCaml64\usr\x86_64-w64-mingw32\sys-root\mingw\bin does NOT contain said DLLs…

========

Sooooo… Something’s not quite right.

Where to go from here?


#22

I’ll have a go at https://github.com/HaxeFoundation/ocamhaxe
Thanks!


#23

Again, I am not following.
It is perfectly possible that I am just too stupid for this…

If I have ONLY this downloaded, and I run config.bat, nothing happens.
Do I need to have the haxe sources checked out as well, or does this tool do this?

I’m sorry, my questions are probably very stupid.
I need VERY clear and unambiguous instructions…


#24

Any help very, very, very much appreciated…


(Adrian V) #25

getting ocaml running on windows is always APIA as I remember. Maybe it helps to follow the INSTALL steps of the appveyor.yml https://github.com/HaxeFoundation/haxe/blob/development/appveyor.yml


#26

Many thanks!
But… bloody hell…
Why is it so difficult to get all this working?!?
Not sure I’m going to pursue this any further…
:roll_eyes::sleepy::disappointed_relieved:


(Dan Korostelev) #27

yeah, getting ocaml dev environment working on windows is a pain, especially for the first time, sorry :slight_smile:


(Simon Krajewski) #28

It’s the Dark Souls of development setups.


#29

Is there no way to encapsulate all this pain into a lovely

http://jrsoftware.org/isinfo.php (awesome free installer with very capable scripting facility)

installer, somehow?

In the meantime, I’ll keep on trying to get stuff working…
Grrr…
Just wanna start working on my target!
Grrrrrrrr…


(Mark) #30

KEEP CALM

AND INSTALL OCAML

:slight_smile:


(Rudy Ges) #31

I think you misspelled linux.


(Adrian V) #32

if you follow the appveyor.yml script it is not that bad :slight_smile:
here is what I did:

  • install chcoco and git
  • create a source directory for haxe e.g. c:\source
  • open a cmd shell and git clone https://github.com/HaxeFoundation/haxe
  • don’ forget to ‘git submodule update --init --recursive’
  • setup your environment and follow thw appveyor script
set CYG_ROOT=c:\cygwin64
set ARCH=64
set APPVEYOR_BUILD_FOLDER=C:\source\haxe
cd %APPVEYOR_BUILD_FOLDER%\..
choco install curl wget -y
curl -fsSL -o cygwin-setup.exe --retry 3 https://cygwin.com/setup-x86_64.exe
cygwin-setup.exe -g -q -R "%CYG_ROOT%" -P make -P git -P zlib-devel -P mingw64-x86_64-zlib -P mingw64-i686-zlib -P rsync -P patch -P diffutils -P curl -P unzip -P m4 -P perl -P mingw64-x86_64-gcc-core -P mingw64-i686-gcc-core -P libpcre-devel -P mingw64-x86_64-pcre -P mingw64-i686-pcre
curl -fsSL -o "opam.tar.xz" --retry 3 https://github.com/fdopen/opam-repository-mingw/releases/download/0.0.0.1/opam%ARCH%.tar.xz
7z x "opam.tar.xz" -so | 7z x -aoa -si -ttar
%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && bash opam${ARCH}/install.sh"
%CYG_ROOT%/bin/bash -lc "opam init mingw \"https://github.com/fdopen/opam-repository-mingw.git\" --comp 4.07.0+mingw${ARCH}c --switch 4.07.0+mingw${ARCH}c --auto-setup --yes"'
%CYG_ROOT%/bin/bash -lc "opam update --yes"
%CYG_ROOT%/bin/bash -lc "opam pin add haxe \"$APPVEYOR_BUILD_FOLDER\" --no-action --yes"
%CYG_ROOT%/bin/bash -lc "opam install haxe --deps-only --yes"
  • now build haxe for the first time
cd %APPVEYOR_BUILD_FOLDER%
%CYG_ROOT%/bin/bash -lc "cd \"$OLDPWD\" && make -s -f Makefile.win libs && make -j -s -f Makefile.win haxe && make -s -f Makefile.win haxelib"

hope this helps


(Allan Dowdeswell) #33

This totally hits home with me, I feel your pain. Must be an open-source thing.


#34

Hahaha :smile::smile::smile:

P.S. I did mention willingness to eventually install Linux in a VirtualBox instance.
But this is only as a last resort.
I WANT it to work on Windows.


(Valentin Lemière) #35

Did you use the version from the release https://github.com/HaxeFoundation/ocamhaxe/releases?

If so yes running config.bat should be enough to setup everything and then you can go and build haxe.


#36

opam64/install.sh: line 50: readlink: command not found ?


#37

Trying this now, thanks


#38

Build.exe fails with “Cygwin not found”…


#39

Does it need to be in the path or something?


#40

Error : Process creation failure : dumpbin.exe

The file dumpbin.exe doesn’t exist on my system.

Do I need to install the full VS for this (I sure hope not…)?