haskell-infra / hackage-trustees

Issue tracker for Hackage maintainance and trustee operations
https://hackage.haskell.org/packages/trustees/
42 stars 7 forks source link

Don't repair install-plans of `alex` ! #321

Closed andreasabel closed 2 years ago

andreasabel commented 2 years ago

alex < 3.2.2 is listed as broken on matrix.hackage.

Screenshot 2021-11-11 at 22 16 06

E.g. the build log for https://matrix.hackage.haskell.org/#/package/alex/3.2.1/ghc-8.2.2@1616116046 says:

Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
 - alex-3.2.1 {alex-3.2.1-inplace} (exe:alex) (first run)
...
Preprocessing executable 'alex' for alex-3.2.1..
setup: The program 'happy' is required but it could not be found

Maybe the fix is to add build-tools: happy. However, this could have been omitted on purpose. Note that instead the tarball contains preprocessed versions of the lexer (.x) and parser (.y) definitions:

dist
└── build
    └── alex
        └── alex-tmp
            ├── Parser.hs
            └── Scan.hs
src
├── AbsSyn.hs
...
├── Parser.y
├── Scan.hs
├── Scan.x
...

So maybe alex-3.2.1 was relying on the preprocessed versions to be picked up by cabal?

P.S.: How auspicious, getting issue number #321 to repair alex-3.2.1. :)

phadej commented 2 years ago

They cannot be repaired, even you get happy available (by having it in PATH, which matrix doesn't so we catch missing build-tool-depends):

alex-3.2.1 master % cabal build -w ghc-8.0.2
Resolving dependencies...
Build profile: -w ghc-8.0.2 -O1
In order, the following will be built (use -v for more details):
 - alex-3.2.1 (exe:alex) (first run)
[1 of 1] Compiling Main             ( /codetmp/alex/alex-3.2.1/dist-newstyle/build/x86_64-linux/ghc-8.0.2/alex-3.2.1/setup/setup.hs, /codetmp/alex/alex-3.2.1/dist-newstyle/build/x86_64-linux/ghc-8.0.2/alex-3.2.1/setup/Main.o )
Linking /codetmp/alex/alex-3.2.1/dist-newstyle/build/x86_64-linux/ghc-8.0.2/alex-3.2.1/setup/setup ...
Configuring alex-3.2.1...
Preprocessing executable 'alex' for alex-3.2.1...
alex: /codetmp/alex/alex-3.2.1/././AlexTemplate-ghc: openFile: does not exist (No such file or directory)

The build-type: Custom Setup.hs is not working. Later alex are build-type: Simple.

FYI: build-tool-depends can (should) have version range.

andreasabel commented 2 years ago

Thanks for the insight, @phadej !

Based on the verdict The program 'happy' is required but it could not be found I did the following experiment on alex-3.2.1:

Following these results, I revised alex-3.2.1, only to see matrix.hackage failing with a different error:

setup: The program 'alex' is required but it could not be found

Well, I still had alex in my PATH, which poisoned my experiment.

So, I am going to undo my revision.

Also, in the light of https://github.com/haskell/cabal/issues/7808 I am no longer sure what the FAIL(pkg) verdict of matrix.hackage means. Because the following experiments might have different outcome.

  1. cabal install alex-NNN (remote installation)
  2. cabal get alex-NNN; cd alex-NNN; cabal install (local installation)
  3. cabal get alex-NNN; cd alex-NNN; cabal build (local build)
  4. In principle, installing alex-NNN as a build-tool dependency could have even have another semantics than the above three.

Perhaps matrix.hackage should make the setup of its experiment explicit, so its verdicts can be interpreted more precisely.

phadej commented 2 years ago

alex needing alex is exactly why https://github.com/simonmar/alex/pull/120 was done. Repairing build-type: Custom alexes are not worth your time.

andreasabel commented 2 years ago

I wrote:

So, I am going to undo my revision.

So I thought, but looks I went down a one-way street. My attempt to revert the revision is failing with:

Cannot remove existing legacy-tool dependency on 'happy' in executable 'alex' component

Well, extensionally my revision did not make much of a difference..., so this is not a catastrophy.

P.S.: How auspicious, getting issue number #321 to repair alex-3.2.1. :)

Yeah, not so auspicious... (More like famous last words...) :-D