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

pickling issues building sage-doc-9999 with use=doc-pdf and all available LANGS #681

Open
strogdon opened this issue Feb 28, 2022 · 12 comments

Comments

@strogdon
Copy link
Contributor

The most pressing situation seems to be on Prefix although I occasionally have issues on Gentoo. The pickling issues are similar to #667 (comment) when building the standard sage-doc-9999. Doing

emake doc-html PYTHON=${PYTHON}

seems to work and

emake doc-pdf PYTHON=${PYTHON}

also appears to work. This latter case appears to build some html stuff under html/en. The following

emake doc-html PYTHON=${PYTHON} && emake doc-pdf PYTHON=${PYTHON}

fails with

MAKE=make /storage/strogdon/gentoo-rap/usr/bin/python3.10 -m sage_docbuild reference/spkg pdf --no-prune-empty-dirs
[tensor_fr] dumping search index in English (code: en)... done
[tensor_fr] The HTML pages are in ../../../build_doc/html/en/reference/tensor_free_modules.
Build finished. The built documents can be found in /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-doc-9999/work/build_doc/html/en/reference/tensor_free_modules
MAKE=make /storage/strogdon/gentoo-rap/usr/bin/python3.10 -m sage_docbuild reference/manifolds pdf --no-prune-empty-dirs
Error building the documentation.
Traceback (most recent call last):
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/sage_docbuild/__main__.py", line 2, in <module>
    main()
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/sage_docbuild/__init__.py", line 1745, in main
    builder()
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/sage_docbuild/__init__.py", line 247, in pdf
    self.latex()
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/sage_docbuild/__init__.py", line 776, in _wrapper
    for module_name in self.get_new_and_updated_modules():
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/sage_docbuild/__init__.py", line 946, in get_new_and_updated_modules
    env = self.get_sphinx_environment()
  File "/storage/strogdon/gentoo-rap/usr/lib/python3.10/site-packages/sage_docbuild/__init__.py", line 843, in get_sphinx_environment
    env = pickle.load(f)
_pickle.UnpicklingError: pickle data was truncated

    Note: incremental documentation builds sometimes cause spurious
    error messages. To be certain that these are real errors, run
    "make doc-clean doc-uninstall" first and try again.
[repl     ] dumping search index in English (code: en)... done
[repl     ] The HTML pages are in ../../../build_doc/html/en/reference/repl.
Build finished. The built documents can be found in /storage/strogdon/gentoo-rap/var/tmp/portage/sci-mathematics/sage-doc-9999/work/build_doc/html/en/reference/repl

The point where the failure occurs is not predictable. So far I have been unable to build html + pdf docs for 9.6.beta3 on Prefix.

@kiwifb
Copy link
Collaborator

kiwifb commented Feb 28, 2022

I had to build at -j6 instead of -j8 with just two languages. But I squarely got a #667 (comment) kind of issue. The case that give errors would be the standard vanilla procedure. Default make produces html doc and then you have to do make doc-pdf to get the pdf, although there is probably a way to request it from the top.

I am assuming that what I put in which should be make doc-html doc-pdf doesn't work either?

@strogdon
Copy link
Contributor Author

Yes, when I do the make doc-html doc-pdf I get the #667 (comment) kind of issue. Not sure why the make doc-html and then make doc-pdf fails. I googled the pickle error above and it may appear when a pickle is empty.

@kiwifb
Copy link
Collaborator

kiwifb commented Feb 28, 2022

It is just another kind of parallel make issue where a task starts before the necessary previous one has ended. But where to tweak?

@strogdon
Copy link
Contributor Author

It appears that when one does make doc-html and then make doc-pdf that some html stuff (html/en) is rebuilt. I don't think this should be the case. Shouldn't the make process know the html/en is up to date and thus not rebuild it. Maybe they are different make processes. FWIW I do have an 8-core machine with MAKEOPTS="-j9" where sage-doc-9999 built just fine.

@kiwifb
Copy link
Collaborator

kiwifb commented Feb 28, 2022

Indeed some bits of html are rebuilt and in an ideal world they shouldn't. make does look for files as targets, when they are more abstract like it is the case here you can have those kind of issues. In fact in an ideal world running make doc-html would just check a number of files are present and do nothing. This is not the case at present. If we had a clear file as a final target we could avoid that kind of re-build.

@strogdon
Copy link
Contributor Author

strogdon commented Mar 1, 2022

The host of the prefix has 8 cores. I'm only able to get sage-doc-9999 to build serially, -j1. It's very tedious.

@kiwifb
Copy link
Collaborator

kiwifb commented Mar 1, 2022

Sounds seriously tough. I really need to bring back pre-build doc in stable if we cannot fix or mitigate that.

@kiwifb
Copy link
Collaborator

kiwifb commented Mar 1, 2022

Latest merge on the vbraun branch from 6 hours ago, doesn't have anything about sage_docbuild or sage-doc, and it just build the doc like there was no problems. Unlike the previous merge which would have been identical to 9.6.beta3.

@strogdon
Copy link
Contributor Author

strogdon commented Mar 6, 2022

Some thoughts. When USE=doc-pdf, in src/doc/Makefile remove respectively, doc-inventory-reference and doc-html-reference from the targets doc-pdf-reference and doc-pdf-other and build the docs as

emake doc-html PYTHON=${PYTHON} && emake doc-pdf PYTHON=${PYTHON}

then each component html and pdf builds in parallel - html first and pdf next. Not strictly in parallel but it does build on the Prefix.

@kiwifb
Copy link
Collaborator

kiwifb commented Mar 8, 2022

Got hit on the latest vbraun merge. '-j8' unknown character, '-j6' 'FileNotFoundError'. So, I am going to try what you are suggesting in your latest message to see if things improve.

@kiwifb
Copy link
Collaborator

kiwifb commented Mar 8, 2022

571d34b helped. At a cost of 2 minutes of build time (15mn instead of 13) probably a bargain. It is not exactly pleasant in my opinion but it may have to do for now.

@strogdon
Copy link
Contributor Author

strogdon commented Mar 9, 2022

One machine where sage-doc-9999 from the overlay built. Two machines, one the subject Prefix, needed the fix to build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants