ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 30 Mar 2012 00:46:57 +0200How to install patches? (Or should we?)https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/Hi -
Hopefully this question is basic, but I haven't been able to find a clear answer online. (For the record, I am using the Sage notebook with the app version of Sage on a Mac.)
I consider myself a lowly and ignorant end user of Sage -- maybe one day I'll know enough to be able to contribute to development, but that day is not near. How do I (or should I, even) download and install patches, fixes and updates to Sage, short of doing a whole new installation from scratch?
More specifically: Suppose I encounter some bug or shortcoming with Sage, and I discover that there is already a ticket for that problem on the [Sage developer trac](http://trac.sagemath.org/sage_trac/). Suppose that that ticket is categorized as "fixed," and I see a link to some file (usually ending with .spkg, .patch, or .diff) near the top of the page. Is that file something that I, the lowly end user, am meant to download and install, hopefully fixing my problem? Or are those files on sage_trac really just meant for development work, and the fix will only trickle down to the end users once those fixes are incorporated into a future version of Sage?
If am I meant to be installing these patches myself, how exactly is that done? That is, where do I put the files, and what do I type where?
I feel like an idiot phrasing it in such basic terms. And I'm sure that the answers to my questions are already floating out there somewhere, but I haven't been able to find them. For example, the help stuff I've found out there for sage_trac is all about how to post or contribute to a trac ticket, rather than how to take advantage of the fixes found for that ticket.Thu, 29 Mar 2012 12:27:33 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/Answer by niles for <p>Hi -</p>
<p>Hopefully this question is basic, but I haven't been able to find a clear answer online. (For the record, I am using the Sage notebook with the app version of Sage on a Mac.)</p>
<p>I consider myself a lowly and ignorant end user of Sage -- maybe one day I'll know enough to be able to contribute to development, but that day is not near. How do I (or should I, even) download and install patches, fixes and updates to Sage, short of doing a whole new installation from scratch?</p>
<p>More specifically: Suppose I encounter some bug or shortcoming with Sage, and I discover that there is already a ticket for that problem on the <a href="http://trac.sagemath.org/sage_trac/">Sage developer trac</a>. Suppose that that ticket is categorized as "fixed," and I see a link to some file (usually ending with .spkg, .patch, or .diff) near the top of the page. Is that file something that I, the lowly end user, am meant to download and install, hopefully fixing my problem? Or are those files on sage_trac really just meant for development work, and the fix will only trickle down to the end users once those fixes are incorporated into a future version of Sage?</p>
<p>If am I meant to be installing these patches myself, how exactly is that done? That is, where do I put the files, and what do I type where?</p>
<p>I feel like an idiot phrasing it in such basic terms. And I'm sure that the answers to my questions are already floating out there somewhere, but I haven't been able to find them. For example, the help stuff I've found out there for sage_trac is all about how to post or contribute to a trac ticket, rather than how to take advantage of the fixes found for that ticket.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?answer=13406#post-id-13406When you're looking at a ticket page, you could also check to see if the patch is marked as "merged" in some in-progress new version of Sage. Once a ticket is marked as "fixed", this tends to happen pretty fast and you can just install the new version (even if it's a development version).
As to why you would want to unapply a patch, this is useful if you're using multiple patches at once, which possibly conflict with eachother (i.e. one can't be applied after the other). Or if you depend on your Sage install for something critical which you don't want to inadvertently bring bugs into, but you also want to use Sage for some other non-critical task where you don't care about unreviewed patches. So maybe none of these matter to you, but you might want to keep the possibility in the back of your mind.
Spkg's are something different from patches, and instructions for installing them are given in answer to a different Ask Sage [question](http://ask.sagemath.org/question/37/how-do-i-install-an-spkg).
And it bears mentioning that many of the nice folks here are the same people having opaque discussions on Trac! It's just a matter of context :)
Lastly, you're right that it would be more intuitive and useful to have the instructions for applying a patch separated in the manual from the instructions for reviewing a patch. In fact, *you* can make this happen! To do it, just read the other sections on contributing to Sage, open a ticket and submit your patch. Feel free to add me ("niles" on Trac) to the Cc field of the ticket if you'd like me to take a look at it with you. The same probably goes for @Volker Braun and @kcrisman, so don't be shy about adding them too.Thu, 29 Mar 2012 14:51:30 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?answer=13406#post-id-13406Comment by jdc for <p>When you're looking at a ticket page, you could also check to see if the patch is marked as "merged" in some in-progress new version of Sage. Once a ticket is marked as "fixed", this tends to happen pretty fast and you can just install the new version (even if it's a development version).</p>
<p>As to why you would want to unapply a patch, this is useful if you're using multiple patches at once, which possibly conflict with eachother (i.e. one can't be applied after the other). Or if you depend on your Sage install for something critical which you don't want to inadvertently bring bugs into, but you also want to use Sage for some other non-critical task where you don't care about unreviewed patches. So maybe none of these matter to you, but you might want to keep the possibility in the back of your mind.</p>
<p>Spkg's are something different from patches, and instructions for installing them are given in answer to a different Ask Sage <a href="http://ask.sagemath.org/question/37/how-do-i-install-an-spkg">question</a>.</p>
<p>And it bears mentioning that many of the nice folks here are the same people having opaque discussions on Trac! It's just a matter of context :)</p>
<p>Lastly, you're right that it would be more intuitive and useful to have the instructions for applying a patch separated in the manual from the instructions for reviewing a patch. In fact, <em>you</em> can make this happen! To do it, just read the other sections on contributing to Sage, open a ticket and submit your patch. Feel free to add me ("niles" on Trac) to the Cc field of the ticket if you'd like me to take a look at it with you. The same probably goes for <a href="/users/69/volker-braun/">@Volker Braun</a> and <a href="/users/41/kcrisman/">@kcrisman</a>, so don't be shy about adding them too.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20021#post-id-20021Thanks, Niles. I think I'd better see if I actually am capable of applying a patch before I write instructions telling other people how to do it. But you guys probably will con me into contributing something sooner or later. :)Thu, 29 Mar 2012 15:34:17 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20021#post-id-20021Comment by niles for <p>When you're looking at a ticket page, you could also check to see if the patch is marked as "merged" in some in-progress new version of Sage. Once a ticket is marked as "fixed", this tends to happen pretty fast and you can just install the new version (even if it's a development version).</p>
<p>As to why you would want to unapply a patch, this is useful if you're using multiple patches at once, which possibly conflict with eachother (i.e. one can't be applied after the other). Or if you depend on your Sage install for something critical which you don't want to inadvertently bring bugs into, but you also want to use Sage for some other non-critical task where you don't care about unreviewed patches. So maybe none of these matter to you, but you might want to keep the possibility in the back of your mind.</p>
<p>Spkg's are something different from patches, and instructions for installing them are given in answer to a different Ask Sage <a href="http://ask.sagemath.org/question/37/how-do-i-install-an-spkg">question</a>.</p>
<p>And it bears mentioning that many of the nice folks here are the same people having opaque discussions on Trac! It's just a matter of context :)</p>
<p>Lastly, you're right that it would be more intuitive and useful to have the instructions for applying a patch separated in the manual from the instructions for reviewing a patch. In fact, <em>you</em> can make this happen! To do it, just read the other sections on contributing to Sage, open a ticket and submit your patch. Feel free to add me ("niles" on Trac) to the Cc field of the ticket if you'd like me to take a look at it with you. The same probably goes for <a href="/users/69/volker-braun/">@Volker Braun</a> and <a href="/users/41/kcrisman/">@kcrisman</a>, so don't be shy about adding them too.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20020#post-id-20020Ha! good idea :)Thu, 29 Mar 2012 15:54:16 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20020#post-id-20020Comment by kcrisman for <p>When you're looking at a ticket page, you could also check to see if the patch is marked as "merged" in some in-progress new version of Sage. Once a ticket is marked as "fixed", this tends to happen pretty fast and you can just install the new version (even if it's a development version).</p>
<p>As to why you would want to unapply a patch, this is useful if you're using multiple patches at once, which possibly conflict with eachother (i.e. one can't be applied after the other). Or if you depend on your Sage install for something critical which you don't want to inadvertently bring bugs into, but you also want to use Sage for some other non-critical task where you don't care about unreviewed patches. So maybe none of these matter to you, but you might want to keep the possibility in the back of your mind.</p>
<p>Spkg's are something different from patches, and instructions for installing them are given in answer to a different Ask Sage <a href="http://ask.sagemath.org/question/37/how-do-i-install-an-spkg">question</a>.</p>
<p>And it bears mentioning that many of the nice folks here are the same people having opaque discussions on Trac! It's just a matter of context :)</p>
<p>Lastly, you're right that it would be more intuitive and useful to have the instructions for applying a patch separated in the manual from the instructions for reviewing a patch. In fact, <em>you</em> can make this happen! To do it, just read the other sections on contributing to Sage, open a ticket and submit your patch. Feel free to add me ("niles" on Trac) to the Cc field of the ticket if you'd like me to take a look at it with you. The same probably goes for <a href="/users/69/volker-braun/">@Volker Braun</a> and <a href="/users/41/kcrisman/">@kcrisman</a>, so don't be shy about adding them too.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20014#post-id-20014I just want to affirm what Niles says about context. On a ticket, it's definitely assumed you know what you are talking about, and if not, someone will hopefully point you to the documentation. Here, the point is to have resources that help out.Fri, 30 Mar 2012 00:46:57 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20014#post-id-20014Answer by kcrisman for <p>Hi -</p>
<p>Hopefully this question is basic, but I haven't been able to find a clear answer online. (For the record, I am using the Sage notebook with the app version of Sage on a Mac.)</p>
<p>I consider myself a lowly and ignorant end user of Sage -- maybe one day I'll know enough to be able to contribute to development, but that day is not near. How do I (or should I, even) download and install patches, fixes and updates to Sage, short of doing a whole new installation from scratch?</p>
<p>More specifically: Suppose I encounter some bug or shortcoming with Sage, and I discover that there is already a ticket for that problem on the <a href="http://trac.sagemath.org/sage_trac/">Sage developer trac</a>. Suppose that that ticket is categorized as "fixed," and I see a link to some file (usually ending with .spkg, .patch, or .diff) near the top of the page. Is that file something that I, the lowly end user, am meant to download and install, hopefully fixing my problem? Or are those files on sage_trac really just meant for development work, and the fix will only trickle down to the end users once those fixes are incorporated into a future version of Sage?</p>
<p>If am I meant to be installing these patches myself, how exactly is that done? That is, where do I put the files, and what do I type where?</p>
<p>I feel like an idiot phrasing it in such basic terms. And I'm sure that the answers to my questions are already floating out there somewhere, but I haven't been able to find them. For example, the help stuff I've found out there for sage_trac is all about how to post or contribute to a trac ticket, rather than how to take advantage of the fixes found for that ticket.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?answer=13405#post-id-13405The answer to your meta-question about "should you" is an unqualified yes! Otherwise *I* would have never become a developer, and probably many others. Even if you just apply it to see whether it still applies to the latest Sage and report back, you've done a valuable service for the Sage community. No "lowly end users" here.
There is a learning curve, it's true, but luckily a well-documented one. Volker is spot on.Thu, 29 Mar 2012 12:57:54 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?answer=13405#post-id-13405Comment by jdc for <p>The answer to your meta-question about "should you" is an unqualified yes! Otherwise <em>I</em> would have never become a developer, and probably many others. Even if you just apply it to see whether it still applies to the latest Sage and report back, you've done a valuable service for the Sage community. No "lowly end users" here.</p>
<p>There is a learning curve, it's true, but luckily a well-documented one. Volker is spot on.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20026#post-id-20026The learning curve feels more like a vertical ascent sometimes. I've tried to read tickets at sage_trac a few times, but the discussion is opaque to me. Even the documentation seems to assume a level of familiarity and expertise that I don't have. But thank heaven for the nice folks at ASKSAGE.Thu, 29 Mar 2012 13:17:12 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20026#post-id-20026Answer by Volker Braun for <p>Hi -</p>
<p>Hopefully this question is basic, but I haven't been able to find a clear answer online. (For the record, I am using the Sage notebook with the app version of Sage on a Mac.)</p>
<p>I consider myself a lowly and ignorant end user of Sage -- maybe one day I'll know enough to be able to contribute to development, but that day is not near. How do I (or should I, even) download and install patches, fixes and updates to Sage, short of doing a whole new installation from scratch?</p>
<p>More specifically: Suppose I encounter some bug or shortcoming with Sage, and I discover that there is already a ticket for that problem on the <a href="http://trac.sagemath.org/sage_trac/">Sage developer trac</a>. Suppose that that ticket is categorized as "fixed," and I see a link to some file (usually ending with .spkg, .patch, or .diff) near the top of the page. Is that file something that I, the lowly end user, am meant to download and install, hopefully fixing my problem? Or are those files on sage_trac really just meant for development work, and the fix will only trickle down to the end users once those fixes are incorporated into a future version of Sage?</p>
<p>If am I meant to be installing these patches myself, how exactly is that done? That is, where do I put the files, and what do I type where?</p>
<p>I feel like an idiot phrasing it in such basic terms. And I'm sure that the answers to my questions are already floating out there somewhere, but I haven't been able to find them. For example, the help stuff I've found out there for sage_trac is all about how to post or contribute to a trac ticket, rather than how to take advantage of the fixes found for that ticket.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?answer=13404#post-id-13404The developer manual has a [walk through](http://www.sagemath.org/doc/developer/walk_through.html) of the patch applying process. Essentially you can just use the Sage command
hg_sage.apply("http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11329/f2c-20070816.p2-p3.diff")
but really you want to create a clone of the repository first if you want to get rid of the patch later.
Thu, 29 Mar 2012 12:39:21 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?answer=13404#post-id-13404Comment by jdc for <p>The developer manual has a <a href="http://www.sagemath.org/doc/developer/walk_through.html">walk through</a> of the patch applying process. Essentially you can just use the Sage command</p>
<pre><code>hg_sage.apply("http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11329/f2c-20070816.p2-p3.diff")
</code></pre>
<p>but really you want to create a clone of the repository first if you want to get rid of the patch later.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20027#post-id-20027If a patch fixes a problem, what would be my motivation for wanting to get rid of it later? Is that just in case the patch turns out not to work, or gets improved later?Thu, 29 Mar 2012 13:10:19 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20027#post-id-20027Comment by kcrisman for <p>The developer manual has a <a href="http://www.sagemath.org/doc/developer/walk_through.html">walk through</a> of the patch applying process. Essentially you can just use the Sage command</p>
<pre><code>hg_sage.apply("http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11329/f2c-20070816.p2-p3.diff")
</code></pre>
<p>but really you want to create a clone of the repository first if you want to get rid of the patch later.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20029#post-id-20029Or you can look further in the developer guide for other ways of doing it... by the way, if you only want to apply and get rid of one patch, then `hg_sage.rollback()` will get rid of the patch. You will also need to do `sage -b` each time to make the changes actually happen.Thu, 29 Mar 2012 12:58:58 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20029#post-id-20029Comment by jdc for <p>The developer manual has a <a href="http://www.sagemath.org/doc/developer/walk_through.html">walk through</a> of the patch applying process. Essentially you can just use the Sage command</p>
<pre><code>hg_sage.apply("http://trac.sagemath.org/sage_trac/raw-attachment/ticket/11329/f2c-20070816.p2-p3.diff")
</code></pre>
<p>but really you want to create a clone of the repository first if you want to get rid of the patch later.</p>
https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20028#post-id-20028Okay, that's helpful. It's interesting that the method for downloading patches is buried in the development manual, in a discussion of how to *review* patches, instead of in the main Sage tutorial or FAQ. Also, do I just want to be doing this with .patch files, or are spkg's also a type of patch?Thu, 29 Mar 2012 13:09:02 +0200https://ask.sagemath.org/question/8835/how-to-install-patches-or-should-we/?comment=20028#post-id-20028