opencog / link-grammar

The CMU Link Grammar natural language parser
GNU Lesser General Public License v2.1
389 stars 119 forks source link

How to build release tar ball #1251

Closed amebel closed 3 years ago

amebel commented 3 years ago

Getting error when trying to build a tar ball as the one found at http://www.abisource.com/downloads/link-grammar/current/

steps followed

git clone --depth 10 https://github.com/opencog/link-grammar.git
cd link-grammar/
git checkout tags/link-grammar-5.10.2 -b release
./autogen.sh 
cd build/
make dist

output of make dist

root@6b7e2eeeec71:/tmp/link-grammar/build# make dist
make  dist-gzip am__post_remove_distdir='@:'
make[1]: Entering directory '/tmp/link-grammar/build'
make  distdir-am
make[2]: Entering directory '/tmp/link-grammar/build'
if test -d "link-grammar-5.10.2"; then find "link-grammar-5.10.2" -type d ! -perm -200 -exec chmod u+w {} ';' && rm -rf "link-grammar-5.10.2" || { sleep 5 && rm -rf "link-grammar-5.10.2"; }; else :; fi
test -d "link-grammar-5.10.2" || mkdir "link-grammar-5.10.2"
 (cd link-grammar && make  top_distdir=../link-grammar-5.10.2 distdir=../link-grammar-5.10.2/link-grammar \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory '/tmp/link-grammar/build/link-grammar'
make  distdir-am
make[4]: Entering directory '/tmp/link-grammar/build/link-grammar'
  LEX      post-process/pp_lexer.c
 (cd minisat && make  top_distdir=../../link-grammar-5.10.2 distdir=../../link-grammar-5.10.2/link-grammar/minisat \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[5]: Entering directory '/tmp/link-grammar/build/link-grammar/minisat'
make  distdir-am
make[6]: Entering directory '/tmp/link-grammar/build/link-grammar/minisat'
make[6]: Leaving directory '/tmp/link-grammar/build/link-grammar/minisat'
make[5]: Leaving directory '/tmp/link-grammar/build/link-grammar/minisat'
 (cd sat-solver && make  top_distdir=../../link-grammar-5.10.2 distdir=../../link-grammar-5.10.2/link-grammar/sat-solver \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[5]: Entering directory '/tmp/link-grammar/build/link-grammar/sat-solver'
make  distdir-am
make[6]: Entering directory '/tmp/link-grammar/build/link-grammar/sat-solver'
make[6]: Leaving directory '/tmp/link-grammar/build/link-grammar/sat-solver'
make[5]: Leaving directory '/tmp/link-grammar/build/link-grammar/sat-solver'
make[4]: Leaving directory '/tmp/link-grammar/build/link-grammar'
make[3]: Leaving directory '/tmp/link-grammar/build/link-grammar'
 (cd bindings && make  top_distdir=../link-grammar-5.10.2 distdir=../link-grammar-5.10.2/bindings \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: Entering directory '/tmp/link-grammar/build/bindings'
make  distdir-am
make[4]: Entering directory '/tmp/link-grammar/build/bindings'
make[4]: *** No rule to make target 'node.js/package-lock.json', needed by 'distdir-am'.  Stop.
make[4]: Leaving directory '/tmp/link-grammar/build/bindings'
make[3]: *** [Makefile:547: distdir] Error 2
make[3]: Leaving directory '/tmp/link-grammar/build/bindings'
make[2]: *** [Makefile:665: distdir-am] Error 1
make[2]: Leaving directory '/tmp/link-grammar/build'
make[1]: *** [Makefile:659: distdir] Error 2
make[1]: Leaving directory '/tmp/link-grammar/build'
make: *** [Makefile:761: dist] Error 2

What am I missing?

linas commented 3 years ago

autogen does not put anything in build. The way that I build is

./autogen.sh --no-configure  # otehrwise it will run configure
mkdir build
cd build
../configure  # now run configure by hand
make  -j   #maybe you can skip this step?
make -j distcheck  # runs unit tests too
linas commented 3 years ago

BTW, Running configure in two different directories leaves the system in a confused mess. In that cse, you have to start clean.

amebel commented 3 years ago

I get the same error following your step in a new clone.

linas commented 3 years ago

Argh. I gotta go walk the dog, I'll look at this in a few hours. I imagine there's probably some node.js pre-req that you haven't installed ... and yes, configure should look for that and not attempt to build the node bindings if its absent.

Why are you trying to replicate the release tarball? If you just need a working install, you can get that from the existing release tarball, right? So that's not the issue?

linas commented 3 years ago

Huh. OK. I can reproduce this. So apparently, I have a file called package-lock.json which is not checked into git. However, bindings/Makefile.am adds it to the tarball. It works for me, cause I have this file... but not for you, because you don't ...

I cannot time-travel back to that git tag to fix this. There are two possible fixes: either checkin package-lock.json or remove it from Makefile.am I chose the latter. Now the node.js documentation says that although package-lock.json is autogenerated, it can be checked into git, and maybe should, for reproducibility reasons. I don't know node.js well enough to tinker with this, and indeed, it appears that npm no longer works: npm install fails with a waterfall of libuv errors ... it used to work fine a few months ago, before I said apt dist-upgrade...

So that's the long story. Just edit Makefile.am, remove package-lock.json, rerun ./autogen.sh and you'll get a tarball. It won't be the release tarball. If you must have the release tarball .. well, just copy the missing file.