Skip to content

Build tool not rerun when build tool version changes #11411

@andreasabel

Description

@andreasabel

Reproducer using cabal-3.16.1.0 (latest release):

Step 1: using alex-3.4

cabal get java-adt-1.0.20251105
cd java-adt-*
cabal build -c 'any.alex==3.4.*'

This errors:

dist-newstyle/build/aarch64-osx/ghc-9.8.4/java-adt-1.1/x/java-adt/build/java-adt/java-adt-tmp/Lexer.hs:771:25: error: [GHC-87543]
    Ambiguous occurrence ‘fromString’.
    It could refer to
       either ‘String1.fromString’,
              imported from ‘String1’ at src/Lexer.x:3:26-35,
           or ‘GHC.Exts.fromString’,
              imported from ‘GHC.Exts’ at dist-newstyle/build/aarch64-osx/ghc-9.8.4/java-adt-1.1/x/java-adt/build/java-adt/java-adt-tmp/Lexer.hs:20:1-15
              (and originally defined in ‘Data.String’).
    |
771 | alex_action_21 = TkId . fromString
    |                         ^^^^^^^^^^

(Cf. https://hackage.haskell.org/package/java-adt-1.0.20251105/reports/2)

Step 2: using alex-3.5

cabal build -c 'any.alex==3.5.*'

Still fails with the same error.

Step 3: using alex-3.5 after cleaning

rm -rf dist-newstyle
cabal build -c 'any.alex==3.5.*'

Succeeds.

This shows that Lexer.hs is not regenerated by alex when its version is changed.
This is an unsoundness in the "recompilation" checker of cabal.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions