Opened 3 years ago
Last modified 3 years ago
#26612 new defect
Remove bad mathjax symlink and bad mathjax directories
Reported by:  jhpalmieri  Owned by:  

Priority:  major  Milestone:  sage8.5 
Component:  documentation  Keywords:  
Cc:  Merged in:  
Authors:  John Palmieri  Reviewers:  
Report Upstream:  N/A  Work issues:  
Branch:  u/jhpalmieri/nomathjax (Commits, GitHub, GitLab)  Commit:  ae3812d060e0df45073d17ff928dcc34b8fcc0eb 
Dependencies:  #26641  Stopgaps: 
Description
The problem reported in #26152 has returned, it seems. As a result, users may end up with a symlink SAGE_SHARE/mathjax/mathjax
pointing to its parent directory, and this ends up producing a directory SAGE_DOC/html/en/reference/_static/mathjax
which contains a subdirectory mathjax
which also contains a subdirectory mathjax
, etc., hence needlessly using gigabytes of disk space. Let's get rid of these problematic files.
Change History (25)
comment:1 Changed 3 years ago by
 Branch set to u/jhpalmieri/nomathjax
comment:2 Changed 3 years ago by
 Commit set to ae3812d060e0df45073d17ff928dcc34b8fcc0eb
 Status changed from new to needs_review
comment:3 Changed 3 years ago by
I still don't know what causes the symlink to be created, but let's delete it when we build the documentation.
comment:4 Changed 3 years ago by
 Status changed from needs_review to needs_work
I don't like this kind of code. We really should fix the underlying problem instead. Do you have a way to reproduce it?
comment:5 Changed 3 years ago by
I don't have a way to reproduce it. There are two issues, in my mind: first, yes, we want to fix the underlying issue, but that seems hard since we don't know what the issue is. Second, there may be people out there who are suffering from this problem and don't realize it and so are wasting huge amounts of disk space. Shouldn't we clean up that mess?
comment:6 followup: ↓ 8 Changed 3 years ago by
I have one computer on which I can recreate the selfreferential symlink by running ./sage f sagenb
. I think the problem comes from this: sagenb is distributed with a full copy of mathjax in its data directory. The installation procedure is supposed to replace this copy with a symlink, and something goes wrong. Why is sagenb distributed with a copy of mathjax in the first place, since mathjax has been a separate Sage package for a while? Now I'm tempted to do this:

build/pkgs/sagenb/spkginstall
diff git a/build/pkgs/sagenb/spkginstall b/build/pkgs/sagenb/spkginstall index 57864ab0d9..639de1d23d 100644
a b fi 17 17 PYTHON_VERSION=$("$SAGE_LOCAL/bin/$PYTHON" c 'import sys; print("%d.%d" % sys.version_info[:2])') 18 18 cd "${SAGE_DESTDIR}${SAGE_LOCAL}/lib/python$PYTHON_VERSION/sitepackages/sagenb/data"  \ 19 19 sdh_die "Cannot find SageNB data directory." 20 rm rf mathjax 20 21 ln s n "$SAGE_SHARE/mathjax/" mathjax  \ 21 22 sdh_die "Error: Cannot symlink mathjax into the SageNB data directory."
along with a command at the start of sagenb's installation to remove the existing mathjax directory. Or something along these lines.
comment:7 Changed 3 years ago by
This doesn't explain things completely, of course: why can I reliably reproduce this on one computer and not another? On the computer where I can reproduce it, I first installed an older version of sagenb, removed the bad symlink, and then did an incremental update to the current develop
branch. What remnants from the old build could be causing the symlink to get reproduced each time I do ./sage f sagenb
?
comment:8 in reply to: ↑ 6 ; followup: ↓ 13 Changed 3 years ago by
Replying to jhpalmieri:
I have one computer on which I can recreate the selfreferential symlink
To clarify: which selfreferential symlink do you mean? You are talking about sagenb here, but #26152 was about local/share/mathjax/mathjax
.
comment:9 Changed 3 years ago by
On the affected machine, can you post the output of
find local name mathjax  xargs ls ld
comment:10 Changed 3 years ago by
There is certainly something fishy here. On a clean install of sage:
$ find local name mathjax xargs ls ld drwxrxrx 7 jdemeyer jdemeyer 4096 Nov 5 13:22 local/lib/python2.7/sitepackages/sagenb/data/mathjax lrwxrwxrwx 1 jdemeyer jdemeyer 44 Nov 5 13:22 local/lib/python2.7/sitepackages/sagenb/data/mathjax/mathjax > /usr/local/src/sagegit/local/share/mathjax/ lrwxrwxrwx 1 jdemeyer jdemeyer 43 Nov 5 10:19 local/share/jupyter/nbextensions/mathjax > /usr/local/src/sagegit/local/share/mathjax drwxrxrx 7 jdemeyer jdemeyer 4096 Sep 27 07:21 local/share/mathjax
The local/lib/python2.7/sitepackages/sagenb/data/mathjax/mathjax
symlink looks wrong to me.
comment:11 Changed 3 years ago by
I'll create a patch based on what you said in 6
comment:12 Changed 3 years ago by
The actual problem is that something went wrong with the latest sagenb packaging: #26641.
comment:13 in reply to: ↑ 8 Changed 3 years ago by
Replying to jdemeyer:
Replying to jhpalmieri:
I have one computer on which I can recreate the selfreferential symlink
To clarify: which selfreferential symlink do you mean? You are talking about sagenb here, but #26152 was about
local/share/mathjax/mathjax
.
I mean the one SAGE_LOCAL/share/mathjax/mathjax
that points to SAGE_LOCAL/share/mathjax
. Forceinstalling sagenb
on that machine recreates this link.
comment:14 followup: ↓ 16 Changed 3 years ago by
 Dependencies set to #26641
Can you run find local name mathjax  xargs ls ld
on that machine? And then check whether #26641 fixes the issue?
comment:15 Changed 3 years ago by
$ find local name mathjax  xargs ls ld lrwxrxrx 1 jpalmier staff 64 Oct 3 09:58 local/lib/python2.7/sitepackages/sagenb/data/mathjax > /Users/jpalmier/Desktop/Sage_stuff/git/sage/local/share/mathjax/ lrwxrxrx 1 jpalmier staff 63 Nov 3 11:45 local/share/jupyter/nbextensions/mathjax > /Users/jpalmier/Desktop/Sage_stuff/git/sage/local/share/mathjax drwxrxrx 14 jpalmier staff 448 Nov 5 10:12 local/share/mathjax lrwxrxrx 1 jpalmier staff 64 Nov 5 10:12 local/share/mathjax/mathjax > /Users/jpalmier/Desktop/Sage_stuff/git/sage/local/share/mathjax/
comment:16 in reply to: ↑ 14 Changed 3 years ago by
Replying to jdemeyer:
Can you run
find local name mathjax  xargs ls ld
on that machine? And then check whether #26641 fixes the issue?
It fixes the issue in the sense that if I delete the bad symlink, then running ./sage f sagenb
does not recreate it, whereas forcing installation of sagenb1.1.0 does recreate it. You know the following already: it doesn't fix the issue in the sense that if the bad symlink is present, it is not deleted, and if the docs have been built with the bad symlink, therefore using up way too much disk space, that problem is not cleaned up.
comment:17 followup: ↓ 18 Changed 3 years ago by
 Milestone changed from sage8.5 to sageduplicate/invalid/wontfix
 Resolution set to duplicate
 Status changed from needs_work to closed
#26612 looks good, so I think we can close this.
comment:18 in reply to: ↑ 17 Changed 3 years ago by
comment:19 Changed 3 years ago by
And should there be a doctest that detects whether the symlink is there, so we know quickly if this problem ever reoccurs?
comment:20 Changed 3 years ago by
Sorry, I meant #26641.
comment:21 Changed 3 years ago by
 Resolution duplicate deleted
 Status changed from closed to new
I agree with John: #26641 is only a partial fix.
comment:22 Changed 3 years ago by
I'm not really sure what else you want to do here. If someone feels like they're being affected by this they can do an rm rf local/share/doc/sage
and rebuild.
comment:23 Changed 3 years ago by
What about the people who are affected but don't realize it?
By the way, they also need to delete local/share/mathjax/mathjax
. Should make docclean
delete this link?
comment:24 Changed 3 years ago by
 Milestone changed from sageduplicate/invalid/wontfix to sage8.5
comment:25 Changed 3 years ago by
 Priority changed from blocker to major
New commits:
trac 26612: remove bad mathjax symlink and any resulting bad mathjax directories.