How to implement new Haxe target?

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?

I’ll have a go at GitHub - HaxeFoundation/ocamhaxe: OCaml distribution for Haxe compilation
Thanks!

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…

Any help very, very, very much appreciated…

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

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:

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

It’s the Dark Souls of development setups.

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…

KEEP CALM

AND INSTALL OCAML

:slight_smile:

1 Like

I think you misspelled linux.

1 Like

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

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

1 Like

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

1 Like

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.

Did you use the version from the release Releases · HaxeFoundation/ocamhaxe · GitHub?

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

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

Trying this now, thanks

Build.exe fails with “Cygwin not found”…

Does it need to be in the path or something?

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…)?