sagemath/sage

Run _write_started_file() only from sage-starts

jdemeyer opened this issue · 12 comments

#12205 sort of broke sage-starts. Since it runs Sage code at install time, the sage-started.txt file is written when it shouldn't be.

Solution: create sage-started.txt only from sage-starts.

While we're at it, move that file to $SAGE_LOCAL/etc/sage-started.txt.

Apply:

  1. attachment: 13988_starts_root.patch to $SAGE_ROOT.
  2. attachment: 13988_starts_scripts.patch to $SAGE_LOCAL/bin
  3. attachment: 13988_write_started_file.patch to $SAGE_ROOT/devel/sage

Component: build

Author: Jeroen Demeyer

Reviewer: Volker Braun

Merged: sage-5.7.beta2

Issue created by migration from https://trac.sagemath.org/ticket/13988

Description changed:

--- 
+++ 
@@ -3,3 +3,8 @@
 Solution: create `sage-started.txt` only from `sage-starts`.
 
 While we're at it, move that file to `$SAGE_LOCAL/etc/sage-started.txt`.
+
+**Apply**:
+1. [attachment: 13988_starts_root.patch](https://github.com/sagemath/sage-prod/files/10656969/13988_starts_root.patch.gz) to `$SAGE_ROOT`.
+2. [attachment: 13988_starts_scripts.patch](https://github.com/sagemath/sage-prod/files/10656970/13988_starts_scripts.patch.gz) to `$SAGE_LOCAL/bin`
+3. [attachment: 13988_write_started_file.patch](https://github.com/sagemath/sage-prod/files/10656971/13988_write_started_file.patch.gz) to `$SAGE_ROOT/devel/sage`
comment:2

/etc/ is for configuration files that should be backed up, definitely not time stamps.

I think our long-term goal should be to introduce a /var/cache/sage/<sage-version>/ directory that will contain cached data like the gap workspace and time stamps for the sage install.

But as this ticket shows, its painful to do until we have a unified repository. So I don't mind merging this as a bandaid until we have a better solution in place.

Reviewer: Volker Braun

comment:3

Replying to @vbraun:

/etc/ is for configuration files that should be backed up, definitely not time stamps.

I think there is little difference between "configuration files" and "time stamps". Ideally, all the files

sage-current-location.txt
sage-flags.txt
sage-started.txt

should be moved to one place and I do think that $SAGE_LOCAL/etc is the best place.

comment:4

There is. The sage-started.txt file is just a cache for a lengthy operation (namely, checking if Sage starts). It is not a configuration file that you want to back up and carry with your if you reimage the system, say. Configuration files must not change if you do not want to change the configuration of Sage.

comment:5

Fair enough, but the other files I mentioned (sage-current-location.txt and sage-flags.txt) are "configuration files" under this definition, right? And putting these 3 together made sense to me.

comment:6

Well sage-current-location.txt isn't really anything that you can configure, its part of the mechanism to figure out when the install has been relocated. If the caching system would encode SAGE_ROOT in the cache dir, say, then we wouldn't need it at all. There are other ways that the caching system could work, but you don't need an independent way to figure out if you have been relocated. Of course the FHS does't make provisions about relocating binaries ;-)

sage-flags.txt is definitely a configuration file, I'd say.

comment:7

And, of course, /etc is still way better than /lib ;-)

Merged: sage-5.7.beta2