Open bgamari opened 2 hours ago
Huh that looks like an older bug that happened when the GHC unboxed number one was changing. I didn't think anything happened relative this since the last 1.x
release.
I can confirm that the same project builds with happy-1.20.1.1
.
@bgamari Can you diff the generated parsers?
@Ericson2314 see https://gist.github.com/bgamari/87c10deca02c86460f0935f511cae768.
Very strange. It must be this line from the template: https://github.com/haskell/happy/blob/1f92300fe148d46235707f069b639016c0e635d7/lib/data/HappyTemplate.hs#L127
But we test this code path quite extensively on GHC 9.6 and lower. Is there anything special about the architecture? 32 bit?
(The diff appears to be incomplete, btw. Not that it matters.)
That's because of https://github.com/bjpop/language-python/blob/8e0a43ddfd1b9e22d104ece01333706d0fe71e04/language-python/src/Language/Python/Version2/Parser/Parser.y#L4-L5
#undef __GLASGOW_HASKELL__
#define __GLASGOW_HASKELL__ 709
I've seen this ugly hack used in the wild more than once to work around https://github.com/haskell/happy/issues/109. For this particular instance see discussion at https://github.com/bjpop/language-python/issues/41.
Instead of #if __GLASGOW_HASKELL__ >= 901
we can check #if MIN_VERSION_base(4,15,0)
, which is equivalent, but immune to #undef __GLASGOW_HASKELL__
.
Using GHC 9.6.5.