
I am having some trouble building ghc on ubuntu. I have ghc 8.8.4 installed on the machine. I pulled from the main repository and followed the instructions here: https://gitlab.haskell.org/ghc/ghc/-/wikis/building/hadrian Building with: ./hadrian/build -j it builds for a long time until it finally fails with the message below. I would appreciate some advice on how to fix this. Thank you, Neo =========================== Exit code: 1 Stderr and Stdout: _build/stage1/compiler/build/GHC/Parser/Lexer.hs:3495:3: error: Variable not in scope: int16ToInt# :: Int# -> Int# | 3495 | int16ToInt# | ^^^^^^^^^^^ _build/stage1/compiler/build/GHC/Parser/Lexer.hs:3520:3: error: Variable not in scope: int32ToInt# :: Int# -> Int# | 3520 | int32ToInt# | ^^^^^^^^^^^ =========================== On that line (in Lexer.hs) we see: #if __GLASGOW_HASKELL__ >= 901 int16ToInt# #endif (indexInt16OffAddr# arr off) #endif so we are in the "then" clause and somehow "int16ToInt#" is nowhere to be found. -- Neo

Without having particular knowledge about this specific error: try upgrading `alex`, the tool that GHC uses to produce its lexer. It's possible a newer version of that tool will fix this problem. Richard
On Dec 23, 2020, at 1:37 PM, Neophytos Michael
wrote: I am having some trouble building ghc on ubuntu. I have ghc 8.8.4 installed on the machine. I pulled from the main repository and followed the instructions here: https://gitlab.haskell.org/ghc/ghc/-/wikis/building/hadrian https://gitlab.haskell.org/ghc/ghc/-/wikis/building/hadrian
Building with: ./hadrian/build -j
it builds for a long time until it finally fails with the message below. I would appreciate some advice on how to fix this.
Thank you, Neo
=========================== Exit code: 1 Stderr and Stdout: _build/stage1/compiler/build/GHC/Parser/Lexer.hs:3495:3: error: Variable not in scope: int16ToInt# :: Int# -> Int# | 3495 | int16ToInt# | ^^^^^^^^^^^
_build/stage1/compiler/build/GHC/Parser/Lexer.hs:3520:3: error: Variable not in scope: int32ToInt# :: Int# -> Int# | 3520 | int32ToInt# | ^^^^^^^^^^^ =========================== On that line (in Lexer.hs) we see:
#if __GLASGOW_HASKELL__ >= 901 int16ToInt# #endif (indexInt16OffAddr# arr off) #endif
so we are in the "then" clause and somehow "int16ToInt#" is nowhere to be found.
-- Neo
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Actually, your alex is /too/ new. See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4657. If you take the latest master, it will contain that, and your problem will be fixed. On 12/23/20 2:10 PM, Richard Eisenberg wrote:
Without having particular knowledge about this specific error: try upgrading `alex`, the tool that GHC uses to produce its lexer. It's possible a newer version of that tool will fix this problem.
Richard
On Dec 23, 2020, at 1:37 PM, Neophytos Michael
mailto:nmichael@gmail.com> wrote: I am having some trouble building ghc on ubuntu. I have ghc 8.8.4 installed on the machine. I pulled from the main repository and followed the instructions here: https://gitlab.haskell.org/ghc/ghc/-/wikis/building/hadrian https://gitlab.haskell.org/ghc/ghc/-/wikis/building/hadrian
Building with: ./hadrian/build -j
it builds for a long time until it finally fails with the message below. I would appreciate some advice on how to fix this.
Thank you, Neo
=========================== Exit code: 1 Stderr and Stdout: _build/stage1/compiler/build/GHC/Parser/Lexer.hs:3495:3: error: Variable not in scope: int16ToInt# :: Int# -> Int# | 3495 | int16ToInt# | ^^^^^^^^^^^
_build/stage1/compiler/build/GHC/Parser/Lexer.hs:3520:3: error: Variable not in scope: int32ToInt# :: Int# -> Int# | 3520 | int32ToInt# | ^^^^^^^^^^^ =========================== On that line (in Lexer.hs) we see:
#if __GLASGOW_HASKELL__ >= 901 int16ToInt# #endif (indexInt16OffAddr# arr off) #endif
so we are in the "then" clause and somehow "int16ToInt#" is nowhere to be found.
-- Neo
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org mailto:ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs

Thank you for that. After downgrading alex I was able to build ghc
properly.
By the way, is there a way from cabal to uninstall a package? I actually
had both versions of alex on my machine but somehow ghc would always pick
up the latest one. I couldn't find a way to uninstall alex, so I just gave
up and removed the entire cabal directory and reinstalled everything (which
fortunately wasn't much) plus the old version of alex.
Neo
On Wed, Dec 23, 2020 at 9:12 PM John Ericson
Actually, your alex is *too* new. See https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4657. If you take the latest master, it will contain that, and your problem will be fixed. On 12/23/20 2:10 PM, Richard Eisenberg wrote:
Without having particular knowledge about this specific error: try upgrading `alex`, the tool that GHC uses to produce its lexer. It's possible a newer version of that tool will fix this problem.
Richard
On Dec 23, 2020, at 1:37 PM, Neophytos Michael
wrote: I am having some trouble building ghc on ubuntu. I have ghc 8.8.4 installed on the machine. I pulled from the main repository and followed the instructions here: https://gitlab.haskell.org/ghc/ghc/-/wikis/building/hadrian
Building with: ./hadrian/build -j
it builds for a long time until it finally fails with the message below. I would appreciate some advice on how to fix this.
Thank you, Neo
=========================== Exit code: 1 Stderr and Stdout: _build/stage1/compiler/build/GHC/Parser/Lexer.hs:3495:3: error: Variable not in scope: int16ToInt# :: Int# -> Int# | 3495 | int16ToInt# | ^^^^^^^^^^^
_build/stage1/compiler/build/GHC/Parser/Lexer.hs:3520:3: error: Variable not in scope: int32ToInt# :: Int# -> Int# | 3520 | int32ToInt# | ^^^^^^^^^^^ =========================== On that line (in Lexer.hs) we see:
#if __GLASGOW_HASKELL__ >= 901 int16ToInt# #endif (indexInt16OffAddr# arr off) #endif
so we are in the "then" clause and somehow "int16ToInt#" is nowhere to be found.
-- Neo
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
_______________________________________________ ghc-devs mailing listghc-devs@haskell.orghttp://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
-- Neophytos
participants (3)
-
John Ericson
-
Neophytos Michael
-
Richard Eisenberg