How to implement new Haxe target?

You’re supposed to call config.bat and only that,
if cygwin is not installed on your system then it’ll use the bundled one, if it is it’ll use yours.

That’s what I did, didn’t work…
I guess I need to uninstall everything and start again…

Will it also fetch dumpbin.exe from somewhere?

dumpbin.exe is only required to build ocamlhaxe, not use it.

And please try and not make two posts seconds apart instead of one.

…sorry… :grimacing:

@Matt don’t give up :). Just do something else and keep asking here. Maybe sometimes it takes some time to get an answer, so just occupy your time with something else but I’m sure you’ll get it running soon :).

Amazing persistence by the way, from both you and everybody here. What a show of force, what topic! :smiley: Epic stuff.

(yes, I wanted to suggest VM but I didn’t because I admire your persistence to get it to work on Windows. I’m also a Windows guy and despite all the crap that always happened here and continues to happen thanks to the fart-ization (read gas-ification, read cloud-ification, read “you’re our product so give us your data”-ation), I still think Windows offers enormous possibilities to its users. Good luck doing what I do with win32 api on Linux :D. Totally illegal, dangerous, crazy-shit bonkers stuff that shouldn’t be allowed in any “decent” OS but I love Windows for having such an “unparanoid” kernel. Oh yes I know I could achive the same in Linux if I’d modify kernel stuff or deep core libraries, but Windows does all this with one simple API call, hehehe, hooray for Windows Hooks :smiley: )

2 Likes

Get all the utilities from the Windows SysInternals site to better understand Windows

Sysinternals - Sysinternals | Microsoft Learn

Also the Charles Petzold books Programming Windows has nifty things
6th edition uses C# earlier used C++

Thanks for the kind words.
I won’t give up.
(I must admit, I was disheartened by the reprimand I got yesterday evening… I’m suffering from depression and take everything waaay too literally and seriously as a result…)
Once I pull myself together again, I will continue and report back here (or potentially in a separate thread)

Good day all,

I’ve gotten quite a bit further.
But now I get this strange message:

The command that fails is very long, almost 7,000 characters (yes, you read that right)… It is:

ocamlfind ocamlopt -safe-string -linkpkg -g -o haxe.exe -thread -cclib libs/extc/extc_stubs.o -cclib libs/extc/process_stubs.o -cclib libs/objsize/c_objsize.o -cclib libs/pcre/pcre_stubs.o -ccopt -L/usr/local/lib -cclib -lpcre -cclib -lz -I "c:/program files/mingw/lib/"   -package unix -package str -package threads -package dynlink -package sedlex -package xml-light -package extlib -package ptmap -package sha -I libs/extlib-leftovers -I libs/extc -I libs/neko -I libs/javalib -I libs/swflib -I libs/ttflib -I libs/ilib -I libs/objsize -I libs/pcre -I libs/ziplib extlib-leftovers.cmxa extc.cmxa neko.cmxa javalib.cmxa swflib.cmxa ttflib.cmxa ilib.cmxa objsize.cmxa pcre.cmxa ziplib.cmxa _build/src/compiler/serverConfig.cmx _build/src/compiler/version.cmx _build/src/core/globals.cmx _build/src/core/json/json.cmx _build/src/core/json/jsonRpc.cmx _build/src/core/json/jsonrpc_handler.cmx _build/src/core/meta.cmx _build/src/core/numeric.cmx _build/src/core/stringHelper.cmx _build/src/core/timer.cmx _build/src/generators/hlcode.cmx _build/src/generators/hlopt.cmx _build/src/macro/eval/evalBytes.cmx _build/src/macro/eval/evalHash.cmx _build/src/core/socket.cmx _build/src/core/path.cmx _build/src/core/json/jsonRpcSocket.cmx _build/src/core/display/displayPosition.cmx _build/src/core/define.cmx _build/src/core/ast.cmx _build/src/core/type.cmx _build/src/core/withType.cmx _build/src/filters/localUsage.cmx _build/src/macro/eval/evalValue.cmx _build/src/syntax/lexer.cmx _build/src/syntax/reification.cmx _build/src/macro/eval/evalString.cmx _build/src/core/json/genjson.cmx _build/src/core/error.cmx _build/src/core/display/completionItem.cmx _build/src/core/abstract.cmx _build/src/context/purityState.cmx _build/src/codegen/overloads.cmx _build/src/codegen/gencommon/renameTypeParameters.cmx _build/src/codegen/gencommon/interfaceProps.cmx _build/src/core/displayTypes.cmx _build/src/core/texpr.cmx _build/src/filters/varLazifier.cmx _build/src/optimization/optimizerTexpr.cmx _build/src/syntax/parser.cmx _build/src/syntax/grammar.cmx _build/src/context/display/documentSymbols.cmx _build/src/context/display/displayException.cmx _build/src/context/common.cmx _build/src/codegen/swfLoader.cmx _build/src/codegen/java.cmx _build/src/codegen/genxml.cmx _build/src/codegen/gencommon/setHXGen.cmx _build/src/codegen/dotnet.cmx _build/src/codegen/codegen.cmx _build/src/codegen/gencommon/gencommon.cmx _build/src/codegen/gencommon/interfaceVarsDeleteModf.cmx _build/src/codegen/gencommon/normalize.cmx _build/src/codegen/gencommon/objectDeclMap.cmx _build/src/codegen/gencommon/overloadingConstructor.cmx _build/src/codegen/gencommon/realTypeParams.cmx _build/src/codegen/gencommon/switchToIf.cmx _build/src/codegen/gencommon/unreachableCodeEliminationSynf.cmx _build/src/context/compilationServer.cmx _build/src/context/display/deprecationCheck.cmx _build/src/context/sourcemaps.cmx _build/src/context/typecore.cmx _build/src/filters/ES6Ctors.cmx _build/src/filters/defaultArguments.cmx _build/src/filters/tryCatchWrapper.cmx _build/src/generators/genas3.cmx _build/src/generators/gencpp.cmx _build/src/generators/genjs.cmx _build/src/generators/genlua.cmx _build/src/generators/genneko.cmx _build/src/generators/genphp7.cmx _build/src/generators/genpy.cmx _build/src/generators/genswf9.cmx _build/src/generators/hl2c.cmx _build/src/generators/hlinterp.cmx _build/src/macro/macroApi.cmx _build/src/optimization/analyzerConfig.cmx _build/src/optimization/analyzerTexpr.cmx _build/src/optimization/analyzerTypes.cmx _build/src/syntax/parserEntry.cmx _build/src/typing/nullSafety.cmx _build/src/typing/typeloadParse.cmx _build/src/optimization/analyzerTexprTransformer.cmx _build/src/macro/eval/evalContext.cmx _build/src/macro/eval/evalArray.cmx _build/src/generators/genswf.cmx _build/src/generators/genhl.cmx _build/src/context/display/display.cmx _build/src/context/display/diagnostics.cmx _build/src/context/abstractCast.cmx _build/src/compiler/serverMessage.cmx _build/src/codegen/gencommon/initFunction.cmx _build/src/codegen/gencommon/fixOverrides.cmx _build/src/codegen/gencommon/expressionUnwrap.cmx _build/src/codegen/gencommon/dynamicOperators.cmx _build/src/codegen/gencommon/dynamicFieldAccess.cmx _build/src/codegen/gencommon/closuresToClass.cmx _build/src/codegen/gencommon/classInstance.cmx _build/src/codegen/gencommon/castDetect.cmx _build/src/codegen/gencommon/arraySpliceOptimization.cmx _build/src/codegen/gencommon/arrayDeclSynf.cmx _build/src/codegen/gencommon/abstractImplementationFix.cmx _build/src/codegen/gencommon/filterClosures.cmx _build/src/codegen/gencommon/hardNullableSynf.cmx _build/src/codegen/gencommon/intDivisionSynf.cmx _build/src/codegen/gencommon/reflectionCFs.cmx _build/src/codegen/gencommon/tArrayTransform.cmx _build/src/codegen/gencommon/unnecessaryCastsRemoval.cmx _build/src/context/display/displayEmitter.cmx _build/src/context/display/displayToplevel.cmx _build/src/context/display/importHandling.cmx _build/src/context/display/statistics.cmx _build/src/filters/filtersCommon.cmx _build/src/macro/eval/evalField.cmx _build/src/macro/eval/evalPrinting.cmx _build/src/optimization/dce.cmx _build/src/optimization/inline.cmx _build/src/optimization/inlineConstructors.cmx _build/src/optimization/optimizer.cmx _build/src/typing/typeload.cmx _build/src/typing/typeloadCheck.cmx _build/src/typing/typeloadFunction.cmx _build/src/typing/typeloadFields.cmx _build/src/typing/generic.cmx _build/src/optimization/analyzer.cmx _build/src/macro/eval/evalExceptions.cmx _build/src/macro/eval/evalEncode.cmx _build/src/macro/eval/evalDecode.cmx _build/src/filters/jsExceptions.cmx _build/src/filters/capturedVars.cmx _build/src/context/display/findReferences.cmx _build/src/codegen/gencommon/enumToClass2.cmx _build/src/codegen/gencommon/enumToClass.cmx _build/src/generators/gencs.cmx _build/src/generators/genjava.cmx _build/src/macro/eval/evalMisc.cmx _build/src/typing/instanceBuilder.cmx _build/src/typing/typeloadModule.cmx _build/src/typing/typerBase.cmx _build/src/typing/magicTypes.cmx _build/src/typing/finalization.cmx _build/src/typing/fields.cmx _build/src/typing/calls.cmx _build/src/macro/eval/evalJitContext.cmx _build/src/macro/eval/evalEmitter.cmx _build/src/macro/eval/evalDebugMisc.cmx _build/src/macro/eval/evalDebug.cmx _build/src/context/display/displayFields.cmx _build/src/macro/eval/evalDebugSocket.cmx _build/src/macro/eval/evalJit.cmx _build/src/macro/eval/evalPrototype.cmx _build/src/macro/eval/evalStdLib.cmx _build/src/typing/forLoop.cmx _build/src/typing/typerDisplay.cmx _build/src/macro/eval/evalMain.cmx _build/src/filters/filters.cmx _build/src/typing/macroContext.cmx _build/src/typing/matcher.cmx _build/src/typing/typer.cmx _build/src/compiler/displayOutput.cmx _build/src/compiler/server.cmx _build/src/context/display/displayJson.cmx _build/src/compiler/main.cmx

When I close the message, I get:

Capture1

The ocamlfind command seems to work fine on its own:

Capture2

Not sure how to proceed from here…

Any help very much appreciated!

That might be an instance of this issue from the troubleshooting section:

Or just use the Ocaml bash instead of cmd.exe I guess.

(Building Haxe compiler - Haxe - The Cross-platform Toolkit)

1 Like

Many thanks.

I now notice something strange:

There’s Building Haxe compiler - Haxe - The Cross-platform Toolkit,
and there’s haxe/BUILDING.md at development · HaxeFoundation/haxe · GitHub

They start out the same, but then diverge!

Which one to follow?

Many thanks again :grinning::slightly_smiling_face:

Yeah, that’s a weird situation… Perhaps look at both, the one on GitHub seems to be missing some info like the troubleshooting section, but is probably also more up to date…

1 Like

Soooooo…

For the 3rd or 4th time, I’m gonna delete everything CygWin & OCaml & Mingw & whatnot, and try again…

If this continues to not work (which is more than likely), if I use VirtualBox + Linux instead, will I then be able to cross-compile and build Haxe WINDOWS executables, from Linux, to be used in Windows?

What was the issue?

I don’t think that’s a thing. :confused:

It became just a big mess, I tried several things.
I didn’t keep notes.
I have problems thinking straight, to be honest.

So I think best is now to delete / uninstall everything, and start over completely, and this time, keep notes.

It’s a real problem that I don’t actually know what the whole Mingw, CygWin, etc environment is, what it is doing, how it all works, interacts, and how one thing is expecting everything else to apparently be a specific place (or not).
Or something :roll_eyes:

Yes, OCaml on Windows really isn’t too much fun… Yesterday I tried to see if I could get this debugger working, and basically wrecked my previously working setup in the process, since:

  • It requires at least OCaml 4.04, fdopen’s latest is 4.03, so I had to use opam switch to update - this still went somewhat smoothly.
  • It’s also only available with opam 2, but fdopen’s build ships with 1.3.0. Of course, as a Windows user you have to build it from source, which takes a while. After that, it updated my opam repository layout (non-reversible…), which basically consisted of watching error messages scroll through for several minutes.
  • After “successfully” updating opam, I realized that there’s suddenly no more compilers available via opam switch. Turns out that opam 2 support is still an unresolved issue with fdopen’s setup, and there’s some experimental branch for it…

So now I’m in a state where running the old opam executable errors with:

[ERROR] C:/OCaml64/home//.opam reports a newer OPAM version, aborting.

And the new one errors with:

[ERROR] The selected switch 4.04.2+mingw64 is not installed. Please choose a different one […]

I can still compile Haxe. But basically now I’m stuck with whatever opam packages I previously had installed, so I’m good as long as the ones required to build Haxe don’t change… :smiley:

OMG, there HAS to be a better way than all this…

There might be one actually, some people install OCaml via WSL.

However, it also wouldn’t allow you to produce a native Windows executable. That in itself is not necessarily a problem, but I’m pretty sure tools like vshaxe lack support for using a WSL haxe at the moment… :confused: Then again, unless you’re working on the dipslay APIs of the compiler, you can just continue using a regular Haxe installation for code completion.

But if you’re fine not having much OCaml IDE support (which would be really helpful especially for somebody new to OCaml, not sure how well that plugin I linked works) and running Haxe through the command line, that might be a good option.

That’s the point where we realize again, that the biggest hurdle for people who want to hack into the Haxe compiler is OCaml. In a perfect world…- no, I am not going to ask - no, no, no… but it would be so nice if Haxe would be written in Haxe.

@AdrianV