user-experience icon indicating copy to clipboard operation
user-experience copied to clipboard

Hard to build from source

Open iacore opened this issue 3 years ago • 8 comments

I was trying to build https://github.com/rakudo/rakudo/. The readme page says that I can download MoarVM and nqp myself.

  1. I built moar easily.
  2. Then I tried to build nqp. It failed at "cannot get MoarVM version".

Turns out moar --version says `This is MoarVM version built with JIT support.

  1. Fixed the version VERSION=(cat VERSION ) perl Configure.pl --prefix=xxxxx. However, NQP still refuse to build. (version too old, need 2022.06-2-gcc49dcf93)
  2. Deleted the version check manually. (nqp/tools/lib/NQP/Config/NQP.pm line 393). Rakudo still can't find nqp.
  3. Ran VERSION=(cat VERSION ) perl Configure.pl --prefix=xxxxxx --git-cache-dir=.. in Rakudo repo. Says NQP has no version.
  4. Gave NQP VERSION 2022.06-3 and git tag, Rakudo still refuse to build. Says the version isn't right.
  5. Modified rakudo/tools/lib/NQP/Config/Rakudo.pm line 651. Rakudo still says it need git tag.
  6. Ran git tag xxxx for Rakudo. Finally it build.

Request: Use feature detection, not version number.

Another pain point is that there is no easy --with-moar when building rakudo.

iacore avatar Jun 18 '22 20:06 iacore

I want to contribute to Rakudo, but must I use Perl 5?

The dependency is huge too.

  • GNU Make
  • Shell script
  • Perl <=5 (Configure.pl)
  • C compiler
  • Moar
  • NQP
  • Rakudo

Why doesn't Rakudo use viv to translate to perl 5?

iacore avatar Jun 18 '22 21:06 iacore

I'm not quite sure why you're having all this trouble. For me, the simplest way to build Rakudo from source is running perl Configure.pl --prefix=/my/raku/install/ --backend=moar --gen-moar --make-install in the Rakudo directory. If I want to build the three components separately, I run perl Configure.pl --prefix=/my/raku/install/ && make -j12 install in the MoarVM repo, then perl Configure.pl --prefix=/my/raku/install/ --backend=moar && make -j12 install in the NQP repo, and finally perl Configure.pl --prefix=/my/raku/install/ --backend=moar && make -j12 install in the Rakudo repo.

Another pain point is that there is no easy --with-moar when building rakudo.

Yeah, maybe that should be added. However, NQP does have that option, and you need an NQP install to build Rakudo, so I can see the logic of why it's left out for Rakudo.

I want to contribute to Rakudo, but must I use Perl 5?

Use as in write Perl 5? No, not unless you want to make any changes to the build process. Use as in have a Perl 5 binary installed? Yes, it's readily available for all the platforms Rakudo supports, so makes bootstrapping easy.

Why doesn't Rakudo use viv to translate to perl 5?

It's way too outdated. Also, I'm not sure why you'd want it? For the Rakudo build process? Or just in general?

MasterDuke17 avatar Jun 18 '22 21:06 MasterDuke17

I don't want to download the git repo multiple times. I can't use --gen-moar.

When building Rakudo, --git-depth=1 isn't fully respected. It fetches nqp bootstrapping repo, which isn't necessary.

I don't care about contributing. Downloading a tarball from Github release is much faster.

iacore avatar Jun 19 '22 09:06 iacore

The instructions for installing the Rakudo compiler from scratch on windows don't seem to work: There is no nqp directory as outlined with the instructions at https://rakudo.org/downloads/rakudo/source for the "Bash on Windows" section. And when trying to follow the "Build" instructions for "Windows", there is no Configure.pl script.

So these instructions seem badly out of date.

sdondley avatar Aug 24 '22 17:08 sdondley

Those instructions are way overcomplicated. Looks like they rely on doing lots of steps manually that are already handled by Configure.pl. I don't use WSL, I use 'git bash', but I imagine they should be similar.

I'll put together a cleaned up version in a day or so and post it here, and we can decide what we want to be on the website.

Question: do you have a version of visual studio installed? git bash?

--

Reading more comments, I see that for me: having to manually deal with the tarballs is complicated, but for others, having to deal with git multiple times is the problem; Guessing we'll want to spell out multiple options.

@sdondley : The missing nqp directory referenced just above: there's a step in the directions to clone nqp; the directory won't exist until then; Also, Configure.pl is in the tar file; the instructions have you extract the tar and move the directory, and the Configure.pl is there.

Hopefully some updated instructions can simplify this, though.

coke avatar Oct 03 '22 16:10 coke

@coke OK, I don't remember any details of my experience getting it installed and I don't typically use Windows. But let me know if you want me to try out your new instructions to see if they work for me on a fresh install of Windows 11.

sdondley avatar Oct 05 '22 15:10 sdondley

My initial take is that there are several flavors of possible installs here, including:

  • rakubrew
  • git & gcc
  • git & visual studio
  • tarballs & gcc
  • tarballs & visual studio

This becomes a very large exercise, might be worth having just the options on the main page and linking to each individual set of instructions.

coke avatar Oct 05 '22 15:10 coke

https://gist.github.com/coke/f6488d106d4a580216809f3e69b553f5 with the git/gcc directions so far.

Feedback welcome, we can probably move these to the rakudo github repo's wiki.

coke avatar Oct 07 '22 02:10 coke