-
-
Notifications
You must be signed in to change notification settings - Fork 568
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
Remove sage-location's "sage-force-relocate" mechanism, fix script to work without SAGE_ROOT #31270
Comments
Branch: u/mkoeppe/remove-sage-location |
Commit: |
Branch pushed to git repo; I updated commit sha1. New commits:
|
This comment has been minimized.
This comment has been minimized.
Author: Matthias Koeppe |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:7
|
comment:8
Replying to @jhpalmieri:
Yes, I hope this ticket can reduce the amount of downstream patching |
comment:9
Also: would the check
be more robust as
or Edit: typo: should be |
comment:10
Replying to @jhpalmieri:
I think there's value in giving a clear error message - removing it could cause more traffic on sage-support |
comment:11
Replying to @jhpalmieri:
Yes, this sounds like a good idea. |
comment:12
But in fact to make this code really useful, it should be revised to work with |
comment:13
I'm not sure what you mean by that, but here is how I would change the file (without worrying about SAGE_ROOT vs. SAGE_LOCAL): diff --git a/src/bin/sage-location b/src/bin/sage-location
index f656dd8f41..e83b06e409 100755
--- a/src/bin/sage-location
+++ b/src/bin/sage-location
@@ -97,15 +97,9 @@ if __name__ == '__main__':
# OLD_SAGE_ROOT is None if this is a first-time install.
OLD_SAGE_ROOT = read_location_file()
- if OLD_SAGE_ROOT != SAGE_ROOT:
- if OLD_SAGE_ROOT is None:
- print("This looks like the first time you are running Sage.")
- elif OLD_SAGE_ROOT != SAGE_ROOT:
- print(RELOCATION_ERROR.format(OLD_SAGE_ROOT=OLD_SAGE_ROOT, SAGE_ROOT=SAGE_ROOT))
- sys.exit(1)
- else:
- print("The Sage installation tree has moved")
- print("from %s" % OLD_SAGE_ROOT)
- print(" to %s" % SAGE_ROOT)
- assert(False)
+ if OLD_SAGE_ROOT is None:
+ print("This looks like the first time you are running Sage.")
sage_relocate()
+ elif not os.path.samefile(OLD_SAGE_ROOT, SAGE_ROOT):
+ print(RELOCATION_ERROR.format(OLD_SAGE_ROOT=OLD_SAGE_ROOT, SAGE_ROOT=SAGE_ROOT))
+ sys.exit(1) |
comment:14
This change would be fine with me. In fact, the message "This looks like the first time you are running Sage." can probably be removed. Please feel free to push to the ticket |
Changed branch from u/mkoeppe/remove-sage-location to u/jhpalmieri/remove-sage-location |
comment:16
Done. New commits:
|
Changed author from Matthias Koeppe to Matthias Koeppe, John Palmieri |
comment:17
Positive review for your changes. |
Reviewer: John Palmieri, Matthias Koeppe |
comment:18
I'm happy with it, too, but as I said, I can't review the parts that claim to work when |
Changed reviewer from John Palmieri, Matthias Koeppe to John Palmieri, Matthias Koeppe, ... |
comment:20
Well, sage-on-gentoo and probably other distros don't bother installing But it looks safe to run on a distro installed sage since we exit straight away on |
Changed reviewer from John Palmieri, Matthias Koeppe, ... to John Palmieri, Matthias Koeppe |
comment:21
I don't speak Italian (despite the last name), but I think we can merge this. |
comment:22
Thanks! |
Changed branch from u/jhpalmieri/remove-sage-location to |
#21783 removes the last productive bit of
sage-location
. The only thing thatsage-location
does now is write a warning if it notices that the tree has moved.We want to get rid of the whole mechanism completely.... (or reuse its remains to implement #31076).
In this ticket, we remove a part of it, the "sage-force-relocate" mechanism, which used to be invoked by
sage-spkg
.We also fix the script so that it works in installations without
SAGE_ROOT
. This is for the benefit of downstream packaging and #30913.(When we finally get rid of
sage-location
, we can finally close tickets #15146, #17479, #11755.)This is also preparation of sorts for #31076, which proposes to add a different relocation mechanism.
Depends on #21783
CC: @jhpalmieri @culler @dimpase @kiwifb @antonio-rojas @mwageringel
Component: relocation
Author: Matthias Koeppe, John Palmieri
Branch/Commit:
3035932
Reviewer: John Palmieri, Matthias Koeppe
Issue created by migration from https://trac.sagemath.org/ticket/31270
The text was updated successfully, but these errors were encountered: