-
Notifications
You must be signed in to change notification settings - Fork 924
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
Use meson to generate docs (html + pdf) #15169
base: master
Are you sure you want to change the base?
Conversation
79ec17b
to
707a2c7
Compare
b2186d3
to
01ee2c5
Compare
Pull Request Test Coverage Report for Build 13394452463Details
💛 - Coveralls |
01ee2c5
to
379b8d7
Compare
efb47e3
to
112d834
Compare
The Meson docs are not a fan of this method, but maintaining that list by hand is too much work and error prone. This does mean that adding existing .rst file to the docs will not be picked up by the dependency checking until you re-setup your build dir.
meson.build
Outdated
find_rst_files = run_command(['find', docs_dir, '-name', '*.rst']) | ||
rst_files = find_rst_files.stdout().strip().split('\n') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This won't be updated when new files are added. The QEMU project faced this challenge already, and wrote a neat trick to solve it:
https://gitlab.com/qemu-project/qemu/-/blob/master/docs/sphinx/depfile.py
This allows you to use depfile: ...
and have sphinx report what files it used and which should trigger further rebuilds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I mentioned the drawback in the commit message. I'll look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Meson isn't a fan of this run_command method... because it's better done by depfiles any time you don't explicitly need the input files as command line arguments! :)
(When you do need them as command-line arguments, for example with executable()
sources, I tend to recommend running a generator script as a pre-commit hook, then using fs.read('sources.list').strip().split('\n')
instead. fs.read
will produce reconfigure dependencies, much like an automake include.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, the depfile (sphinx.d) is removed by nija after generating
it as shown by a trace. I do not know why, but touching an .rts
file has the correct behaviour. So I suspoect it is an optimization.
--> ninja -d list
debugging modes:
[...]
keepdepfile don't delete depfiles after they're read by ninja
We use depfiles for all *.o outputs as well. Ninja reads them in after the command finishes for build nodes that declare they provide depfiles, and compiles them into a binary database (.ninja_deps
) for, as you guessed, optimization purposes. No need to read tons of tiny files in on every startup. :)
Hence also why keeping the file around is one of the options exposed in the debugging modes. Though, I don't know why it is necessary to delete them after reading them, but maybe the ninja authors figured the file is useless after reading it, so might as well compact the build directory size a tiny bit.
… file, as suggested by @eli-schwart in PowerDNS#15169 (comment) Actually, the depfile (sphinx.d) is removed by nija after generating it as shown by a trace. I do not know why, but touching an .rts file has the correct behaviour. So I suspoect it is an optimization.
… file, as suggested by @eli-schwart in PowerDNS#15169 (comment) Actually, the depfile (sphinx.d) is removed by ninja after generating it as shown by a trace. I do not know why, but touching an .rst file has the correct behaviour. So I suspect it is an optimization.
1314b45
to
7ffce91
Compare
0e089fe
to
fe1a594
Compare
Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Short description
Same script used for rec, auth and dnsdist docs. All meson.build file gain a few new targets:
html_docs
,html-docs.tar.bz2
andproduct-name.pdf
and a do all calledall-docs
.To test run
meson compile -C builddir *target*
.Note that generating a pdf needs latex. The meson script does not check for that atm.
TODO:
generating doc sources(bythese file are actually in git, so no need to generate themdnsdist-rust-lib/dnsdist-settings-documentation-generator.py
) for dnsdist (seeMakefile.am
indnsdist-rust-lib
)Checklist
I have: