-
-
Notifications
You must be signed in to change notification settings - Fork 561
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
"make" should run Sage once #11926
Comments
This comment has been minimized.
This comment has been minimized.
comment:3
I think I suggested this sort of thing once, and it was criticized. I don't remember the critiques. Anyway, I like the idea. In case some system administrator is building Sage and doesn't want a .sage directory created for them, should we set DOTSAGE to something temporary first? By the way, running Sage as part of the build process should also take care of some of the issues at #5155 (not all of them, unfortunately). |
comment:4
Replying to @jhpalmieri:
Good idea. Make a temporary DOTSAGE, run Sage, remove the temporary DOTSAGE
Thanks for the pointer. Also #11887 is related. |
Work Issues: temporary DOTSAGE |
comment:5
I don't like the idea of running Someone who is going to install Sage system-wide should run Also note that |
comment:6
Replying to @nexttime:
I think it does. Currently, after
Why? I like
Running
Let the sysadmin decide whether they want to run
I would think most people run Sage from the location where they installed it, or equivalently, install Sage in the location they want to run it from. In any case, this does not invalidate the reasons for this ticket. |
comment:7
Updated version of the patch using a temporary |
Changed work issues from temporary DOTSAGE to none |
comment:8
Tested with a complete build from scratch that this does indeed what it should do. A simple |
comment:9
I don't see anything in the new patch about |
comment:10
Replying to @jhpalmieri:
So true! I seems I forget a |
comment:11
Replying to @jhpalmieri:
Related question which comes up: should we also use a temporary DOT_SAGE directory for |
This comment has been minimized.
This comment has been minimized.
comment:13
I'm somewhat tempted to add a new command-line option to Sage: diff --git a/sage-sage b/sage-sage
--- a/sage-sage
+++ b/sage-sage
@@ -247,6 +247,27 @@ if [ $# -gt 0 ]; then
fi
fi
+# The following function creates a temporary file and stores its name
+# in $FILE. (It would be nice to replace this with 'mktemp', but that
+# command has different syntax on OS X compared to linux or Solaris.)
+sagetempfile() {
+ FILE=`mktemp -d 2>/dev/null`
+ if [ $? -ne 0 ]; then
+ # presumably because the "-d" option to mktemp expects an argument,
+ # e.g., on OS X.
+ FILE=`mktemp -d -t dotsage`
+ fi
+}
+
+if [ "$1" = '--norc' -o "$1" = '--nodotsage' ]; then
+ OLD_DOT_SAGE=$DOT_SAGE
+ sagetempfile
+ DOT_SAGE=$FILE && export DOT_SAGE
+ shift
+ sage "$@"
+ rm -rf "$DOT_SAGE"
+ DOT_SAGE=$OLD_DOT_SAGE && export DOT_SAGE
+fi
LOGFILE="$SAGE_ROOT/sage.log"
LOGOPT=""
We should probably check exit codes for various things here, and of course this would need to be documented. If we had this, then in |
comment:14
Replying to @jhpalmieri:
Let's discuss this in a different ticket: #11932. I think I am going to revert the |
comment:74
Added an extra patch with the documentation changes proposed by leif, needs_review. |
This comment has been minimized.
This comment has been minimized.
Milestone sage-4.7.3 deleted |
Changed merged from sage-4.7.3.alpha0 to sage-4.8.alpha0 |
comment:78
Attachment: 11926_doc.patch.gz Can somebody please review the last patch here? |
comment:79
Looks okay to me. |
comment:80
Replying to @jhpalmieri:
Yes. But still And it would be far better to have the output of W.r.t. #11021: Despite its current title, it involves a "major" rewrite of So that ticket certainly drags (which mainly is my fault; I've returned to it many times, but then again had to work on too many other tickets), but it doesn't make things easier if other tickets do redundant changes to One can by the way search for other tickets before working on e.g. scripts or spkgs. And there's btw. also a meta-ticket for changes to the |
comment:81
Replying to @nexttime:
I don't find it logical that
If we are not allowed to make patches just because some other ticket makes changes to the same code, then we might as well stop Sage development. Especially if the ticket gets "dragged" as you say. |
comment:82
Replying to @nexttime:
I don't have strong feelings about this issue. If you want to make this change on a different ticket, go ahead, I will have a look. |
comment:83
Replying to @jdemeyer:
The builder imports Perhaps
I was talking about unnecessary, unrelated changes. Any developer should at least be aware of other tickets touching the same code. It's also bad practice to bundle unrelated changes to different files into a single patch, just because they're in the same repo. |
comment:84
See #11991 for what I hope is a quick a follow-up: sage-starts should record the time and version number. |
comment:85
I hate to be late to the party. I was bogged down into work. I appreciate the point of view that most people won't build the stuff system wide. Me and Paulo from Mandriva do. I and probably him will object to that sage-started.txt file being stored in $SAGE_LOCAL/lib/. To us it belongs to DOTSAGE. I know it complicates the testing that Jeroen wants to do. But this goes a long way to making a system wide installation troublesome. I may have missed it but where is the documentation for someone who wants to make a system wide install? Just this ticket? |
comment:86
I think that sage_started.txt should be viewed as a file like sage-current-location.txt: a file which is produced during the build/test process, which ordinary users don't need write-access to. This ticket is related to some of the issues at #5155, and should indeed fix some of them. But maybe I don't understand your complaint; can you explain it more? |
comment:87
Replying to @kiwifb:
Why do you think this makes a system-wide install harder? In fact, this ticket was exactly supposed to make it easier to do a system-wide install.
See http://sagemath.org/doc/installation/source.html#installation-in-a-multiuser-environment. Of course this ticket (and probably others to be merged in sage-4.8) will change this documentation, but the essence should remain the same. |
comment:88
OK. I just completed my first ebuild of a sage-4.8 alpha this afternoon. The first I noticed about this is when I ran the doctests as a normal user. I do that straight away as this is the only validation test I have. A truckload of doctests just failed complaining that they couldn't find "sage-started.txt". Actually so many failed that I am almost wondering if there is something wrong with the ones that didn't. I spent 3 weeks fixing bad fortran code and bad makefiles so I may have had a bit of a temper there but it just made my life difficult. I am not sure how it helps with #5155 since it adds stuff that actually wants access to SAGE_ROOT. I'll admit that I skimmed a bit on reading this thread so I won't attribute bad intent but using DOT_SAGE has been raised and apparently shot down as "system wide install" is not a normal install. You don't have to support the kind of stuff I do but it felt like making it more difficult knowingly. |
comment:89
How did you build sage? i.e. which shell commands did you execute, starting from the Sage source tarball, to get the totally-non-working Sage? |
comment:90
Also: precisely which alpha version of Sage did you use? There have been various changes to the build process in the 4.8 series. |
comment:91
I tried the following:
Almost all tests passed; the only failures were the ones reported at #5515.
So I think the approach on this ticket should work with a multi-user installation, but as I said earlier, I may be misunderstanding the problem. |
comment:92
Sorry not to reply immediately Jeroen but that last message was the last thing I did before getting some sleep. Which helped clear my mind a little and take on board some comments properly. I, and am pretty sure that Mandriva does too, bypass the normal sage build system in our packages. You may have noticed the word ebuild (gentoo). So I didn't notice that you basically generated a file that was essential to start sage at the very end of the building process and outside of any spkg (that's a very crucial bit if you are packaging sage). I guess now that I have noticed and realized it is supposed to be there I could just add it and adjust the location. My real mistake was to think it was created each time sage was launched - never mind that there is no process to remove it. |
In a multi-user environment, the user compiling Sage must run it at least once to run
sage-location
and generate.pyc
files.The proposed fix is: in the default
make
rule, run Sage whenlocal/bin/sage-started.txt
does not exist and create that file insage-location
. Also run Sage after upgrading.This patch also changes the error message when a spkg fails a build or test. Example error message:
Apply:
local/bin
)CC: @pcpa
Component: build
Keywords: Makefile build sage-starts
Author: Jeroen Demeyer
Reviewer: John Palmieri, Leif Leonhardy
Merged: sage-4.8.alpha0
Issue created by migration from https://trac.sagemath.org/ticket/11926
The text was updated successfully, but these errors were encountered: