CDSoft / pp

PP - Generic preprocessor (with pandoc in mind) - macros, literate programming, diagrams, scripts...
http://cdelord.fr/pp
GNU General Public License v3.0
252 stars 21 forks source link

Include requirements for running 'make test' on documentation #89

Closed rolandog closed 6 months ago

rolandog commented 4 years ago

I was interested in observing the usage and output of the -M option (which, thank you so much for implementing).

So I decided to run make test and inspect the output, but make test failed several times, apparently due to missing dependencies (which is understandable that they're not required for the installation, but it could be nice to list them in the documentation).

Errors

I'll list some of the errors I stumbled upon while running the tests; hopefully they may help others, when searching online:

#### preprocessing test/pp-test.md
TESTENVVAR=42 stack exec -- pp -md -img="[.stack-work/]img" -DRESOLVER=lts-14.17 -en -html -import=test/subdir/pp-test-lib.i test/pp-test.md > .stack-work/pp-test.output
pp: Error while executing `zsh /tmp/pp20566-4.sh`: zsh: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
make: *** [Makefile:207: .stack-work/pp-test.output] Error 1
make: *** Deleting file '.stack-work/pp-test.output'
#### preprocessing test/pp-test.md
TESTENVVAR=42 stack exec -- pp -md -img="[.stack-work/]img" -DRESOLVER=lts-14.17 -en -html -import=test/subdir/pp-test-lib.i test/pp-test.md > .stack-work/pp-test.output
pp: Error while executing `fish /tmp/pp21665-5.sh`: fish: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
make: *** [Makefile:207: .stack-work/pp-test.output] Error 1
make: *** Deleting file '.stack-work/pp-test.output'
#### preprocessing test/pp-test.md
TESTENVVAR=42 stack exec -- pp -md -img="[.stack-work/]img" -DRESOLVER=lts-14.17 -en -html -import=test/subdir/pp-test-lib.i test/pp-test.md > .stack-work/pp-test.output
WARNING: test/pp-test.md: "bat" is deprecated. Please consider using "cmd" instead.
pp: Error while executing `wine cmd /c /tmp/pp22397-6.bat`: wine: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
make: *** [Makefile:207: .stack-work/pp-test.output] Error 1
make: *** Deleting file '.stack-work/pp-test.output'

I had to run the wine test twice, as there were some errors on the first run about some missing configuration directory, marshal_object couldn't get IPSFactory buffer for interface, and others... and not being able to load wine-gecko.

#### preprocessing test/pp-test.md
TESTENVVAR=42 stack exec -- pp -md -img="[.stack-work/]img" -DRESOLVER=lts-14.17 -en -html -import=test/subdir/pp-test-lib.i test/pp-test.md > .stack-work/pp-test.output
WARNING: test/pp-test.md: "bat" is deprecated. Please consider using "cmd" instead.
pp: Error while executing `lua /tmp/pp24650-11.lua`: lua: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
make: *** [Makefile:207: .stack-work/pp-test.output] Error 1
make: *** Deleting file '.stack-work/pp-test.output'

To get past the lua test, (mentioned in #81 as well), I had to install a specific interpreter and bytecode compiler (lua5.3, in my case---which wasn't immediately obvious, as I already had some lua packages installed):

This package contains the Lua command line interpreter and bytecode compiler. Install it if you are developing or using Lua scripts.

#### preprocessing test/pp-test.md
TESTENVVAR=42 stack exec -- pp -md -img="[.stack-work/]img" -DRESOLVER=lts-14.17 -en -html -import=test/subdir/pp-test-lib.i test/pp-test.md > .stack-work/pp-test.output
WARNING: test/pp-test.md: "bat" is deprecated. Please consider using "cmd" instead.
WARNING: test/pp-test.md: "rawexec" is deprecated. Please consider using "exec" instead.
pp: Error while executing `Rscript /tmp/pp25912-18.R`: Rscript: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
make: *** [Makefile:207: .stack-work/pp-test.output] Error 1
make: *** Deleting file '.stack-work/pp-test.output'
#### tracking dependencies of test/pp-test.md
TESTENVVAR=42 stack exec -- pp -M outputfile -md -img="[.stack-work/]img" -DRESOLVER=lts-14.17 -en -html -import=test/subdir/pp-test-lib.i test/pp-test.md > .stack-work/pp-test.d
WARNING: test/pp-test.md: "bat" is deprecated. Please consider using "cmd" instead.
WARNING: test/pp-test.md: "rawexec" is deprecated. Please consider using "exec" instead.
pp: Error while executing `seqdiag -a -Tsvg -o .stack-work/img/seqdiag-test.svg .stack-work/img/seqdiag-test.diag`: seqdiag: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
make: *** [Makefile:243: .stack-work/pp-test.d] Error 1
make: *** Deleting file '.stack-work/pp-test.d'

Fixes

I fixed the errors for blockdiag, seqdiag, actdiag, nwdiag, rackdiag, packetdiag (which depend on Python 2, and I have Python 3 installed), and other users might try this instead of having to fully install Python 2, by running:

sudo ln -vs /usr/bin/blockdiag3 /usr/bin/blockdiag
sudo ln -vs /usr/bin/seqdiag3 /usr/bin/seqdiag
sudo ln -vs /usr/bin/actdiag3 /usr/bin/actdiag
sudo ln -vs /usr/bin/nwdiag3 /usr/bin/nwdiag
sudo ln -vs /usr/bin/rackdiag3 /usr/bin/rackdiag
sudo ln -vs /usr/bin/packetdiag3 /usr/bin/packetdiag

Environment

uname -srvpio
Linux 5.3.0-24-generic #26-Ubuntu SMP Thu Nov 14 01:33:18 UTC 2019 x86_64 x86_64 GNU/Linux
CDSoft commented 4 years ago

ok. I'll add test requirements in 2.13.2