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
Add sage-apply-patches helper script for use in spkg-install scripts #20692
Comments
comment:2
Seems I have to undust my Why is it an error if there are no patches to apply? I would remove
and just apply all patches, which may be the empty set. |
comment:3
A minor thing: I would prefer to remove the |
comment:4
I don't get this:
|
comment:5
Why not always use the option |
Reviewer: Jeroen Demeyer |
comment:7
Following up on [comment:2]: it's very useful to support an empty set of patches. For example, when upgrading a package, it can happen that all patches need to be removed. You don't want that to break the build. That is also the reason why many packages have code to apply patches when they don't have patches. I would not remove such code since it allows easily adding a new patch. Ideally, every |
comment:8
Replying to @jdemeyer:
I guess I was thinking it was wasteful to call a process (especially on Windows where process creation is much slower) when it's not needed. Granted, when this was inline in every script it didn't require a process creation (more on that in a followup). I think if someone wants to add a patch to a package they should explicitly add As for it being an error when no patches are found, I have no strong feelings. I liked that it was explicit, but it could just as will either print a message, or go completely silent.
That's fine by me. I think there was one case, maybe two where it was needed, but it would be just as easy to update those patch files and keep things consistent throughout.
I figured maybe there was a reason to prefer to keep backups in general. Would be fine with me to apply in general though. Previously there was one other case where additional arguments had to be passed to
and it is assumed that the patches are being applied from Meaning the patches are applied after |
comment:9
An alternative I considered to adding a new script was to create a little library of functions that is sourced in every spkg-install. It would include I'd still be happy to revisit that idea too if it sounds good, but right now I just wanted to focus on the patch thing since that's what was irking me specifically :) |
comment:10
Replying to @embray:
How much slower is it really? Surely it's negligible compared to the time to build Sage.
That's really annoying. Please keep the call to |
comment:11
If you feel that strongly about it. I think it's pointless. Especially considering that it was already inconsistent. Instead you should be asking me to put |
comment:12
Replying to @embray:
Well, that's essentially what I wrote in [comment:7]. And yes, I feel strongly about because I don't want to always add/remove the call to Detail: for consistency, I would prefer the script to be called |
comment:13
What would that be consistent with? Every other script in |
comment:14
Consistent with |
comment:15
Those scripts are only ever in spkg directories though and are specific to each spkg. They are not in bin/ paths added to I'm probably also going to add a |
comment:16
For the record: I just wanted to comment over the name, I'm not going to reject this patch over such bikeshedding. |
comment:17
While I am OK with the stuff as it is, I have a bold suggestion for further work: may be it should be put in |
comment:18
Replying to @kiwifb:
Not easily. We need to guess in which source directory to run the script. Usually, it's |
comment:20
Let me think about that a bit more though. If it were done in One possibility would be to rewrite the patch files to include the source directory in the paths, but that could be annoying and error-prone. The other would be to standardize |
comment:21
Maybe this should be redone. There are a number of ways it might be done differently. One possibility is that it could be made |
comment:22
This is getting out of the original scope (and I am sorry to have started it) but it would be a good idea to have something more robust for unpacking in a standard folder. May be we should just get this in now and move that idea to another ticket? |
comment:23
Replying to @kiwifb:
I was going to suggest the same. Though I might address the subject of extracting to a standard location before coming back to and reworking this ticket. I've gone through the list of spkgs that don't wind up with their sources in I think a patch to |
Dependencies: #20721 |
comment:84
I have no further objections. I'm currently building Sage from scratch with this branch. If this works fine, I will set this to positive_review (hoping that there are no conflicts). |
comment:85
Awesome, thanks! |
comment:87
Merge conflict |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:89
Rebased. |
Changed branch from u/embray/patch-cleanup to u/jdemeyer/patch-cleanup |
comment:91
I fixed a minor bikeshed: I prefer no newline after
It makes it more clear that the I don't know if you intentionally added a newline there in New commits:
|
Changed branch from u/jdemeyer/patch-cleanup to |
comment:93
Finally merged, thanks Erik! |
Changed commit from |
comment:94
Hooray! |
This adds a new script to
build/bin
calledsage-apply-patches
which implements the same code that is copy/pasted through many of thespkg-install
scripts (albeit often inconsistently). The patches inbuild/pkgs/PKGNAME/patches
are now applied automatically.I'm not attached to any of the details of how the script works--the implementation was designed mostly to make it easiest to automatically replace the existing repeated code snippet with minimal effort.
Component: build
Author: Erik Bray
Branch:
b6b33cd
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/20692
The text was updated successfully, but these errors were encountered: