Unverified Commit 3f397c0c authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub
Browse files

Merge pull request #7099 from phadej/pr-6972-extra-packages

Pr 6972 extra packages
parents d28c80ac 5c9b65be
......@@ -2680,16 +2680,22 @@ pruneInstallPlanPass1 pkgs =
setDocumentation
$ addOptionalStanzas elab
find_root (InstallPlan.Configured (PrunedPackage elab _)) =
if not $ and [ null (elabConfigureTargets elab)
, null (elabBuildTargets elab)
, null (elabTestTargets elab)
, null (elabBenchTargets elab)
, isNothing (elabReplTarget elab)
, null (elabHaddockTargets elab)
]
then Just (installedUnitId elab)
else Nothing
is_root :: PrunedPackage -> Maybe UnitId
is_root (PrunedPackage elab _) =
if not $ and [ null (elabConfigureTargets elab)
, null (elabBuildTargets elab)
, null (elabTestTargets elab)
, null (elabBenchTargets elab)
, isNothing (elabReplTarget elab)
, null (elabHaddockTargets elab)
]
then Just (installedUnitId elab)
else Nothing
find_root (InstallPlan.Configured pkg) = is_root pkg
-- When using the extra-packages stanza we need to
-- look at installed packages as well.
find_root (InstallPlan.Installed pkg) = is_root pkg
find_root _ = Nothing
-- Note [Sticky enabled testsuites]
......
# cabal v2-update
Downloading the latest package list from test-local-repo
# cabal v2-run
Resolving dependencies...
Build profile: -w ghc-<GHCVER> -O1
In order, the following will be built:
- some-exe-0.0.1.0 (exe:some-exe) (requires build)
Configuring some-exe-0.0.1.0...
Preprocessing executable 'some-exe' for some-exe-0.0.1.0..
Building executable 'some-exe' for some-exe-0.0.1.0..
Installing executable some-exe in <PATH>
Warning: The directory <ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>/incoming/new-<RAND><ROOT>/cabal.dist/home/.cabal/store/ghc-<GHCVER>/<PACKAGE>-<HASH>/bin is not in the system search path.
import Test.Cabal.Prelude
main = cabalTest $ withRepo "repo" $ do
cabal "v2-run" [ "some-exe" ]
name: my
version: 0.1
license: BSD3
cabal-version: >= 1.2
build-type: Simple
library
exposed-modules: Foo
build-depends: base
module Main where
main :: IO ()
main = putStrLn "hello world"
name: some-exe
version: 0.0.1.0
license: BSD3
cabal-version: >= 1.2
build-type: Simple
Executable some-exe
main-is: Main.hs
build-depends: base
......@@ -27,10 +27,13 @@ normalizeOutput nenv =
. resub "Installing (.+) in .+" "Installing \\1 in <PATH>"
-- Things that look like libraries
. resub "libHS[A-Za-z0-9.-]+\\.(so|dll|a|dynlib)" "<LIBRARY>"
-- look for PackageHash directories
. resub "/(([A-Za-z0-9_]+)(-[A-Za-z0-9\\._]+)*)-[0-9a-f]{4,64}/"
"/<PACKAGE>-<HASH>/"
-- This is dumb but I don't feel like pulling in another dep for
-- string search-replace. Make sure we do this before backslash
-- normalization!
. resub (posixRegexEscape (normalizerGblTmpDir nenv) ++ "[a-z0-9.-]+") "<GBLTMPDIR>" -- note, after TMPDIR
. resub (posixRegexEscape (normalizerGblTmpDir nenv) ++ "[a-z0-9\\.-]+") "<GBLTMPDIR>" -- note, after TMPDIR
. resub (posixRegexEscape (normalizerRoot nenv)) "<ROOT>/"
. resub (posixRegexEscape (normalizerTmpDir nenv)) "<TMPDIR>/"
. appEndo (F.fold (map (Endo . packageIdRegex) (normalizerKnownPackages nenv)))
......@@ -39,6 +42,9 @@ normalizeOutput nenv =
-- Apply this before packageIdRegex, otherwise this regex doesn't match.
. resub "[0-9]+(\\.[0-9]+)*/installed-[A-Za-z0-9.+]+"
"<VERSION>/installed-<HASH>"
-- incoming directories in the store
. resub "/incoming/new-[0-9]+"
"/incoming/new-<RAND>"
-- Normalize architecture
. resub (posixRegexEscape (display (normalizerPlatform nenv))) "<ARCH>"
-- Some GHC versions are chattier than others
......
synopsis: Make extra-packages work properly
packages: cabal-install
prs: #6972
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment