-
-
Save toolforger/b87b3019babdcc073dd4ad4d176fc195 to your computer and use it in GitHub Desktop.
# Setup installation directory | |
mkdir install | |
# Create an environment setup shell file for sourcing | |
# Make it so that it can be repeated with no ill effects | |
cat >setup-vars.inc.sh <<EOF | |
if [ ".\$perl6_prefix" = "." ]; then | |
export perl6_prefix=`pwd`/install | |
export PATH=\$perl6_prefix/bin:\$PATH | |
fi | |
EOF | |
# ... and source it for the rest of this script | |
source setup-vars.inc.sh | |
# Try to be somewhat offline-ready: Download first, then build. | |
# Download all relevant repositories | |
git clone --recurse-submodules https://github.com/MoarVM/MoarVM.git | |
git clone https://github.com/MasterDuke17/nqp | |
git clone https://github.com/rakudo/rakudo.git | |
# Alternate: Update existing repositories | |
# We rebase the line number branch to freshly checked-out master | |
# just 12 hours between nqp and rakudo were enough to make rakudo complain about outdated nqp... | |
cd MoarVM | |
git pull --recurse-submodules | |
cd ../nqp | |
git checkout master | |
git pull | |
git checkout source_file_line_numbers_on_jvm | |
git pull | |
cd ../rakudo | |
git pull | |
cd .. | |
# Build and install MoarVM | |
cd MoarVM | |
# The following still wants to be online for the submodules, | |
# even though we have a current copy. | |
# I'd like to avoid this but don't yet know how. | |
perl Configure.pl --prefix=$perl6_prefix --make-install | |
cd .. | |
# Build and install NQP | |
cd nqp | |
# get the branch that shows the problem | |
git checkout source_file_line_numbers_on_jvm | |
perl Configure.pl --backends=moar,jvm --prefix=$perl6_prefix --make-install | |
cd .. | |
# Build and install Rakudo | |
cd rakudo | |
perl Configure.pl --backends=moar,jvm --prefix=$perl6_prefix --make-install | |
# FAILS with a complaint that nqp-j is too old. Dangit. | |
# ===SORRY!=== | |
# nqp-j is too old | |
# The nqp-m binary is too old | |
# | |
# To automatically clone (git) and build a copy of NQP 2017.01-64-gf21c8f1, | |
# try re-running Configure.pl with the '--gen-moar' option. | |
# Or, use '--prefix=' to explicitly specify the path where the NQP and MoarVM | |
# executables can be found that are use to build Rakudo. | |
cd .. | |
# "from scratch" is done, onwards to "reproduce"! | |
perl6-j --ll-exception -e 'say 1/0' |
In fact, none of the jars in rakudo or nqp had a ClassReader.
Ah, sorry, ClassReader.class is in the asm-*.jar. It is one of the 3rdparty libs, and it is copied over to the install dir.
General recommendation is to use 5.x of asm, simply to avoid any issues with classfile format, and to get bug fixes - 3.1 is pretty much outdated.
But if the behaviour is the same with 5.x, we should stick with 3.1 to keep variability low.
nqp was at the same version, rakudo was newer.
Checking out rakudo at the version given did not help, though, I still get those "too old" messages.
I tried looking into rakudo's Configure.pl, but the data flow is so extensive that it's really hard to figure out what's going on. My best guess is that it is checking whether certain settings are available, and if they are missing, it assumes a version mismatch, but that it is really some missing data somewhere in the configuration files.
I'll try a few more things.
No, we're using 4.1 of asm.
Did you re-run rakudo's Configure.pl after checking out at the right version?
git clone https://github.com/rakudo/rakudo.git
cd rakudo
perl Configure.pl --backends=jvm,moar --gen-nqp --gen-moar
# Installs to rakudo/install, which is fine.
./perl6-j --ll-exception -e 'say 1/0'
# Fails with Attempt to divide 1 by zero using div, which is fine.
cat perl6-j
Mmmm... more fragilities.
It uses -noverify
. I.e. if the generated bytecode is invalid, you will get crashes instead of a nice error message.
$CLASSPATH
near the start of the -cp
- mmm, did you install asm as a package, maybe? If your distro puts installed jars into CLASSPATH, this will override the asm lib used by rakudo.
Now that I have a working standard rakudo, what did you exactly do to get the exception?
Which jars did you unpack, did you vary the command line you used to run Perl6?
I didn't check out your nqp yet. First thing I wanted to try is whether I can reproduce the problem without line numbers, if only to see how things should look like normally.
One thing I noted is that leaving out -noverify does not cause any errors. So if you want to build confidence in your asm usage, remove that option and the JVM will tell you whether any class file is invalid right when it tries to load it.
Not sure whether I re-ran Configure.pl. I usually use Configure.pl, but sometimes (rarely) I just use make.
It is using asm-4.1, I also tried with the newest 4.x and 5.x, but got the exact same behavior.
There is no ClassReader at all when I
unzip -v nqp/nqp-runtime.jar
.