On Thu, 2022-04-21 at 14:28 -0700, ph h wrote: > Dear All, > > While waiting for advice on the questions on the thread "Copy&Paste" > > """ > BTW, is symlink a solution for "Copy & Paste"? > By another way, are there reasons that "Copy & Paste & Symlinks" is better > than just symlinks. > """ > > This is not meant "to look a gift horse in the mouth", but "straight from > the horse's mouth", some advice were found (and appended below) and they > beg the questions: > > 1/- Why "Copy&Passte&Symlink" was used instead of "Refactor&Source"? There > are of course good reasons for this, it is believed.
Refactor and source isn't as simple as it sounds. Sage is a mishmash of subprojects with different build systems, and is constantly in transition between high-level refactorings. During those neverending transitions, we try to keep both the start and end points working. At build- or run-time, some of those scripts may not exist, some may be symlinked, some may have been moved from their original locations... if everything was using autotools, you could just substitute in the correct location of resolvelinks.sh. But some pieces of sage don't use autotools, and the "sage" script itself is still invoked by many people *before* building anything. These aren't insurmountable problems, but copy/paste is relatively straightforward. > 2/- What "deserves to be factored out at some point in the future"? The > "resolvelinks" function or the scripts, "sage/src/bin/sage-env", > "sage/sage" and "sage/src/bin/sage"? The function. > 3/- When will that "point in the future" come? If "the future" is now, how > can these be best done? or just "que será, será" > You could try it now if you want. To get an idea of what you're in for, the last copy of resolvelinks() was introduced in Trac 30888: https://trac.sagemath.org/ticket/30888 The comments reveal that, 1. The "sage" script needs to know its own absolute, link-free location. 2. It will be installed when ./configure has not been run. 3. Python doesn't make the final installation location available at setup.py time, so a fake-autotools solution is out. To what extent those are true/necessary I can't really say, and I wasn't super interested in learning the intricacies of a bad way to install software just to avoid copy/pasting a shell function. If there's any easy way to avoid it, we'd all be happy. -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/2a6a7c87f54a056c4d22e1a84ebf5597c0b58f52.camel%40orlitzky.com.