alex icon indicating copy to clipboard operation
alex copied to clipboard

How to build `alex` from git sources? Instructions in `README.md` are broken.

Open andreasabel opened this issue 2 years ago • 3 comments

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.

andreasabel avatar Jan 22 '22 15:01 andreasabel

Ah sorry this is annoying

  1. 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.

  2. 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.

Ericson2314 avatar Jan 23 '22 06:01 Ericson2314

What's the status on this? It seems to still be broken.

BridgeTheMasterBuilder avatar Sep 21 '23 16:09 BridgeTheMasterBuilder

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.

andreasabel avatar Sep 26 '23 14:09 andreasabel