From 0657080896c29b1b4372c049aac5b8148f73e5d7 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Tue, 14 Aug 2018 15:33:26 +0300 Subject: [PATCH] Correct PackageIdentifier->PackageName (fixes #4215) --- src/Stack/Build/ConstructPlan.hs | 3 ++- test/integration/tests/4215-missing-unregister/Main.hs | 6 ++++++ .../tests/4215-missing-unregister/files/.gitignore | 1 + .../tests/4215-missing-unregister/files/stack1.yaml | 3 +++ .../tests/4215-missing-unregister/files/stack2.yaml | 3 +++ .../tests/4215-missing-unregister/files/v1/package.yaml | 7 +++++++ .../tests/4215-missing-unregister/files/v2/package.yaml | 7 +++++++ 7 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 test/integration/tests/4215-missing-unregister/Main.hs create mode 100644 test/integration/tests/4215-missing-unregister/files/.gitignore create mode 100644 test/integration/tests/4215-missing-unregister/files/stack1.yaml create mode 100644 test/integration/tests/4215-missing-unregister/files/stack2.yaml create mode 100644 test/integration/tests/4215-missing-unregister/files/v1/package.yaml create mode 100644 test/integration/tests/4215-missing-unregister/files/v2/package.yaml diff --git a/src/Stack/Build/ConstructPlan.hs b/src/Stack/Build/ConstructPlan.hs index 40e7698edf..77c824f7ae 100644 --- a/src/Stack/Build/ConstructPlan.hs +++ b/src/Stack/Build/ConstructPlan.hs @@ -321,7 +321,8 @@ mkUnregisterLocal tasks dirtyReason localDumpPkgs sourceMap initialBuildSteps = -- None of the above, keep it! | otherwise = Nothing where - name = displayC ident + name :: PackageName + name = pkgName ident -- | Given a 'LocalPackage' and its 'lpTestBench', adds a 'Task' for -- running its tests and benchmarks. diff --git a/test/integration/tests/4215-missing-unregister/Main.hs b/test/integration/tests/4215-missing-unregister/Main.hs new file mode 100644 index 0000000000..83056eb580 --- /dev/null +++ b/test/integration/tests/4215-missing-unregister/Main.hs @@ -0,0 +1,6 @@ +import StackTest + +main :: IO () +main = do + stack ["build", "--stack-yaml", "stack1.yaml"] + stack ["build", "--stack-yaml", "stack2.yaml"] diff --git a/test/integration/tests/4215-missing-unregister/files/.gitignore b/test/integration/tests/4215-missing-unregister/files/.gitignore new file mode 100644 index 0000000000..0afa51175a --- /dev/null +++ b/test/integration/tests/4215-missing-unregister/files/.gitignore @@ -0,0 +1 @@ +foo.cabal diff --git a/test/integration/tests/4215-missing-unregister/files/stack1.yaml b/test/integration/tests/4215-missing-unregister/files/stack1.yaml new file mode 100644 index 0000000000..ec89cd2774 --- /dev/null +++ b/test/integration/tests/4215-missing-unregister/files/stack1.yaml @@ -0,0 +1,3 @@ +resolver: ghc-8.2.2 +packages: +- v1 diff --git a/test/integration/tests/4215-missing-unregister/files/stack2.yaml b/test/integration/tests/4215-missing-unregister/files/stack2.yaml new file mode 100644 index 0000000000..6a7f4b6532 --- /dev/null +++ b/test/integration/tests/4215-missing-unregister/files/stack2.yaml @@ -0,0 +1,3 @@ +resolver: ghc-8.2.2 +packages: +- v2 diff --git a/test/integration/tests/4215-missing-unregister/files/v1/package.yaml b/test/integration/tests/4215-missing-unregister/files/v1/package.yaml new file mode 100644 index 0000000000..7bcacfcb87 --- /dev/null +++ b/test/integration/tests/4215-missing-unregister/files/v1/package.yaml @@ -0,0 +1,7 @@ +name: foo +version: 1 + +dependencies: +- base + +library: {} diff --git a/test/integration/tests/4215-missing-unregister/files/v2/package.yaml b/test/integration/tests/4215-missing-unregister/files/v2/package.yaml new file mode 100644 index 0000000000..e49b4fdc65 --- /dev/null +++ b/test/integration/tests/4215-missing-unregister/files/v2/package.yaml @@ -0,0 +1,7 @@ +name: foo +version: 2 + +dependencies: +- base + +library: {}