jgm / skylighting

A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions
189 stars 61 forks source link

Build instructions for repo don't work #131

Closed andreasabel closed 3 years ago

andreasabel commented 3 years ago

The recent build-from-repo instructions (https://github.com/jgm/skylighting/commit/421132600b62845f00ced5344267775b4795df04) do not seem to work, at least not with a very recent cabal:

$ cd $PROJECT_ROOT
$ cabal install -fexecutable skylighting-core
Wrote tarball sdist to
$PROJECT_ROOT/dist-newstyle/sdist/skylighting-core-0.10.5.2.tar.gz
cabal: sdist of skylighting-0.10.5.2: Error: Could not find module:
Skylighting.Syntax.Comments with any suffix:
["gc","chs","hsc","x","y","ly","cpphs","hs","lhs","hsig","lhsig"]. If the
module is autogenerated it should be added to 'autogen-modules'.

It seems that recent cabal install too eagerly tries to generate the tarball for skylighting, when we did not get the chance to generate the necessary .hs files yet.

What worked for me is:

$ cd $PROJECT_ROOT/skylighting-core
$ cabal build -fexecutable

This ends with printing the absolute path to a generated executable, say $EXE.

$ ln -s $EXE $HOME/.cabal/bin
$ cd ../skylighting
$ skylighting-extract ../skylighting-core/xml/*.xml
$ cabal install -fexecutable

So, except for the first cabal install, the instructions worked.

jgm commented 3 years ago

Thanks. I'll update the docs accordingly!

jgm commented 3 years ago

Actually what would be ideal is to change skylighting-extract so that it can be run simply with cabal run. Maybe the easiest way to do this would be to let the executable take two parameters: the first, for the xml files to extract, the second, for the directory containing skylighting.cabal. Of course if we did this, it would be good to also

jgm commented 3 years ago

Probably not worth the effort though -- I think I'll just update the docs and leave it at that.