On Tue, Jun 28, 2016 at 6:38 PM, Erik Bray <erik.m.b...@gmail.com> wrote:
> On Tue, Jun 28, 2016 at 6:19 PM, Erik Bray <erik.m.b...@gmail.com> wrote:
>> Hi all,
>>
>> As Luca just pointed out to me, and I also noticed on my own earlier
>> this morning, the web interface on git.sagemath.org is bugging out and
>> not displaying file contents.  E.g.:
>> https://git.sagemath.org/sage.git/tree/README.md?h=develop
>>
>> Curiously it shows the correct number of line numbers, but not the
>> lines themselves.  Clicking the "plain" link does display the file
>> contents.  So it's not a problem with reading the repository, but
>> seems like maybe a bug with cgit, the software that generates these
>> pages.  Viewing diffs works fine.
>>
>> I don't know when this started or if it's related to the server
>> migration.  I suspect it may be; IIRC I installed cgit from the apt
>> repository on the new server.  It may be a bug in an older version of
>> cgit that is now fixed.  A very bad bug though so it's strange--I feel
>> like there must be more to it.
>
> No, I misremembered--checking my notes and confirming on the server, I
> did install cgit from source from a more recent version.  The version
> of Ubuntu currently running on the server does not have cgit in its
> repository (some newer versions do though).

Fixed.  There were several issues here:

1) cgit allows configuring filters to pass source text through before
outputting them to the HTML source.  In particular, it includes a
filter for adding syntax highlighting, syntax-highlight.sh.  Because
of the simplistic design of the cgit.cgi executable, the only way for
it to know where its source filter lives is a setting in the
/etc/cgitrc config file.  Our /etc/cgitrc previously pointed to a path
under /usr/lib, but I installed cgit under /usr/local, so the path in
/etc/cgitrc was incorrect.

2) The syntax-highlighting.sh script that cgit comes with uses the
`highlight` program, which was not installed on the server.

3) I find this unfortunate, but cgit's ./configure does not actually
check for the `highlight` program; I think it probably should.  And it
does not detect the version of `highlight` being used.  Apparently
syntax-highlight.sh requires manual editing depending on what version
of `highlight` you have installed (2.x or 3.x).  Unfortunate--should
be fixed.  I had to manually edit the file for this reason.

4) After fixing all of the above the source code is displayed at
least, but not the actual syntax highlighting.  This is because it is
also necessary to add some CSS to the cgit.css file.  The appropriate
CSS is output by the `highlight` program itself, but is not
automatically included in the CSS of the page.  I would consider this
a bug in cgit, though I understand why it is the way it is currently.

All in all a bit of pain.  I am adding this to my documentation.  All
the more reason to build a container for deploying this site, has
Harald has done for the wiki :)

Erik

-- 
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 post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to