Raku / nqp

NQP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Building NQP on Windows

markyys opened this issue · comments

There are a couple of issues I'm running into building from the tag 2020.02.01.

Firstly, if I do something simple like

git clone https://github.com/Raku/nqp.git nqp; cd nqp
git checkout 2020.02.1
perl Configure.pl --backends-jvm --make-install

I get the error from gmake
No rule to make target 'src\vm\jvm\runtime\org\perl6\nqp\io\*.java', needed by 'gen\jvm\share\runtime\nqp-runtime.jar'.

I'm not super familiar with Makefile syntax, but it does appear that that path (and others) are part of RUNTIME_JAVAS which is a dependency of RUNTIME_JVM, but there is indeed no make target for any of them.

This is also happening in master (57a4d5e).

Please, check the out output of Configure.pl. Is gmake the suggested make utility?

Yes, it says You can now use 'gmake' to build NQP.

BTW, you do not need a rule for *.java. But are the files actually located in src\vm\jvm\runtime\org\perl6\nqp\io\?

Also, can you try using nmake instead? If you get MSVC installed then Configure.pl would choose it as the default toolchain.

Unfortunately, Java refuses to compile for me under Windows. I cannot test it and haven't got enough time to find out what makes JDK unhappy about my setup.

The files are in that directory, yes.

If it doesn't need a rule for *.java, then why does gmake complain that there is no rule?

I'll try getting nmake working and see what it does.

Looks like nmake has no problem with it.

As a side note, it would be niceif compiling worked from an msys environment (as one gets from git bash). As it is I do everything via git bash, but I have to open cmd.exe only for compiling nqp.

Hmm, so it gets past the initial make now, but dies later in the nqp-j.bat section with Can't spawn "cmd.exe" on lines 23 and 24 of Configure.pl, which appear to be trying to run git config commands.

In fact, all future attempts to call system result in Can't spawn "cmd.exe"

Ok, I have finally fixed my problem with java (oh, yes, it's very smart of someone to use java.exe from Java 8 when jdk preceeds it in PATH!) and got the initial problem reproduced.

Unfortunately, my worst assumption got confirmed: gmake doesn't care about Windows \ path separator! Unfortunately, this problem draws it totally useless for us as we cannot mess up with the separator and have to use the system standard everywhere. So, my conclusion: no gmake on Windows. At least for now. Sorry for that, but it wasn't me who chose non-standard path separator around some 40 years ago! ;)

But otherwise build works with nmake. There is a problem with nqp-j.bat (though on my side it looked differently, but I suspect the same roots of it), but I will commit a fix for it soon, when a test run finishes.

If it won't work to use gmake on Windows then I might suggest that the "has_gmake" check inside of the "is_win" condition is not doing much good.

1517cf7 fixes the problem.

I'm not going to bump NQP version in Rakudo for such a minor fix. Bumps are happening regularly lately, so it won't take much time for the patch to be pulled in into normal Rakudo build. For now, if you're going to compile Rakudo with JVM backend, I can recommend using --gen-nqp=master parameter with Configure.pl.

Brief testing reveals that NQP REPL behaves strangely on Windows. But this is not related to the build process.

I'd like to ask you to test the patch on your side and confirm if it works for you.

UPD Rakudo build also needs fixing.

If it won't work to use gmake on Windows then I might suggest that the "has_gmake" check inside of the "is_win" condition is not doing much good.

You're probably right, but it needs to be discussed first.

Okay, so I'm not able to fully compile nqp by itself, but now I'm running into trouble with rakudo itself.
When I run perl Configure.pl --gen-nqp=master --backends=jvm it eventually dies with jvm::runtime.jars not available from [...]\install\bin\nqp-j.exe --show-config. at [...]/3rdparty/nqp-configure/lib/NQP/Config.pm line 192.

If I look in that directory, there is no nqp-j.exe, but there is an nqp-j.bat which looks like it provides the expected output if one runs install\nqp-j.bat --show-config.

Okay, so I'm not able to fully compile nqp by itself, but now I'm running into trouble with rakudo itself.

I guess, you meant I'm able to?

When I run perl Configure.pl --gen-nqp=master --backends=jvm it eventually dies with jvm::runtime.jars not available from [...]\install\bin\nqp-j.exe --show-config. at [...]/3rdparty/nqp-configure/lib/NQP/Config.pm line 192.

See the reference for a ticket in Rakudo repo above.

I'm closing this ticket as solved.