language-python icon indicating copy to clipboard operation
language-python copied to clipboard

Breaking changes in Happy 2.0

Open bramvdbogaerde opened this issue 1 year ago • 1 comments

I got the following error while trying to build the language-python package:

dist/build/Language/Python/Version3/Parser/Parser.hs:7562:4: error: [GHC-83865]
    • Couldn't match type ‘Happy_GHC_Exts.Int32#’
                     with ‘Happy_GHC_Exts.Int#’
      Expected: Happy_Int
        Actual: Happy_GHC_Exts.Int32#
    • In the expression: Happy_GHC_Exts.indexInt32OffAddr# arr off
      In an equation for ‘happyIndexOffAddr’:
          happyIndexOffAddr (HappyA# arr) off
            = (Happy_GHC_Exts.indexInt32OffAddr# arr off)
     |
7562 |   (Happy_GHC_Exts.indexInt32OffAddr# arr off)
     |    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Error: cabal: Failed to build language-python-0.5.8 (which is required by
test-project-0.0.0). See the build log above for details.

which has started to happen as of today right after the release of a new version of the happy parser generator. I am not sure if this is an intented breaking change from the developers of happy or that this is a bug. Nonetheless, I suggest to limit the version of happy <2 so that the new version is not used when building language-python.

Build environment

  • ghc: 9.6.6
  • cabal: 3.10.3.0
  • hackage index state: 2024-09-20T11:02:23Z

Steps to reproduce

cabal.project:

with-compiler: ghc-9.6.6
index-state: 2024-09-20T11:02:23Z

packages:
   .

testproject.cabal:

cabal-version: 1.12

name: test-project
version: 0.0.0
build-type:     Simple

library
   hs-source-dirs:
      src
   build-depends:
        base >=4.17 && <5
      , language-python

Run: cabal build to observe the error.

bramvdbogaerde avatar Sep 20 '24 11:09 bramvdbogaerde

For an unclear reason the reported Haskell version in the __GLASGOW_HASKELL__ macro is redefined as GHC version 7.9 in Parser.y for both parsers. This causes a missing type conversion from a Int32# to an Int#.

bramvdbogaerde avatar Sep 25 '24 12:09 bramvdbogaerde

Just ran into this as well.

ocramz avatar Feb 04 '25 04:02 ocramz

Any news on this @bjpop? PR #79 also resolves this issue.

bramvdbogaerde avatar Feb 20 '25 12:02 bramvdbogaerde

I've merged PR https://github.com/bjpop/language-python/pull/79 into Main now.

Sorry for the delay.

Please test if you have a chance.

bjpop avatar Jun 06 '25 12:06 bjpop

Thanks! Seems to work.

bramvdbogaerde avatar Jun 07 '25 12:06 bramvdbogaerde

Any plan for a release? (not a user, but just asking for Stackage)

juhp avatar Jul 16 '25 02:07 juhp

The dependencies probably still need to be updated before release (cf. #82) so that it is not in conflict with other package in Stackage.

bramvdbogaerde avatar Jul 16 '25 11:07 bramvdbogaerde