Sven Tennie pushed to branch wip/romes/hadrian-cross-stage2-rebase_SVEN_FINAL at Glasgow Haskell Compiler / GHC

Commits:

2 changed files:

Changes:

  • testsuite/tests/haddock/haddock_testsuite/Makefile
    ... ... @@ -26,6 +26,7 @@ htmlTest:
    26 26
     	./html-test \
    
    27 27
     		$(ACCEPT) \
    
    28 28
     		--ghc-path='$(TEST_HC)' \
    
    29
    +		--ghc-pkg-path='$(GHC_PKG)' \
    
    29 30
     		--haddock-path='$(HADDOCK)' \
    
    30 31
     
    
    31 32
     # Corresponds to the `latex-test` testsuite
    
    ... ... @@ -41,6 +42,7 @@ latexTest:
    41 42
     	./latex-test \
    
    42 43
     		$(ACCEPT) \
    
    43 44
     		--ghc-path='$(TEST_HC)' \
    
    45
    +		--ghc-pkg-path='$(GHC_PKG)' \
    
    44 46
     		--haddock-path='$(HADDOCK)' \
    
    45 47
     
    
    46 48
     # Corresponds to the `hoogle-test` testsuite
    
    ... ... @@ -56,6 +58,7 @@ hoogleTest:
    56 58
     	./hoogle-test \
    
    57 59
     		$(ACCEPT) \
    
    58 60
     		--ghc-path='$(TEST_HC)' \
    
    61
    +		--ghc-pkg-path='$(GHC_PKG)' \
    
    59 62
     		--haddock-path='$(HADDOCK)' \
    
    60 63
     
    
    61 64
     # Corresponds to the `hypsrc-test` testsuite
    
    ... ... @@ -71,6 +74,7 @@ hypsrcTest:
    71 74
     	./hypsrc-test \
    
    72 75
     		$(ACCEPT) \
    
    73 76
     		--ghc-path='$(TEST_HC)' \
    
    77
    +		--ghc-pkg-path='$(GHC_PKG)' \
    
    74 78
     		--haddock-path='$(HADDOCK)' \
    
    75 79
     
    
    76 80
     .PHONY: haddockForeignTest
    

  • utils/haddock/haddock-test/src/Test/Haddock/Config.hs
    ... ... @@ -110,6 +110,7 @@ data Flag
    110 110
         = FlagHaddockPath FilePath
    
    111 111
         | FlagHaddockOptions String
    
    112 112
         | FlagGhcPath FilePath
    
    113
    +    | FlagGhcPkgPath FilePath
    
    113 114
         | FlagDiffTool FilePath
    
    114 115
         | FlagNoDiff
    
    115 116
         | FlagAccept
    
    ... ... @@ -123,6 +124,9 @@ flagsHaddockPath flags = mlast [ path | FlagHaddockPath path <- flags ]
    123 124
     flagsGhcPath :: [Flag] -> Maybe FilePath
    
    124 125
     flagsGhcPath flags = mlast [ path | FlagGhcPath path <- flags ]
    
    125 126
     
    
    127
    +flagsGhcPkgPath :: [Flag] -> Maybe FilePath
    
    128
    +flagsGhcPkgPath flags = mlast [ path | FlagGhcPkgPath path <- flags ]
    
    129
    +
    
    126 130
     flagsHaddockOptions :: [Flag] -> [String]
    
    127 131
     flagsHaddockOptions flags = concat
    
    128 132
         [ words opts | FlagHaddockOptions opts <- flags ]
    
    ... ... @@ -140,6 +144,8 @@ options =
    140 144
             "additional options to run Haddock with"
    
    141 145
         , Option [] ["ghc-path"] (ReqArg FlagGhcPath "FILE")
    
    142 146
             "path ghc executable"
    
    147
    +    , Option [] ["ghc-pkg-path"] (ReqArg FlagGhcPkgPath "FILE")
    
    148
    +        "path to ghc-pkg executable"
    
    143 149
         , Option [] ["diff-tool"] (ReqArg FlagDiffTool "PATH")
    
    144 150
             "diff tool to use when printing failed cases"
    
    145 151
         , Option ['a'] ["accept"] (NoArg FlagAccept)
    
    ... ... @@ -217,7 +223,7 @@ loadConfig ccfg dcfg flags files = do
    217 223
             , pure ["--optghc=-w"]
    
    218 224
             , pure ["--optghc=-hide-all-packages"]
    
    219 225
             , pure $ flagsHaddockOptions flags
    
    220
    -        , baseDependencies cfgGhcPath
    
    226
    +        , baseDependencies cfgGhcPath (flagsGhcPkgPath flags)
    
    221 227
             ]
    
    222 228
     
    
    223 229
         cfgDiffTool <- if FlagNoDiff `elem` flags
    
    ... ... @@ -248,14 +254,14 @@ printVersions env haddockPath = do
    248 254
         void $ waitForSuccess "Failed to run `haddock --ghc-version`" stderr handleGhc
    
    249 255
     
    
    250 256
     
    
    251
    -baseDependencies :: FilePath -> IO [String]
    
    252
    -baseDependencies ghcPath = do
    
    257
    +baseDependencies :: FilePath -> Maybe FilePath -> IO [String]
    
    258
    +baseDependencies ghcPath ghcPkgPath = do
    
    253 259
         -- The 'getInstalledPackages' crashes if used when "GHC_PACKAGE_PATH" is
    
    254 260
         -- set to some value. I am not sure why is that happening and what are the
    
    255 261
         -- consequences of unsetting it - but looks like it works (for now).
    
    256 262
         unsetEnv "GHC_PACKAGE_PATH"
    
    257 263
     
    
    258
    -    (comp, _, cfg) <- configure normal (Just ghcPath) Nothing
    
    264
    +    (comp, _, cfg) <- configure normal (Just ghcPath) ghcPkgPath
    
    259 265
             defaultProgramDb
    
    260 266
         pkgIndex <- getInstalledPackages normal comp Nothing [GlobalPackageDB] cfg
    
    261 267
         let