alex
alex copied to clipboard
How to build `alex` from git sources? Instructions in `README.md` are broken.
https://github.com/simonmar/alex/blob/e4843f22818451299acd3620042b151ad2294ace/README.md#L51-L57 Nope:
$ cabal install
Error: cabal: sdist of alex-3.2.7: filepath wildcard 'src/Parser.y.boot' does
not match any files.
https://github.com/simonmar/alex/blob/e4843f22818451299acd3620042b151ad2294ace/README.md#L59-L66 Again, sorry, no (even with the correct tarball location):
$ make sdist
...
Wrote tarball sdist to
./dist-newstyle/sdist/alex-3.2.7.tar.gz
...
$ cabal install ./dist-newstyle/sdist/alex-3.2.7.tar.gz
Error: cabal: Unknown target './dist-newstyle/sdist/alex-3.2.7.tar.gz'.
The package alex has no file target 'dist-newstyle/sdist/alex-3.2.7.tar.gz'.
The Makefile
goals work though, e.g., I can run the tests locally with make sdist-test
.
Ah sorry this is annoying
-
cabal install dist/alex-*.tar.gz
I think fails because this was removed in v2-build or something, just a guess. At least I am pretty sure I took it from the old readme when reformatting and I assume it once worked. -
Error: cabal: sdist of alex-3.2.7: filepath wildcard 'src/Parser.y.boot' does not match any files.
sounds like something got messed up with the build system overhauls. I think I can fix.
What's the status on this? It seems to still be broken.
This should work from the project root (semi-tested):
ROOT=$PWD
TMP=$(mktemp -d)
make sdist
cd $TMP
cabal get $ROOT/dist-newstyle/sdist/alex-*
cd alex-*
cabal install
cd $ROOT
rm -rf $TMP
If the root didn't have a cabal.project
, one could do without switching to a temporary directory.