Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
andreasabel opened this issue Nov 11, 2021 · 4 comments
Closed

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

andreasabel opened this issue Nov 11, 2021 · 4 comments
Assignees
Labels
build-tools Build problems caused by build-tools

Comments

@andreasabel
Copy link
Contributor

andreasabel commented Nov 11, 2021

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
Copy link
Member

phadej commented Nov 12, 2021

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
Copy link
Contributor Author

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:

  • I removed my happy
  • cabal get alex-3.2.1
  • cd alex-3.2.1
  • cabal --storedir=$PWD install -w ghc-8.2.2 then failed with the same error (missing happy)
  • I added build-tool: happy to alex-3.2.1 and retried install
  • This succeeded, installing happy locally on the way

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 haskell/cabal#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
Copy link
Member

phadej commented Nov 12, 2021

alex needing alex is exactly why haskell/alex#120 was done. Repairing build-type: Custom alexes are not worth your time.

@andreasabel
Copy link
Contributor Author

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

@andreasabel andreasabel changed the title Repair install-plans of alex Don't repair install-plans of alex ! Nov 14, 2021
@andreasabel andreasabel self-assigned this Nov 14, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build-tools Build problems caused by build-tools
Projects
None yet
Development

No branches or pull requests

2 participants