Skip to content
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

make html && make latexpdf fails with: *** No rule to make target 'all-pdf'. Stop. #10903

Closed
marxin opened this issue Oct 8, 2022 · 6 comments

Comments

@marxin
Copy link
Contributor

marxin commented Oct 8, 2022

Describe the bug

It's caused by my b1390c4 where now the following happens:

$ make clean ; make html  SPHINXBUILD=~/bin/venv/bin/sphinx-build && make latexpdf SPHINXBUILD=~/bin/venv/bin/sphinx-build
...
Running LaTeX files through pdflatex...
make LATEXMKOPTS="-interaction=nonstopmode -f" -C _build/latex all-pdf
make[1]: Entering directory '/home/marxin/Programming/texi2rst-generated/sphinx/gdc/_build/latex'
make[1]: *** No rule to make target 'all-pdf'.  Stop.
make[1]: Leaving directory '/home/marxin/Programming/texi2rst-generated/sphinx/gdc/_build/latex'
make: *** [Makefile:58: latexpdf] Error 2

Where _build/latex/ is an empty directory. Is there anything I forgot to change in the aforementioned commit or should I revert it?
@AA-Turner

How to Reproduce

See steps above.

Expected behavior

No response

Your project

Sphinx

Screenshots

No response

OS

Linux

Python version

3.10

Sphinx version

master

Sphinx extensions

No response

Extra tools

No response

Additional context

No response

@jfbu jfbu added this to the 5.3.0 milestone Oct 9, 2022
@jfbu jfbu added the builder label Oct 9, 2022
@jfbu
Copy link
Contributor

jfbu commented Oct 9, 2022

You can see same phenomenon emitting three successive commands in your shell:

  • make clean
  • make html
  • make man
    Then _build/man is actually empty and man build did not happen.

I did not investigate why but if last step is replaced by make text, the _build/text/index.txt is created. But make texinfo behaves like make latex or make man: nothing in the corresponding build directories appears.

I am not familiar enough with builders/__init__.py, but indeed this commit should be reverted or problem fixed prior to release, naturally. I marked it as regression but it has not yet made it to a release... only to stamp it as a "must-fix" issue ;-)

@jfbu
Copy link
Contributor

jfbu commented Oct 9, 2022

I did not investigate why but if last step is replaced by make text

It appears to_build in build_update() from builders/__init__.py is then a generator not a string and list(to_build) produces the list ['index'] and not ['__all__'] so the b1390c4 logic does not inhibit the build process then.

@marxin
Copy link
Contributor Author

marxin commented Oct 10, 2022

All right, so it's likely related to the fact the some builders don't inform about outdated docs and they rather return a string which means effectively a rebuild:

def get_outdated_docs(self) -> Union[str, List[str]]:
return 'all manpages' # for now

def get_outdated_docs(self) -> Union[str, List[str]]:
return 'all documents' # for now

That said, one can't effectively distinguish when a rebuild is needed or not. Thus I'm going to revert my commit.

On the other hand, HTML has a more fine-grained control over the outdated docs:

def get_outdated_docs(self) -> Iterator[str]:
try:
with open(path.join(self.outdir, '.buildinfo'), encoding="utf-8") as fp:
buildinfo = BuildInfo.load(fp)
if self.build_info != buildinfo:
logger.debug('[build target] did not match: build_info ')
yield from self.env.found_docs
return
except ValueError as exc:
logger.warning(__('Failed to read build info file: %r'), exc)
except OSError:
# ignore errors on reading
pass

marxin added a commit to marxin/sphinx that referenced this issue Oct 10, 2022
This reverts commit b1390c4.

The change is reverted because some Builders don't have
a more fine-grained support for outdated docs:
sphinx-doc#10903 (comment)
marxin added a commit to marxin/sphinx that referenced this issue Oct 10, 2022
This reverts commit b1390c4.

The change is reverted because some Builders don't have
a more fine-grained support for outdated docs:
sphinx-doc#10903 (comment)

Fixes: sphinx-doc#10903.
@AA-Turner
Copy link
Member

I wonder if the right fix here is ensuring a consistent contract in get_outdated_docs? I'll merge the revert though for now.

A

AA-Turner pushed a commit that referenced this issue Oct 13, 2022
This reverts commit b1390c4.

The change is reverted because some builders don't have
fine-grained support for outdated docs:
#10903 (comment)
@marxin
Copy link
Contributor Author

marxin commented Oct 13, 2022

I wonder if the right fix here is ensuring a consistent contract in get_outdated_docs?

I hope so, though I'm not familiar enough with the code.

@floam
Copy link

floam commented Oct 28, 2022

It'd sure be nice if the manpages didn't have to rebuild each time.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants