-
-
Notifications
You must be signed in to change notification settings - Fork 434
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
Automatically wrap spkg-install scripts with boilerplate #23179
Comments
Branch pushed to git repo; I updated commit sha1. New commits:
|
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:4
Rebased. |
comment:5
I don't really like this idea.
|
comment:6
Replying to @jdemeyer:
I'm not aware of any scenario that's impeded by this. Could you give me an example?
Right, as I wrote in the ticket I would still keep this guard, and the goal is not to remove it. That said, I don't see why this is a big deal. I'm not aware of any other packaging system that worries about this. If the consequences can be "severe" that's maybe a bigger problem. In any case, checking
I've tried giving this some thought, but to be honest I really don't know what you mean by this at all. |
comment:7
Well, other packaging systems aren't written in a very fragile language like Anyway, let me reconsider this ticket. I am starting to understand better why it's useful. |
comment:8
True, but as far as I can tell the problem here is not that what language the packaging system itself, however you define that, is written in. The way I see it, on most systems, the danger of accidentally installing outside SAGE_LOCAL is mitigated by permissions--you wouldn't be running these scripts with I think at the end of the day this makes our scripts safer because they are no executable by default (if you really wanted to you could still run them with |
comment:9
I would prefer something more like
At the very least, you need to check for errors when sourcing
|
comment:11
|
comment:12
Replying to @jdemeyer:
That can be a problem on Cygwin where, depending on how permission emulation is configured, all files may be treated as executable even if they aren't really (annoying, yes). My configuration isn't like that but it's not guaranteed. |
comment:13
Replying to @jdemeyer:
These options are available on BSD grep as well, including on OSX. If someone can point out a specific implementation where they're not then I can change it. |
comment:14
Replying to @embray:
Since you challenged me, OpenBSD grep does not have |
comment:15
Replying to @jdemeyer:
Okay, that's fine--obviously all of these alternatives are possible just annoying. |
comment:16
Replying to @embray:
Perhaps for Cygwin I could just output a warning, but make it an error everywhere else, where presumably we can rely on permissions being sane. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
Reviewer: Jeroen Demeyer |
comment:18
I think this addresses all your comments so far. If this needs any further tweaks that's fine, but even if not please set this back to needs work so that I can work on updating the developer documentation, assuming there are no further objections to this in principle. |
comment:19
Sorry, I think there's a bug somewhere. |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:59
Setting to blocker to get the attention of the release manager. Volker: since this touches a lot of files, it would be best to merge this early in Sage 8.1 to avoid conflicts. |
comment:61
|
comment:62
Typo: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
comment:64
This was just a typo as confirmed by Jeroen so I'll set it back to positive review. |
Changed branch from u/embray/build/script-wrappers to |
comment:66
I just flagged #23498 which was merged at the same time for follow up. Do we have a ticket for mopping up any new/upgrade packages that will trickle in until people are fully aware of the new system? We may have to do a bit of spotting and pre-emptive reviewing for a while. |
Changed commit from |
comment:67
I mean, I made a big list of tickets that are affected by this: #23179 comment:45 But #23498 slipped through the cracks. |
comment:68
Yes the list of "older" ticket is fine. I already warned one upgrade (arb) on rebasing on this ticket before 8.1.beta1 was released. But apart from those one, we need to be careful of new package/upgrade ticket for a while as well. |
I mentioned this idea in this ticket, but to summarize the purpose of this is to make the
spkg-install
scripts (as well asspkg-build
andspkg-check
when they exist) not directly executable on their own outside of package build directories. This is to prevent them from being accidentally executed in any other context. Further, they are wrapped to source thesage-env
script from the$SAGE_ROOT
the package is being installed into. So if one manually enters a package build directory and runs thespkg-install
it will automatically ensure that the correct Sage environment is loaded.This obviates the need for the guard boilerplate that checks for
$SAGE_LOCAL
, though it can't hurt to keep, in casesage-env
itself is broken somehow.This ticket changes a ton of files, so let me just summarize the changes briefly:
Modifies
sage-spkg
to write a wrapper containing the boilerplate around eachsage-build/install/check
script after it is copied into a package build directory.For all existing
sage-build/install/check
scripts, the executable bit is removed from the copies in the source tree inbuild/pkgs/
, and the shebang lines are removed.For the handful of scripts that were written in Python, the
spkg-install
becomes justexec sage-python23 sage-install.py
, where the original Python-based install script is moved tosage-install.py
.I think it would be good to do something like this, but it's just an idea and not strictly required for any future work.
CC: @vbraun
Component: build
Author: Erik Bray
Branch:
9dfaeeb
Reviewer: Jeroen Demeyer
Issue created by migration from https://trac.sagemath.org/ticket/23179
The text was updated successfully, but these errors were encountered: