Use export list of Main module in function TcRnDriver.hs:check_main (Fix #16453)

- Provide the export list of the `Main` module as parameter to the
  `compiler/typecheck/TcRnDriver.hs:check_main` function.
- Instead of `lookupOccRn_maybe` call the function `lookupInfoOccRn`.
  It returns the list `mains_all` of all the main functions in scope.
- Select from this list `mains_all` all `main` functions that are in
  the export list of the `Main` module.
- If this new list contains exactly one single `main` function, then
  typechecking continues.
- Otherwise issue an appropriate error message.
23 jobs for master in 507 minutes and 46 seconds (queued for 6 seconds)
Status Job ID Name Coverage
  Lint
passed #290146
lint
lint-linters

00:00:13

passed #290149
lint
lint-submods-branch

00:00:16

passed #290147
lint
lint-testsuite

00:00:16

passed #290148
lint
typecheck-testsuite

00:00:14

 
  Quick Build
passed #290150
x86_64-linux
hadrian-ghc-in-ghci

00:08:41

 
  Build
passed #290151
x86_64-linux
validate-x86_64-linux-deb9-hadrian

03:09:27

 
  Full Build
failed #290154
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

04:50:06

passed #290155
armv7-linux
validate-armv7-linux-deb9

04:41:48

passed #290156
x86_64-linux
validate-i386-linux-deb9

01:34:54

failed #290163
new-x86_64-windows test allowed to fail
validate-i386-windows

passed #290153
x86_64-darwin
validate-x86_64-darwin

01:10:24

passed #290157
x86_64-linux
validate-x86_64-linux-deb9-debug

02:15:06

passed #290159
x86_64-linux
validate-x86_64-linux-deb9-dwarf

01:28:25

passed #290158
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

01:41:44

passed #290152
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian

04:41:47

passed #290160
x86_64-linux
validate-x86_64-linux-fedora27

02:02:33

failed #290162
new-x86_64-windows test allowed to fail
validate-x86_64-windows

failed #290161
new-x86_64-windows test allowed to fail
validate-x86_64-windows-hadrian

 
  Cleanup
passed #290164
x86_64-darwin
cleanup-darwin

00:00:20

 
  Packaging
failed #290165
x86_64-linux allowed to fail
doc-tarball

00:01:00

 
  Testing
manual #290166
x86_64-linux allowed to fail manual
hackage
passed #290167
x86_64-linux
perf-nofib

00:15:50

 
  Deploy
failed #290168
x86_64-linux allowed to fail
pages

00:01:45

 
Name Stage Failure
failed
pages Deploy
Entering 'libraries/xhtml'
Entering 'nofib'
Entering 'utils/haddock'
Entering 'utils/hsc2hs'
$ mkdir -p public/doc
$ tar -xf haddock.html.tar.xz -C public/doc
tar: haddock.html.tar.xz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now
ERROR: Job failed: exit code 1
failed
doc-tarball Packaging
Entering 'libraries/xhtml'
Entering 'nofib'
Entering 'utils/haddock'
Entering 'utils/hsc2hs'
Downloading artifacts for validate-x86_64-linux-deb9-debug (290157)...
Downloading artifacts from coordinator... ok id=290157 responseStatus=200 OK token=SmSsqU3-
$ if [ ! -f "$LINUX_BINDIST" ]; then # collapsed multi-line command
Error: ghc-x86_64-mingw32.tar.xz does not exist. Did the 64-bit Windows job fail?
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows Full Build There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log
failed
validate-x86_64-windows-hadrian Full Build There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log
failed
validate-aarch64-linux-deb9 Full Build
cd "libraries/stm/tests/T2411.run" && ./T2411   < 
=====> dataToExpQUnit(normal) 7375 of 7411 [0, 103, 8]
cd "libraries/template-haskell/tests/dataToExpQUnit.run" && "/builds/ghc/ghc/inplace/bin/ghc-stage2" -c dataToExpQUnit.hs -dcore-lint -dstg-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -Werror=compat -dno-debug-output -v0<
cd "libraries/stm/tests/stm065.run" && ./stm065 <
=====> signals001(normal) 7376 of 7411 [0, 103, 8]
cd "libraries/unix/tests/signals001.run" && "/builds/ghc/ghc/inplace/bin/ghc-stage2" -o signals001 signals001.hs -dcore-lint -dstg-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -Werror=compat -dno-debug-output -package unix -cpp<
cd "libraries/stm/tests/cloneTChan001.run" && ./cloneTChan001 <
=====> signals002(normal) 7377 of 7411 [0, 103, 8]
cd "libraries/unix/tests/signals002.run" && "/builds/ghc/ghc/inplace/bin/ghc-stage2" -o signals002 signals002.hs -dcore-lint -dstg-lint -dcmm-lint -no-user-package-db -rtsopts -fno-warn-missed-specialisations -fshow-warning-groups -fdiagnostics-color=never -fno-diagnostics-show-caret -Werror=compat -dno-debug-output -packa
Job's log exceeded limit of 16384000 bytes.
failed
validate-i386-windows Full Build There has been a timeout failure or the job got stuck. Check your timeout limits or try again
No job log