slatex / LaTeXML-Plugin-sTeX

A LaTeXML Plugin for Semantic LaTeX (sTeX)
LaTeX Project Public License v1.3c
2 stars 3 forks source link

trang is not properly detected #102

Closed cmaeder closed 8 years ago

cmaeder commented 8 years ago

Whenever I run lmh setup --update I get the following error message:

Entering /var/data/localmh/ext/LaTeXMLsTeX
Running Makefile.PL
Configuring /var/data/localmh/ext/LaTeXMLsTeX ... Can't exec "type": Datei oder Verzeichnis nicht gefunden at Makefile.PL line 14.

Trang is not found which could lead to a make failure.
You can ignore this message if you do not intend to change the schema.
See README for more info!

type trang returns "trang ist /usr/bin/trang" on my machine. type is a bash builtin command (try type type). Maybe which should be used.

angerhang commented 8 years ago

See there http://stackoverflow.com/questions/592620/check-if-a-program-exists-from-a-bash-script for a detailed discussion for why which should be avoided.

We have incorporated trang into our make install, however trang is not a hard prerequisite, and thus we throw out a non-blocking error message here. I am not entirely sure how things work in the docker, but it might just be lmh setup --update can't find type in the docker but type trang finds trang on your local machine which shouldn't be a problem.

If we really want, we can list trang as one of the dependencies when doing smh setup --update inside the docker so that this error will disappear.

cmaeder commented 8 years ago

I wonder why I get Can't exec "type":. Probably because type is not a binary and not a perl builtin (only a shell builtin)!

cmaeder commented 8 years ago

The easiest solution is to simply remove this non-working test.

cmaeder commented 8 years ago

Also note that bash type trang yields "bash: type: No such file or directory". So perl's shell invocation may not work as expected.

angerhang commented 8 years ago

Hmm I don't think we should remove this trang not found message though.

First the catcher only behaviors differently when we do an update in the docker.

Second we still want to have some kind of notifier to tell the users what is causing a potential make error during the installation, whenever they install this plugin locally, given trang is not installed.

angerhang commented 8 years ago

If we really have to remove the error catcher, what would be the motivation behind this other than it rises Can't exec "type": in the docker?

cmaeder commented 8 years ago

I'm simply saying either correct or remove the test in Makefile.PL (line 14: type trang) as it does not work under linux. I wonder why it works on MacOS (does it?).

kohlhase commented 8 years ago

no it does not. But you should keep in mind that Makefile.PL is generated

cmaeder commented 8 years ago

But you should keep in mind that Makefile.PL is generated

really? from what? (it is committed)

angerhang commented 8 years ago

It works in my VM too.

Are you sure this is not machine specific? screen shot 2016-05-10 at 9 03 01 pm

cmaeder commented 8 years ago

This works in the same way for me, it does not work from perl! (perl seems to call "bash type trang" and that does not work.)

cmaeder commented 8 years ago

Although which is not recommended for the bash shell, I believe it is the best choice for perl (assuming that which is far more likely available than trang).

angerhang commented 8 years ago

Yes yes you are right. @cmaeder

Just fixed it. Thanks for the report : )