Skip to content

Migrate pdf-doc build to meson #40597

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

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from

Conversation

tobiasdiez
Copy link
Contributor

@tobiasdiez tobiasdiez commented Aug 16, 2025

Migrate the pdf-doc building to meson. For this, a bug in the builder is fixed that prevented running Make against the sphinx-generated files when invoked via meson. Along the way, the output in case of an error of the make script is improved.

Generated pdfs can be found at https://github.com/sagemath/sage/actions/runs/17005745386/artifacts/3779209846.

📝 Checklist

  • The title is concise and informative.
  • The description explains in detail what this PR is about.
  • I have linked a relevant issue or discussion.
  • I have created tests covering the changes.
  • I have updated the documentation and checked the documentation preview.

⌛ Dependencies

Copy link

github-actions bot commented Aug 16, 2025

Documentation preview for this PR (built with commit 62a9bfd; changes) is ready! 🎉
This preview will update shortly after each push to this PR.

@tobiasdiez tobiasdiez mentioned this pull request Aug 16, 2025
5 tasks
@user202729
Copy link
Contributor

user202729 commented Aug 16, 2025

this still doesn't reenable live doc, no?

remark: it doesn't speed up the build (understandable, since most of the time are spent on running lualatex)

@tobiasdiez
Copy link
Contributor Author

this still doesn't reenable live doc, no?

I didn't touch the live docs here, and leave this to #40586.

remark: it doesn't speed up the build (understandable, since most of the time are spent on running lualatex)

There could be some speed gains if we convince sphinx to export a dep file (maybe similar to https://gitlab.com/qemu-project/qemu/-/blob/master/docs/sphinx/depfile.py?ref_type=heads) so that meson can watch the source files for each doc target and then incrementally rebuild the docs. That should be faster than sphinx' incrementally rebuild logic.

@user202729
Copy link
Contributor

that may not be necessary, the bottleneck is still in latexmk.

TeX's dependency tracker is quite fickle, I don't think we will ever be able to make a meson replacement for latexmk. But either way, likely out of scope here.

(latexmk's incremental tracking is not 100% correct either, but better than nothing.)

@tobiasdiez
Copy link
Contributor Author

Right, the idea with depfile was also more for the html build. Honestly, I don't care about the pdf. I think the website is fully sufficient and only a handful of people are actually looking at those pdfs. The only real purpose is to catch latex errors...

@tobiasdiez tobiasdiez requested a review from dimpase August 17, 2025 00:51
vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 17, 2025
sagemathgh-40597: Migrate pdf-doc build to meson
    
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Migrate the pdf-doc building to meson. For this, a bug in the builder is
fixed that prevented running Make against the sphinx-generated files
when invoked via meson. Along the way, the output in case of an error of
the make script is improved.

Generated pdfs can be found at https://github.com/sagemath/sage/actions/
runs/17005745386/artifacts/3779209846.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->
    
URL: sagemath#40597
Reported by: Tobias Diez
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 17, 2025
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Migrate the pdf-doc building to meson. For this, a bug in the builder is
fixed that prevented running Make against the sphinx-generated files
when invoked via meson. Along the way, the output in case of an error of
the make script is improved.

Generated pdfs can be found at https://github.com/sagemath/sage/actions/
runs/17005745386/artifacts/3779209846.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

URL: sagemath#40597
Reported by: Tobias Diez
Reviewer(s):
vbraun pushed a commit to vbraun/sage that referenced this pull request Aug 17, 2025
<!-- ^ Please provide a concise and informative title. -->
<!-- ^ Don't put issue numbers in the title, do this in the PR
description below. -->
<!-- ^ For example, instead of "Fixes sagemath#12345" use "Introduce new method
to calculate 1 + 2". -->
<!-- v Describe your changes below in detail. -->
<!-- v Why is this change required? What problem does it solve? -->
<!-- v If this PR resolves an open issue, please link to it here. For
example, "Fixes sagemath#12345". -->

Migrate the pdf-doc building to meson. For this, a bug in the builder is
fixed that prevented running Make against the sphinx-generated files
when invoked via meson. Along the way, the output in case of an error of
the make script is improved.

Generated pdfs can be found at https://github.com/sagemath/sage/actions/
runs/17005745386/artifacts/3779209846.

### 📝 Checklist

<!-- Put an `x` in all the boxes that apply. -->

- [ ] The title is concise and informative.
- [ ] The description explains in detail what this PR is about.
- [ ] I have linked a relevant issue or discussion.
- [ ] I have created tests covering the changes.
- [ ] I have updated the documentation and checked the documentation
preview.

### ⌛ Dependencies

<!-- List all open PRs that this PR logically depends on. For example,
-->
<!-- - sagemath#12345: short description why this is a dependency -->
<!-- - sagemath#34567: ... -->

URL: sagemath#40597
Reported by: Tobias Diez
Reviewer(s):
@tobiasdiez tobiasdiez mentioned this pull request Aug 18, 2025
5 tasks
@user202729
Copy link
Contributor

maybe you should merge latest develop first (PDF build only starts failing there).

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

Successfully merging this pull request may close these issues.

2 participants