OpenTechStrategies / open-source-archetypes

A field guide to open source project archetypes
https://opentechstrategies.com/archetypes
Other
95 stars 12 forks source link

Does the PDF currently build? #18

Open brainwane opened 4 years ago

brainwane commented 4 years ago

Referring to https://github.com/OpenTechStrategies/ots-doctools/issues/9 .

brainwane commented 2 years ago

I just set up ots-doctools on a machine where it previously had not been installed, cloned the archetypes repo, and then tried to build this PDF, and it did not work. It seems like inkscape is a plugin or dependency that isn't listed in the requirements?

$ make open-source-archetypes.pdf
Traceback (most recent call last):
  File "/home/sumanah/Documents/ots-doctools/pipeline/pipeline.py", line 158, in <module>
    cli()
  File "/usr/lib/python3/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/sumanah/Documents/ots-doctools/pipeline/pipeline.py", line 139, in cli
    if m.run_p(text, meta):
  File "/home/sumanah/Documents/ots-doctools/pipeline/plugins/15_inkscape_version_fix.py", line 27, in run_p
    version_str = subprocess.check_output(["inkscape", "--version"]).decode("utf-8") 
  File "/usr/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 493, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'inkscape'
make[1]: *** [/home/sumanah/Documents/ots-doctools/Makefile:77: open-source-archetypes.pdf] Error 1
make: *** [Makefile:23: open-source-archetypes.pdf] Error 2

cc'ing @francois90 per https://github.com/OpenTechStrategies/ots-doctools/issues/9 .

choeppler commented 2 years ago

I ran into the same issue a short while ago. On an ubuntu box installing inkscape via sudo apt install inkscape fixed that issue.

brainwane commented 2 years ago

Thanks @choeppler. I installed Inkscape and then tried make again and ran into a different issue:

$ make open-source-archetypes.pdf
Gtk-Message: 22:48:25.394: Failed to load module "canberra-gtk-module"
/home/sumanah/Documents/ots-doctools/pipeline/plugins/60_clean_refs.py:26: FutureWarning: Possible nested set at position 1
  pat = re.compile(meta.get("ref_regex", "[[(]*ref:[0-9a-f]+[])]*"))
Latexmk: This is Latexmk, John Collins, 26 Dec. 2019, version: 4.67.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -halt-on-error -shell-escape -recorder  "open-source-archetypes.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./open-source-archetypes.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>

! LaTeX Error: File `otsreport.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name: 

! LaTeX Error: File `ots.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

! LaTeX Error: File `ots-sectioning.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty))

! LaTeX Error: File `setspace.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

! LaTeX Error: File `ragged2e.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

! LaTeX Error: File `xcolor.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

! LaTeX Error: Unknown option `table' for package `xcolor'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.22 \definecolor
                 {tableheader}{rgb}{0.63, 0.79, 0.95}
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on open-source-archetypes.log.
=== TeX engine is 'pdfTeX'
Latexmk: Missing input file: 'otsreport.cls' from line
  '! LaTeX Error: File `otsreport.cls' not found.'
Latexmk: Missing input file: 'ots.sty' from line
  '! LaTeX Error: File `ots.sty' not found.'
Latexmk: Missing input file: 'ots-sectioning.sty' from line
  '! LaTeX Error: File `ots-sectioning.sty' not found.'
Latexmk: Missing input file: 'setspace.sty' from line
  '! LaTeX Error: File `setspace.sty' not found.'
Latexmk: Missing input file: 'ragged2e.sty' from line
  '! LaTeX Error: File `ragged2e.sty' not found.'
Latexmk: Missing input file: 'xcolor.sty' from line
  '! LaTeX Error: File `xcolor.sty' not found.'
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1
      Refer to 'open-source-archetypes.log' for details
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs, or warnings treated as errors.
make[1]: *** [/home/sumanah/Documents/ots-doctools/Makefile:81: open-source-archetypes.pdf] Error 12
make: *** [Makefile:23: open-source-archetypes.pdf] Error 2

For each "not found." error I hit Enter; advice welcome.

choeppler commented 2 years ago

Did you install ots-doctools as described here: https://github.com/OpenTechStrategies/ots-doctools#installation ? Some of the errors indicate that TEXMFHOME might not have been set correctly...

brainwane commented 2 years ago

@choeppler I believe I did.

My .bashrc includes:

# OTS doctools per https://github.com/OpenTechStrategies/ots-doctools
OTS_DOCTOOLS_DIR=${HOME}/Documents/ots-doctools
export OTS_DOCTOOLS_DIR

TEXMFHOME=${HOME}/texmf
export TEXMFHOME

and the ~/texmf directory exists, and I believe I have set up the alias properly:

~$ ls -lah texmf/tex/latex/
total 12K
drwxrwxr-x 3 sumanah sumanah 4.0K Jan 28 21:22 .
drwxrwxr-x 3 sumanah sumanah 4.0K Jan 28 21:21 ..
drwxrwxr-x 2 sumanah sumanah 4.0K Jan 28 21:22 dummy
lrwxrwxrwx 1 sumanah sumanah   28 Jan 28 21:22 ots -> Documents/ots-doctools/latex
brainwane commented 2 years ago

Even if I manually tell make where otsreport.cls is, it still gets hung up on wanting setspace.sty which I think isn't already installed.

~/Documents/open-source-archetypes$ make open-source-archetypes.pdf
Gtk-Message: 12:26:16.535: Failed to load module "canberra-gtk-module"
/home/sumanah/Documents/ots-doctools/pipeline/plugins/60_clean_refs.py:26: FutureWarning: Possible nested set at position 1
  pat = re.compile(meta.get("ref_regex", "[[(]*ref:[0-9a-f]+[])]*"))
Latexmk: This is Latexmk, John Collins, 26 Dec. 2019, version: 4.67.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -halt-on-error -shell-escape -recorder  "open-source-archetypes.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./open-source-archetypes.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>

! LaTeX Error: File `otsreport.cls' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: cls)

Enter file name: /home/sumanah/Documents/ots-doctools/latex/otsreport.cls
(/home/sumanah/Documents/ots-doctools/latex/otsreport.cls
Document Class: otsreport 
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)

! LaTeX Error: File `setspace.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name:

I ran a find . -iname setspace.sty and couldn't find any on my machine. Based on https://github.com/OpenTechStrategies/ots-doctools/blob/10036842f86ad1269deff9f059d1c11e055ff011/latex/ots.sty#L46 this may be something I have to install separately?

choeppler commented 2 years ago

You are missing some packages in your latex distribution. E.g., if you're on ubuntu, you could fix this by installing texlive-latex-recommended (and possibly other apt packages), which includes both setspace.sty, and xcolor.sty, the latter of which was mentioned in an error message you posted earlier.

As for the problem that pdflatex doesn't find otsreport.cls: I believe it's a dangling symbolic link (the relative path it points to currently does not exist). Something along the lines below (untested!) should fix that:

~$ cd texmf/tex/latex/
~$ ls -lha ots
lrwxrwxrwx 1 sumanah sumanah   28 Jan 28 21:22 ots -> Documents/ots-doctools/latex
~$ rm ots
~$ ln -s ${HOME}/Documents/ots-doctools/latex ots
kfogel commented 2 years ago

Thanks, @choeppler, for the responses, and @brainwane did you get the build working on your machine?

brainwane commented 2 years ago

I installed texlive-latex-recommended and I tried the symbolic link fix that @choeppler mentioned, and updated the git repositories both for this repo and for ots-doctools, and now the error is different, indicating that I am missing textpos.sty and comment.sty. I did a little searching and couldn't easily tell what additional apt packages I ought to install. Log below:

~/Documents/open-source-archetypes$ make open-source-archetypes.pdf
Gtk-Message: 18:52:11.281: Failed to load module "canberra-gtk-module"
/home/sumanah/Documents/ots-doctools/pipeline/plugins/60_clean_refs.py:26: FutureWarning: Possible nested set at position 1
  pat = re.compile(meta.get("ref_regex", "[[(]*ref:[0-9a-f]+[])]*"))
Latexmk: This is Latexmk, John Collins, 26 Dec. 2019, version: 4.67.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'pdflatex  -halt-on-error -shell-escape -recorder  "open-source-archetypes.tex"'
------------
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Debian) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
(./open-source-archetypes.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/home/sumanah/texmf/tex/latex/ots/otsreport.cls
Document Class: otsreport 
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texlive/texmf-dist/tex/latex/setspace/setspace.sty)

! LaTeX Error: File `comment.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def)
(/usr/share/texlive/texmf-dist/tex/latex/colortbl/colortbl.sty
(/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty)))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)))

! LaTeX Error: File `textpos.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 

! LaTeX Error: Unknown option `absolute' for package `textpos'.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              

l.38 \setlength
               {\TPHorizModule}{30mm}
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on open-source-archetypes.log.
=== TeX engine is 'pdfTeX'
Latexmk: Missing input file: 'comment.sty' from line
  '! LaTeX Error: File `comment.sty' not found.'
Latexmk: Missing input file: 'textpos.sty' from line
  '! LaTeX Error: File `textpos.sty' not found.'
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1
      Refer to 'open-source-archetypes.log' for details
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs, or warnings treated as errors.
make[1]: *** [/home/sumanah/Documents/ots-doctools/Makefile:81: open-source-archetypes.pdf] Error 12
make: *** [Makefile:23: open-source-archetypes.pdf] Error 2
kfogel commented 2 years ago

Hmmm. @brainwane, can you give details of your operating system, TeX-related packages & versions, and anything else that seems like it might be relevant?

(What I'm trying to do is disentagle the "set of default TeX packages that I always have installed on my machines anyway, and that therefore are part of the ambient environment, and that therefore I don't even realize need to be specified when documenting build dependencies" from "set of TeX packages we should specify as required here".)

kfogel commented 2 years ago

@brainwane https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=420591 and https://tex.stackexchange.com/questions/291066/problem-uploading-packages are what I'm looking at right now, since you seem to be on Debian.

If you do apt-get update && apt-get install texlive, does it tell you that everything about texlive is already up-to-date?