haskell / happy

The Happy parser generator for Haskell
Other
276 stars 84 forks source link

Unable to boot GHC with master branch due to bwd-incompatible changes #166

Closed osa1 closed 4 years ago

osa1 commented 4 years ago

Unfortunately I lost the error logs now, but if I install happy from the master branch I can't boot GHC, I get type errors in Parser.hs.

I'll try to try this again and paste the logs.

I can boot GHC just fine using happy from Hackage so I'm guessing this due to an unintentional backwards compatibility breaking change. Please feel free to close if this is intentional.

simonmar commented 4 years ago

There weren't any intentional breakages that I'm aware of. What was the error?

osa1 commented 4 years ago
happy command ``` "/home/omer/bin/happy" -agc --strict compiler/parser/Parser.y -o compiler/stage1/build/Parser.hs ```
GHC command ``` "/home/omer/ghc_bins/ghc-8.6.4-bin/bin/ghc" -hisuf hi -osuf o -hcsuf hc -static -O0 -H64m -Wall -Iincludes -Iincludes/dist -Iincludes/dist-derivedconstants/header -Iincludes/dist-ghcconstants/header -package-db libraries/bootstrapping.conf -this-unit-id ghc-8.11.0.20200113 -hide-all-packages -i -icompiler/. -icompiler/backpack -icompiler/basicTypes -icompiler/cmm -icompiler/coreSyn -icompiler/deSugar -icompiler/ghci -icompiler/iface -icompiler/llvmGen -icompiler/main -icompiler/nativeGen -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/simplCore -icompiler/specialise -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/stage1/build -Icompiler/stage1/build -icompiler/stage1/build/./autogen -Icompiler/stage1/build/./autogen -Icompiler/. -Icompiler/utils -Icompiler/stage1 -Icompiler/stage1/build/. -Icompiler/stage1/build/utils -Icompiler/stage1/build/stage1 -optP-Iincludes/dist/build -optP-include -optPcompiler/stage1/build/./autogen/cabal_macros.h -package-id array-0.5.3.0 -package-id base-4.12.0.0 -package-id binary-0.8.7.0 -package-id bytestring-0.10.8.2 -package-id containers-0.6.0.1 -package-id deepseq-1.4.4.0 -package-id directory-1.3.3.0 -package-id filepath-1.4.2.1 -package-id ghc-boot-8.11.0.20200113 -package-id ghc-boot-th-8.11.0.20200113 -package-id ghc-heap-8.11.0.20200113 -package-id ghci-8.11.0.20200113 -package-id hpc-0.6.1.0 -package-id process-1.6.5.0 -package-id template-haskell-2.16.0.0 -package-id terminfo-0.4.1.4 -package-id time-1.8.0.2 -package-id transformers-0.5.6.2 -package-id unix-2.7.2.2 -Wall -Wno-name-shadowing -Wnoncanonical-monad-instances -Wnoncanonical-monoid-instances -this-unit-id ghc -XHaskell2010 -XNoImplicitPrelude -Iincludes/dist/build -Rghc-timing -O2 -Wcpp-undef -no-user-package-db -rtsopts -O0 -fno-ignore-interface-pragmas -fcmm-sink -outputdir compiler/stage1/build -c compiler/stage1/build/Parser.hs -o compiler/stage1/build/Parser.o ```
Error ``` compiler/stage1/build/Parser.hs:2347:24: error: Not in scope: ‘Prelude.*’ No module named ‘Prelude’ is imported. | 2347 | bit_start = st Prelude.* 481 | ^^^^^^^^^ compiler/stage1/build/Parser.hs:2348:23: error: Not in scope: ‘Prelude.+’ No module named ‘Prelude’ is imported. | 2348 | bit_end = (st Prelude.+ 1) Prelude.* 481 | ^^^^^^^^^ compiler/stage1/build/Parser.hs:2348:36: error: Not in scope: ‘Prelude.*’ No module named ‘Prelude’ is imported. | 2348 | bit_end = (st Prelude.+ 1) Prelude.* 481 | ^^^^^^^^^ compiler/stage1/build/Parser.hs:2350:16: error: Not in scope: ‘Prelude.map’ Perhaps you meant ‘GhcPrelude.map’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 2350 | bits = Prelude.map read_bit [bit_start..bit_end Prelude.- 1] | ^^^^^^^^^^^ compiler/stage1/build/Parser.hs:2350:57: error: Not in scope: ‘Prelude.-’ No module named ‘Prelude’ is imported. | 2350 | bits = Prelude.map read_bit [bit_start..bit_end Prelude.- 1] | ^^^^^^^^^ compiler/stage1/build/Parser.hs:2351:24: error: Not in scope: ‘Prelude.zip’ Perhaps you meant ‘GhcPrelude.zip’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 2351 | bits_indexed = Prelude.zip bits [0..480] | ^^^^^^^^^^^ compiler/stage1/build/Parser.hs:2352:31: error: Not in scope: ‘Prelude.concatMap’ Perhaps you meant ‘GhcPrelude.concatMap’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 2352 | token_strs_expected = Prelude.concatMap f bits_indexed | ^^^^^^^^^^^^^^^^^ compiler/stage1/build/Parser.hs:2353:12: error: Not in scope: data constructor ‘Prelude.False’ Perhaps you meant ‘GhcPrelude.False’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 2353 | f (Prelude.False, _) = [] | ^^^^^^^^^^^^^ compiler/stage1/build/Parser.hs:2354:12: error: Not in scope: data constructor ‘Prelude.True’ Perhaps you meant ‘GhcPrelude.True’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 2354 | f (Prelude.True, nr) = [token_strs Prelude.!! nr] | ^^^^^^^^^^^^ compiler/stage1/build/Parser.hs:2354:44: error: Not in scope: ‘Prelude.!!’ Perhaps you meant ‘GhcPrelude.!!’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 2354 | f (Prelude.True, nr) = [token_strs Prelude.!! nr] | ^^^^^^^^^^ compiler/stage1/build/Parser.hs:3191:24: error: Not in scope: type constructor or class ‘Prelude.Int’ Perhaps you meant ‘GhcPrelude.Int’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 3191 | happy_n_terms = 152 :: Prelude.Int | ^^^^^^^^^^^ compiler/stage1/build/Parser.hs:3192:27: error: Not in scope: type constructor or class ‘Prelude.Int’ Perhaps you meant ‘GhcPrelude.Int’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 3192 | happy_n_nonterms = 315 :: Prelude.Int | ^^^^^^^^^^^ compiler/stage1/build/Parser.hs:12257:48: error: Not in scope: type constructor or class ‘Prelude.Int’ Perhaps you meant ‘GhcPrelude.Int’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 12257 | happyReduceArr :: () => Happy_Data_Array.Array Prelude.Int (Happy_GHC_Exts.Int# -> (Located Token) -> Happy_GHC_Exts.Int# -> Happy_IntList -> HappyStk (HappyAbsSyn ) -> P (HappyAbsSyn )) | ^^^^^^^^^^^ compiler/stage1/build/Parser.hs:12263:43: error: Not in scope: type constructor or class ‘Prelude.String’ Perhaps you meant ‘GhcPrelude.String’ (imported from GhcPrelude) No module named ‘Prelude’ is imported. | 12263 | happyError' :: () => (((Located Token)), [Prelude.String]) -> P a | ^^^^^^^^^^^^^^ ```
int-index commented 4 years ago

That's due to the interaction between #156 and NoImplicitPrelude. Can be fixed by adding import qualified Prelude.

simonmar commented 4 years ago

@osa1 would you like to add the import qualified Prelude to GHC? It shouldn't break earlier Happy versions. Really we shouldn't have been relying on Happy to provide import qualified Prelude in GHC anyway.

osa1 commented 4 years ago

https://gitlab.haskell.org/ghc/ghc/merge_requests/2625