-
Notifications
You must be signed in to change notification settings - Fork 895
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
yosys docs vs. downstream distro-package maintainability #4725
Comments
Firstly, thanks for your work maintaining the Fedora package! I didn't actually expect the pdf version of the docs to download the status badges at compile time, and should probably be html only. I will look into that and hopefully make your patch unnecessary :) When we switched to using the Furo-ys fork there was a discussion about whether or not we want to maintain a pypi package but this was decided against since the fork is really only intended for YosysHQ use for consistent branding and reducing code duplication across our various projects. However most of that is focused on the html version of the docs used for the readthedocs. My suggestion would be to ignore furo-ys completely. I believe Furo only affects the html theming ( One other thing I will note is that |
If you want to modify the |
Thanks for the quick reply! I am indeed only concerned with the ability to build the pdf manual in an isolated, off-line container (I was going to ask if picking some other format besides pdf would be a better option, but glad to hear pdf is still your recommendation :) Right now, my command line is:
(note: as mentioned earlier, The error I get is this:
I'll have to study the sources and build scripts (and probably acquire some sort of superficial familiarity with sphinx) to get to the bottom of how I could express that "furo-ys shouldn't be required/expected when Also thanks in advance for looking into the badges (not) being pulled in while Best, |
oh, based on your earlier suggestions I'm experimenting with something along these lines:
I'll see if this takes care of things for me, then I'll ask you if it's something you might find palatable for the general case... :D |
I would probably suggest something like the following try:
from furo_ys.lexers.YoscryptLexer import YoscryptLexer
app.add_lexer("yoscrypt", YoscryptLexer)
except ModuleNotFoundError:
from pygments.lexers.special import TextLexer
app.add_lexer("yoscrypt", TextLexer) The |
Thanks, that worked perfectly. I guess you don't need me to put in a PR anymore (but LMK if there's some workflow related reason why that might still be helpful) |
This is mainly intended for (latex)pdf builds which do not use the furo-ys html theme, where the yosys script syntax highlighting can safely fallback to plaintext. This effectively makes `furo-ys` an optional dependency to simplify distro-package maintainability. See also #4725.
Do you know if there are any common environment variables that are used during package builds like this? Ideally something not Fedora specific. Or would a yosys specific flag be better? I am looking for something that would fit in the following code before the final Lines 47 to 61 in 3afb772
|
I haven't stared at
With any luck, one of those might make sense... |
I'm rather confused by this. All of the places that reference the badge svg images are in |
When I don't patch out badge svg references, running The main "highlight" is a bunch of entries similar to this:
I might be missing some environment setting that would bypass badge downloading (or otherwise be doing something silly on my end :) ) but as of right now (commit b89bd02) I can't build the pdf manual unless I explicitly remove badge references. |
Hi @KrystalDelusion,
I think I figured out why my pdf build is failing. The So you're right in that it could build the pdf without first downloading the badges, but the makefile itself gives up when EDIT: if I blank out EDIT 2: so, in conclusion, my doc build command line should be:
which would allow the pdf build to succeed without needing to patch out the badge references. Mystery solved :D Of course, if you think there's a more elegant way around this, please LMK. |
Are you sure the warning is for the SVG badges? I don't get any warnings locally when I run If it is the |
On Thu, Nov 21, 2024 at 08:26:18AM -0800, KrystalDelusion wrote:
Are you sure the warning is for the SVG badges? I don't get any warnings
locally when I run make latexpdf from the docs directory, but I'm not using
ABCEXTERNAL and I noticed your patch also removes the inclusion of yosys-abc
Any warning encountered by $(SPHINXBUILD) at
https://github.com/YosysHQ/yosys/blob/main/docs/Makefile#L143
results in make quitting (due to sphinx-build returning non-zero, even
if told to `--keep-going` in conjunction with `-W`, at least in my
environment).
If I patch out the include of `/generated/yosys-abc` in
docs/source/appendix/auxprogs.rst, it still fails due to warnings
about badges.
So far, the only way to build latexpdf successfully from within the
fedora "mock" rpm build container was to clear SPHINXOPTS (i.e.,
remove `-W`). I assume the result is identical to when I patch out
inclusion of `generated/yosys-abc` and badges, but I haven't actually
looked at the resulting pdf yet :)
|
Link to page
http://mirror.ini.cmu.edu/0003-fedora-yosys-doc-offline-patch.patch
Build number
a66e94c ("Docs: Switch to furo-ys")
Issue
Hi,
I maintain the yosys package in Fedora, and I'm running into a bit of trouble building the documentation portion of the package.
As you may be aware, distro-packaging requires the assumption of everything being available for an offline build at compile time (i.e., fetching things from a live internet server during build via e.g. wget or curl is forbidden). Also, bundling other existing packages is (heavily) frowned upon.
Side note: since yosys is the primary "consumer" of abc, we were able to justify packaging the yosys fork of abc in Fedora instead of the "true" upstream one, so that's one bullet dodged, but now I'm running into trouble with the documentation portion of the package:
First, I had to patch out the various
badge.svg
images which are fetched directly over the Internet during build time (this is the patch I'm applying for reference). So far, so good (the resulting pdf file may look a bit rough as a result, but the important content is still there).However, with commit
a66e94c5d
("Docs: Switch to furo-ys") I'm finally finding myself in a bit of a pickle.Normally, python dependencies should be their own .rpm package, and funny enough, there's a
python3-furo
RPM already in the Fedora repositories. Unfortunately, use of thefuro_ys
fork presents a challenge for distro-packaging yosys:since the docs are shipped as part of the package, they should be built from source; side-loading a pdf doc file built elsewhere violates at least the spirit, if not the letter as well, of the Fedora packaging guidelines
since building the docs now depends on
furo-ys
, that should come as its own RPM (and the "standard" furo actually does, but here we're using a fork, and this time I can't argue that the standard package should be replaced with furo-ys :(I could try to bundle furo-ys sources with the yosys source RPM, build it, install it and then use it during
make docs
portion of building yosys, but at this point things start to look rather contrived, and doing any more of this sort of thing would quickly become unsustainableI'm wondering if there's another way that would ease downstream distro packaging without imposing too much additional hardship on maintaining the upstream documentation (e.g. limiting/eliminating "live" dependencies fetched over the network at build time, and also limiting/eliminating forked/bundled dependencies as much as possible) -- to the extent that downstream packages are considered useful by upstream maintainers.
Any ideas or advice much appreciated!
Thanks,
--Gabriel
Expected
No response
The text was updated successfully, but these errors were encountered: