-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
sageWithDoc: fix documentation index #189776
Conversation
Unfortunately, aarch64 is still completely borked and I have no clue how to debug it (there's more about it on https://trac.sagemath.org/ticket/34297). This is pre-existing, though. |
Thanks @collares! Is there an easy way I can check this? I don't know anything about nix apart from simple |
09fb31c
to
382129c
Compare
@aikrahguzar If you don't mind waiting for a while as Sage gets built (on your machine) by Nix, you can run |
+ css_file = os.path.join(app.builder.outdir, '_static', 'plot_directive.css') | ||
+ try: | ||
+ os.chmod(css_file, 0o644) | ||
+ except: |
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.
Note that the above try
/except
is just for future-proofing. All os.chmod
calls introduced by my patch succeed as of Sage 9.6.
I tried this and I can confirm that I get a full index now. Thanks a lot! |
382129c
to
13d2eda
Compare
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.
Thanks @collares, great work as always :)
Description of changes
Since basically forever, Sage docbuilding on Nix generates harmless errors of the following form:
This happens because the matplotlib Sphinx extension copies a CSS file from the Nix store to
reference/SUBDIR/_static
using Python'sshutil.copy
, resulting in a read-only file. Because Sage docbuilding symlinksreference/SUBDIR/_static
toreference/_static
, the copying effectively happens multiple times, and therefore we get a "Permission denied" error for all but one of the 78reference/
subdirectories.Sage builds docs in two passes for parallelism: Subdirectories are built separately, and then a second pass stitches them together by looking at some state files (
environment.pickle
in particular) created by Sphinx in each of the documentation subdirectories. Sphinx deletes these state files if the build fails, but functions registered as "build-finished" callbacks are an interesting gray area: What happens if they fail? Well, before Sphinx 5 this was ignored, but Sphinx 5 considers this to be a build failure and deletes the relevant state files. Without them, Sage docbuilding can't create the documentation index.This PR works around the issue by patching Sage's docbuilding to change plot_directive.css's permissions. I have submitted matplotlib/matplotlib#23805 to fix this properly, but since it will probably take a while to reach a release and the bug is almost Sage+Nix-specific, I'd rather get the workaround in Nixpkgs first (it fixes a user-reported problem).
Fixes #189607 (cc @aikrahguzar)
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes