Skip to content

Document build failed with the error "Build output directory for format "pdf" contains multiple files and it is not currently supported." #10015

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
TTYee opened this issue Feb 12, 2023 · 8 comments · Fixed by #10113
Assignees
Labels
Needed: more information A reply from issue author is required Support Support question

Comments

@TTYee
Copy link

TTYee commented Feb 12, 2023

I build my project document successfully before, but recently it failed with the error message "Build output directory for format "pdf" contains multiple files and it is not currently supported. Please, remove all the files but the "pdf" your want to upload. "
image

it seems like error occurred in this step:
image

I didn't find any method to solve this problem. Is there anyone who knows this problem? Thank u. T-T

@humitos
Copy link
Member

humitos commented Feb 13, 2023

Hi @TTYee! Can you provide the information asked in the template when you filled the form? (project URL, build URL, etc)

@humitos humitos added the Support Support question label Feb 13, 2023
@stsewd stsewd added the Needed: more information A reply from issue author is required label Feb 13, 2023
@GalaxySnail
Copy link

Cython has the same problem.

@humitos
Copy link
Member

humitos commented Feb 18, 2023

@GalaxySnail hi! Are you able to build the PDF locally using latexmk?

@GalaxySnail
Copy link

hi! Are you able to build the PDF locally using latexmk?

I haven't tried it. I'm running diff on these 2 logs:

diff -Nu <(curl https://readthedocs.org/api/v2/build/19395633.txt) <(curl https://readthedocs.org/api/v2/build/19423261.txt) | head -n 20
--- /proc/self/fd/11    2023-02-19 07:42:14.000000000 +0800
+++ /proc/self/fd/14    2023-02-19 07:42:14.000000000 +0800
@@ -1,18 +1,18 @@
 Read the Docs build information
-Build id: 19395633
+Build id: 19423261
 Project: cython
 Version: latest
 Commit: b24286d35aaaf1318cd2bebb10e3e16d72965a5b
-Date: 2023-02-06T17:21:37.353864Z
+Date: 2023-02-08T17:40:15.490385Z
 State: finished
-Success: True
+Success: False


-[rtd-command-info] start-time: 2023-02-06T17:21:38.926762Z, end-time: 2023-02-06T17:21:47.712146Z, duration: 8, exit-code: 0
+[rtd-command-info] start-time: 2023-02-08T17:40:17.041926Z, end-time: 2023-02-08T17:40:26.123477Z, duration: 9, exit-code: 0
 git clone --no-single-branch --depth 50 https://github.com/cython/cython .
 Cloning into '.'...

It looks like most of them are the same, latexmk was always failing, the only meaningful different is Success: True and Success: False. Then I checked previous logs, document build started to succeed since a year ago:

It seems that something changed in readthedocs.org, failed latexmk didn't cause the build to fail. However, it seems to be fixed recently, so the build starts failing again.

@humitos
Copy link
Member

humitos commented Feb 19, 2023

Can you try building the PDF locally?

@humitos
Copy link
Member

humitos commented Feb 20, 2023

I found this error is confusing our users in different ways. The real solution here would be to fail the build immediately when any of the PDF commands failed (#7884). Right now, we are just moving forward and then the users are receiving this unexpected and confusing messages.

These are other related issues as well:

I think it would be good to standardize this behavior to match with the rest of the commands.

@TTYee
Copy link
Author

TTYee commented Feb 20, 2023

@GalaxySnail Hi. I've found the PDF output is not neccessary for my project( I only need HTML output up to now). So I closed the "enable PDF build"(which is set by default) on the "advanced setup" page of our project then the project can be built successfully again. I mean, if PDF output is not neccessary for you either, you can try this method.
image

@GalaxySnail
Copy link

Can you try building the PDF locally?

Yes. It can reproduce locally, but I don't know why.

$ LC_ALL=C python -m sphinx -T -E -b latex -d _build/doctrees -D language=en . _readthedocs/pdf
expand output
Running Sphinx v6.1.3
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
building [mo]: targets for 0 po files that are out of date
writing output...
building [latex]: all documents
updating environment: [new config] 58 added, 0 changed, 0 removed
reading sources... [100%] src/userguide/wrapping_CPlusPlus
looking for now-outdated files... none found
pickling environment... done
checking consistency... D:\Documents\git\cython\docs\src\reference\interfacing_with_other_code.rst: WARNING: document isn't included in any toctree
D:\Documents\git\cython\docs\src\reference\limitations.rst: WARNING: document isn't included in any toctree
D:\Documents\git\cython\docs\src\reference\special_mention.rst: WARNING: document isn't included in any toctree
done
processing reference.tex... src/reference/index src/reference/compilation src/reference/special_methods_table
resolving references...
done
writing... done
processing tutorial.tex... src/tutorial/index src/tutorial/cython_tutorial src/tutorial/external src/tutorial/clibraries src/tutorial/cdef_classes src/tutorial/pxd_files src/tutorial/caveats src/tutorial/profiling_tutorial src/tutorial/strings src/tutorial/memory_allocation src/tutorial/embedding src/tutorial/pure src/tutorial/numpy src/tutorial/array src/tutorial/parallelization src/tutorial/readings src/tutorial/related_work src/tutorial/appendix
resolving references...
D:\Documents\git\cython\docs\src\tutorial\clibraries.rst:765: WARNING: Unparseable C cross-reference: 'void*'
Invalid C declaration: Expected identifier in nested name, got keyword: void [error at 4]
  void*
  ----^
D:\Documents\git\cython\docs\src\tutorial\clibraries.rst:839: WARNING: Unparseable C cross-reference: 'void*'
Invalid C declaration: Expected identifier in nested name, got keyword: void [error at 4]
  void*
  ----^
D:\Documents\git\cython\docs\src\tutorial\clibraries.rst:839: WARNING: Unparseable C cross-reference: 'void*'
Invalid C declaration: Expected identifier in nested name, got keyword: void [error at 4]
  void*
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:167: WARNING: Unparseable C cross-reference: 'char*'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char*
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:172: WARNING: Unparseable C cross-reference: 'char*'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char*
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:326: WARNING: Unparseable C cross-reference: 'char*'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char*
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:350: WARNING: Unparseable C cross-reference: 'std::string'
Invalid C declaration: Expected end of definition. [error at 3]
  std::string
  ---^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:479: WARNING: Unparseable C cross-reference: 'char'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:493: WARNING: Unparseable C cross-reference: 'char'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:493: WARNING: Unparseable C cross-reference: 'char'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:511: WARNING: Unparseable C cross-reference: 'char'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:511: WARNING: Unparseable C cross-reference: 'unsigned char'
Invalid C declaration: Expected identifier in nested name, got keyword: unsigned [error at 8]
  unsigned char
  --------^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:535: WARNING: Unparseable C cross-reference: 'long'
Invalid C declaration: Expected identifier in nested name, got keyword: long [error at 4]
  long
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:535: WARNING: Unparseable C cross-reference: 'unsigned long'
Invalid C declaration: Expected identifier in nested name, got keyword: unsigned [error at 8]
  unsigned long
  --------^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:535: WARNING: Unparseable C cross-reference: 'int'
Invalid C declaration: Expected identifier in nested name, got keyword: int [error at 3]
  int
  ---^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:616: WARNING: Unparseable C cross-reference: 'char*'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char*
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:653: WARNING: Unparseable C cross-reference: 'wchar_t*'
Invalid C declaration: Expected end of definition. [error at 7]
  wchar_t*
  -------^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:663: WARNING: Unparseable C cross-reference: 'Py_UNICODE*'
Invalid C declaration: Expected end of definition. [error at 10]
  Py_UNICODE*
  ----------^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:663: WARNING: Unparseable C cross-reference: 'char*'
Invalid C declaration: Expected identifier in nested name, got keyword: char [error at 4]
  char*
  ----^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:669: WARNING: Unparseable C cross-reference: 'Py_UNICODE*'
Invalid C declaration: Expected end of definition. [error at 10]
  Py_UNICODE*
  ----------^
D:\Documents\git\cython\docs\src\tutorial\strings.rst:689: WARNING: Unparseable C cross-reference: 'Py_UNICODE*'
Invalid C declaration: Expected end of definition. [error at 10]
  Py_UNICODE*
  ----------^
D:\Documents\git\cython\docs\src\tutorial\memory_allocation.rst:25: WARNING: term not in glossary: 'Heap allocation'
done
writing... done
copying images... [100%] src/tutorial/python_division.png
copying TeX support files... copying TeX support files...
done
build succeeded, 25 warnings.

The LaTeX files are in _readthedocs\pdf.
$ cd _readthedocs/pdf
$ cat latexmkrc
$latex = 'latex ' . $ENV{'LATEXOPTS'} . ' %O %S';
$pdflatex = 'pdflatex ' . $ENV{'LATEXOPTS'} . ' %O %S';
$lualatex = 'lualatex ' . $ENV{'LATEXOPTS'} . ' %O %S';
$xelatex = 'xelatex --no-pdf ' . $ENV{'LATEXOPTS'} . ' %O %S';
$makeindex = 'makeindex -s python.ist %O -o %D %S';
add_cus_dep( "glo", "gls", 0, "makeglo" );
sub makeglo {
 return system( "makeindex -s gglo.ist -o '$_[0].gls' '$_[0].glo'" );
}
$ latexmk -r latexmkrc -pdf -f -dvi- -ps- -jobname=cython -interaction=nonstopmode
Win CP console initial and current in/out Win: (936, 936), (936, 936)
Coding system for system and terminal: 'CP936'
---
Use of uninitialized value in concatenation (.) or string at (eval 10) line 1.
Use of uninitialized value in concatenation (.) or string at (eval 10) line 2.
Use of uninitialized value in concatenation (.) or string at (eval 10) line 3.
Use of uninitialized value in concatenation (.) or string at (eval 10) line 4.
Latexmk: A user -r option asked me to process an rc file an extra time.
   Name of file = 'latexmkrc'
   Abs. path = 'D:\Documents\git\cython\docs\_readthedocs\pdf\latexmkrc'
  I'll not process it
Rc files read:
  latexmkrc
Latexmk: This is Latexmk, John Collins, 17 Mar. 2022. Version 4.77, version: 4.77.

Latexmk: Need to specify at most one filename if jobname specified without a %A,
    but 2 were found (after defaults and wildcarding).
Use
   latexmk -help
to get usage information
C:\msys2\ucrt64\bin\runscript.tlu:915: command failed with exit code 10:
perl.exe c:\msys2\ucrt64\share\texmf-dist\scripts\latexmk\latexmk.pl -r latexmkrc -pdf -f -dvi- -ps- -jobname=cython -interaction=nonstopmode

I found this error is confusing our users in different ways. The real solution here would be to fail the build immediately when any of the PDF commands failed (#7884). Right now, we are just moving forward and then the users are receiving this unexpected and confusing messages.

Hi. I've found the PDF output is not neccessary for my project( I only need HTML output up to now). So I closed the "enable PDF build"(which is set by default) on the "advanced setup" page of our project then the project can be built successfully again. I mean, if PDF output is not neccessary for you either, you can try this method.

Thanks for the explanation. As a workaround, Cython has decided to stop building PDF docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: more information A reply from issue author is required Support Support question
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants