-
-
Notifications
You must be signed in to change notification settings - Fork 535
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
Fix post-cloning docbuild problems and add new command-line options #6187
Comments
comment:1
I think the file modification times need to be copied over as well with a "cp -a" instead of "cp -r". I'm not sure if there are any hardcoded paths in the Sphinx environment pickle that would need to be changed. |
comment:2
I'm not having any luck with this. If in sage-clone I copy the library files with "cp -a" (or what I think is the equivalent, e.g. "cp -pr" on my mac, or No matter what, if after cloning, I delete the directory doc/output and then recopy it, |
comment:3
#5350 might be relevant here. The script there could be adapted to create hard links for the documentation. |
comment:4
This is kind of brutal, but we can replace the cloning part of sage-clone with a single line like
(This is with the BSD version of cp on Mac OS X; it might be more portable to use a python equivalent, like shutil.copytree.) This has the disadvantage that some crap gets copied along with the good stuff. This is probably a bad idea from other points of view, too; what else goes wrong? It has the advantage that modification times are preserved, while they are not (as far as I can tell) when you use 'hg clone' to copy the repository. By the way, the 'clone' section of the hg man page says:
This is where I got the idea, although their version creates hard links, which I suppose is why it would be "the fastest way"... |
comment:5
One issue to keep in mind when testing: if you do
as is done at the end of 'make', and then you do
the entire reference manual gets rebuilt (and similarly for the other pieces of documentation). So if you're testing out an idea for how to fix this, make sure that you're consistent with the |
comment:6
This patch might very well be a bad idea, but I don't know enough about the Sage cloning process to know any better. Please review it carefully. (Actually, I'm posting two patches. 'cloning_scripts_short.patch' just copies over the whole Sage library. 'cloning_scripts.patch' uses the Python 2.6 version of shutil.copytree to allow us to skip certain files when copying, so I copied the source code for that into sage-clone and used that, thereby not copying absolutely everything. If I'm skipping too many things or not enough things, this is easy to adjust. Only apply one of these two patches.) |
Attachment: cloning_scripts.patch.gz use this patch or cloning_scripts.patch, but not both -- see my comments |
comment:7
Attachment: cloning_scripts_short.patch.gz I have read the comments here with interest, and could try out those patches, but I'm not qualified to say whether they work "well" or are robust enough to be released -- sorry! |
comment:8
Here's a patch rebased against 4.1.alpha1. |
rebased against 4.1.alpha1, use instead of either of the other patches |
comment:9
Attachment: cloning_6187_scripts.patch.gz Here's what I did. 1. Starting in main branch of a 4.1.alpha2 build, did "sage -docbuild all html" and waited until it finished. 2. Made a clone called test1. 3. In that clone, did "sage -docbuild again" and watched it build all over again. 4. In the clone, applied the third patch. 5. From that clone made a new clone test2. 6. In the new clone once again did "sage -docbuild all html" -- and nothing was rebuilt! That looks like success to me. The new script also looks very much simpler than the old one, which is good. This is on linux (ubuntu 32-bit); since you use a standard python utility for the copying I would hope that it would work anywhere, so I'm giving it a positive review and hope that others will try on other systems. |
Reviewer: John Cremona |
Author: John Palmieri |
comment:10
The following may help with rebuilding the reference manual after cloning:
Note: I haven't tested this idea with #5350, other documents, other builders, etc. |
comment:11
So we could add The only issue I see is that if someone has made some changes and then clones before rebuilding the reference manual, the This works with or without the patch at #5350, and it works appropriately with or without the Here are two new patches, one which is just mpatel's patch to builder.py (and which receives a positive review from me). The other adds some code to sage-clone to do the I like this version better than my old patch: it keeps the old cloning process, so it seems safer to me. So I'm changing this from "positive review" (for the old patch) to "needs review" (for the new scripts patch). Apply "trac_6187_mpatel.patch" to the sage repository, and apply "trac_6187_new_scripts.patch" to the scripts repository. |
comment:12
Attachment: trac_6187_mpatel.patch.gz I noticed an error occurs during cloning if I'll try to make a new patch for |
use this and trac_6187_new_scripts.patch only |
comment:13
Attachment: trac_6187_mpatel_v2.patch.gz Replying to @qed777:
The new patch should now work in this case. The pickle's
Apply [trac_6187_new_scripts.patch] to the scripts repository and [trac_6187_mpatel_v2.patch] to the sage repository. |
Changed author from John Palmieri to John Palmieri, Mitesh Patel |
comment:14
What should the output from 'sage -docbuild --update_mtimes reference html' look like? Right now I see
Since it's not actually building anything (is it?), I think this is misleading. In the new scripts patch, I've changed sage-clone so that it suppresses the standard output from this command. |
Attachment: trac_6187_new_scripts.patch.gz apply to scripts repo. use this and trac_6187_mpatel_v2.patch only. |
comment:19
Run, e.g., I'm changing the status of this ticket to WPNR to signal that the patches are [again] ready for testing, comment, and perhaps even review. |
comment:20
To see colored logging output, try |
comment:22
Overall, this works as advertised. I like the new options, the new option parsing, and the help messages. We might consider eventually updating mtimes on all of the docs, not just the reference manual, but everything else is quick enoug to build that it's not a big deal. (To test: I installed the two patches here and made sure the docs were built. Then I cloned the current repository and rebuilt the docs. The reference manual built almost instantly, because it was using the version from the clone.) Someone else should take a good look at it, though, since I am an author of part of this (the scripts part). Also, there are a number of changes to builder.py, and other people should look carefully at them, more carefully than I have so far. Other comments: if I do something like
The problem is, it creates a directory SAGE_ROOT/devel/sage/doc/en/hello, and now "hello" appears in the list of documents. Should there be better error checking to prevent this from happening? Actually, I think this belongs on another ticket: it's a "pre-existing condition", and can be dealt with separately. See #6605. |
comment:23
A reminder to myself: Change |
Attachment: trac_6187-new_scripts_v5.patch.gz Updated for #6673. Apply to scripts repo. |
Attachment: trac_6187-builder_v5.patch.gz Fixed sys.exit() code. Apply to sage repo. |
comment:25
V5 just squares |
comment:26
It's asking a lot of a reviewer to apply over a dozen patches! Any chance of combining them all into one? |
comment:27
I apologize for not being explicit. Please apply just the v5 pair: the "new_scripts" patch to the scripts repository and the "builder" patch to the sage repository. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:30
After look at this and testing it out, I think that it can go in. |
Changed reviewer from John Cremona to John Cremona, Mike Hansen |
Merged: sage-4.2.alpha0 |
Currently,
sage -clone
requires a rebuild of the Sage documentation. This ticket attempts to fix this and a few related problems with the "docbuild" system. It also includes some features added in the course of fixing the problems:Lots of new command-line options. For a list and examples, try, e.g.,
sage -docbuild -H
. The old options and syntax should still work.Progress updates with Python's powerful logging framework, which we may wish to adopt later for the Sage library.
The only patches to apply are
All but one of the other patches are earlier versions of these. Please do not review the remaining, completely optional patch:
This adds a test document similar to the reference manual. It covers only algebras, so it builds much more quickly and may facilitate experimentation with Sphinx, say. To build it, try
sage -docbuild testreference html -jv3
.Related tickets: #5350, #6605, #6614, #6653, #6673, #6488.
Please visit the "diff" links below to view earlier ticket descriptions.
CC: @mwhansen @sagetrac-mvngu @loefflerd
Component: documentation
Author: John Palmieri, Mitesh Patel
Reviewer: John Cremona, Mike Hansen
Merged: sage-4.2.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/6187
The text was updated successfully, but these errors were encountered: