Fix ghc-pkg when only prof way is enabled
authorZejun Wu <watashi@fb.com>
Sun, 28 Oct 2018 16:38:07 +0000 (12:38 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 28 Oct 2018 17:40:17 +0000 (13:40 -0400)
Summary:
We saw following errors:

```
$ cabal install --disable-library-vanilla --disable-shared --enable-library-profiling
hashable-1.2.7.0: cannot find any of
["libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.a",
 "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.p_a",
 "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.so",
 "libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.dylib",
 "HShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ-ghc8.4.3.dll"]
```

This is because ghc-pkg is looking for
`libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ.p_a` instead of
`libHShashable-1.2.7.0-Q2TKVDwk4GBEHmizb4teZ_p.a`.

Test Plan: ./validate

Reviewers: simonmar, bgamari

Reviewed By: simonmar

Subscribers: rwbarton, carter

Differential Revision: https://phabricator.haskell.org/D5234

testsuite/tests/cabal/ghcpkg03.stderr
testsuite/tests/cabal/ghcpkg03.stderr-mingw32
testsuite/tests/cabal/ghcpkg05.stderr
testsuite/tests/cabal/ghcpkg05.stderr-mingw32
utils/ghc-pkg/Main.hs

index 31eb7ec..5fa8770 100644 (file)
@@ -7,7 +7,7 @@ testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which
 testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring)
-testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX.p_a","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20150825.dll"] on library path (ignoring)
+testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20150825.dll"] on library path (ignoring)
 testpkg-2.0: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory
 testpkg-2.0: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory
 testpkg-2.0: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring)
@@ -18,7 +18,7 @@ testpkg-2.0: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
 testpkg-2.0: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
 testpkg-2.0: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring)
 testpkg-2.0: cannot find any of ["C/E.hi","C/E.p_hi","C/E.dyn_hi"] (ignoring)
-testpkg-2.0: cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX.p_a","libtestpkg-2.0-XXX-ghc7.11.20150825.so","libtestpkg-2.0-XXX-ghc7.11.20150825.dylib","testpkg-2.0-XXX-ghc7.11.20150825.dll"] on library path (ignoring)
+testpkg-2.0: cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX_p.a","libtestpkg-2.0-XXX-ghc7.11.20150825.so","libtestpkg-2.0-XXX-ghc7.11.20150825.dylib","testpkg-2.0-XXX-ghc7.11.20150825.dll"] on library path (ignoring)
 testpkg-1.2.3.4: Warning: library-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory
 testpkg-1.2.3.4: Warning: include-dirs: /usr/local/include/testpkg doesn't exist or isn't a directory
 testpkg-1.2.3.4: import-dirs: /usr/local/lib/testpkg doesn't exist or isn't a directory (ignoring)
@@ -28,4 +28,4 @@ testpkg-1.2.3.4: include-dirs: c:/Program Files/testpkg is a relative path which
 testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"] (ignoring)
-testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX.p_a","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20150825.dll"] on library path (ignoring)
+testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20150825.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20150825.dll"] on library path (ignoring)
index 23ae5fd..612c93c 100644 (file)
@@ -7,7 +7,7 @@ testpkg-1.2.3.4: include-dirs: /usr/local/include/testpkg is a relative path whi
 testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["C\\D.hi","C\\D.p_hi","C\\D.dyn_hi"] (ignoring)
-testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX.p_a","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20151217.dll"] on library path (ignoring)
+testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20151217.dll"] on library path (ignoring)
 testpkg-2.0: Warning: library-dirs: c:/Program Files/testpkg doesn't exist or isn't a directory
 testpkg-2.0: Warning: include-dirs: c:/Program Files/testpkg doesn't exist or isn't a directory
 testpkg-2.0: import-dirs: /usr/local/lib/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
@@ -18,7 +18,7 @@ testpkg-2.0: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
 testpkg-2.0: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
 testpkg-2.0: cannot find any of ["C\\D.hi","C\\D.p_hi","C\\D.dyn_hi"] (ignoring)
 testpkg-2.0: cannot find any of ["C\\E.hi","C\\E.p_hi","C\\E.dyn_hi"] (ignoring)
-testpkg-2.0: cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX.p_a","libtestpkg-2.0-XXX-ghc7.11.20151217.so","libtestpkg-2.0-XXX-ghc7.11.20151217.dylib","testpkg-2.0-XXX-ghc7.11.20151217.dll"] on library path (ignoring)
+testpkg-2.0: cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX_p.a","libtestpkg-2.0-XXX-ghc7.11.20151217.so","libtestpkg-2.0-XXX-ghc7.11.20151217.dylib","testpkg-2.0-XXX-ghc7.11.20151217.dll"] on library path (ignoring)
 testpkg-1.2.3.4: Warning: library-dirs: c:/Program Files/testpkg doesn't exist or isn't a directory
 testpkg-1.2.3.4: Warning: include-dirs: c:/Program Files/testpkg doesn't exist or isn't a directory
 testpkg-1.2.3.4: import-dirs: /usr/local/lib/testpkg is a relative path which makes no sense (as there is nothing for it to be relative to). You can make paths relative to the package database itself by using ${pkgroot}. (ignoring)
@@ -28,4 +28,4 @@ testpkg-1.2.3.4: include-dirs: /usr/local/include/testpkg is a relative path whi
 testpkg-1.2.3.4: cannot find any of ["A.hi","A.p_hi","A.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["B.hi","B.p_hi","B.dyn_hi"] (ignoring)
 testpkg-1.2.3.4: cannot find any of ["C\\D.hi","C\\D.p_hi","C\\D.dyn_hi"] (ignoring)
-testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX.p_a","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20151217.dll"] on library path (ignoring)
+testpkg-1.2.3.4: cannot find any of ["libtestpkg-1.2.3.4-XXX.a","libtestpkg-1.2.3.4-XXX_p.a","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.so","libtestpkg-1.2.3.4-XXX-ghc7.11.20151217.dylib","testpkg-1.2.3.4-XXX-ghc7.11.20151217.dll"] on library path (ignoring)
index 80d65ec..e93bf17 100644 (file)
@@ -9,7 +9,7 @@ There are problems in package testpkg-2.0:
   cannot find any of ["B.hi","B.p_hi","B.dyn_hi"]
   cannot find any of ["C/D.hi","C/D.p_hi","C/D.dyn_hi"]
   cannot find any of ["C/E.hi","C/E.p_hi","C/E.dyn_hi"]
-  cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX.p_a","libtestpkg-2.0-XXX-ghc7.11.20150825.so","libtestpkg-2.0-XXX-ghc7.11.20150825.dylib","testpkg-2.0-XXX-ghc7.11.20150825.dll"] on library path
+  cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX_p.a","libtestpkg-2.0-XXX-ghc7.11.20150825.so","libtestpkg-2.0-XXX-ghc7.11.20150825.dylib","testpkg-2.0-XXX-ghc7.11.20150825.dll"] on library path
 
 The following packages are broken, either because they have a problem
 listed above, or because they depend on a broken package.
index e500990..bbbea8d 100644 (file)
@@ -9,7 +9,7 @@ There are problems in package testpkg-2.0:
   cannot find any of ["B.hi","B.p_hi","B.dyn_hi"]
   cannot find any of ["C\\D.hi","C\\D.p_hi","C\\D.dyn_hi"]
   cannot find any of ["C\\E.hi","C\\E.p_hi","C\\E.dyn_hi"]
-  cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX.p_a","libtestpkg-2.0-XXX-ghc7.11.20151217.so","libtestpkg-2.0-XXX-ghc7.11.20151217.dylib","testpkg-2.0-XXX-ghc7.11.20151217.dll"] on library path
+  cannot find any of ["libtestpkg-2.0-XXX.a","libtestpkg-2.0-XXX_p.a","libtestpkg-2.0-XXX-ghc7.11.20151217.so","libtestpkg-2.0-XXX-ghc7.11.20151217.dylib","testpkg-2.0-XXX-ghc7.11.20151217.dll"] on library path
 
 The following packages are broken, either because they have a problem
 listed above, or because they depend on a broken package.
index 9cbeb3a..34b28b1 100644 (file)
@@ -1999,7 +1999,7 @@ checkDuplicateDepends deps
 checkHSLib :: Verbosity -> [String] -> String -> Validate ()
 checkHSLib _verbosity dirs lib = do
   let filenames = ["lib" ++ lib ++ ".a",
-                   "lib" ++ lib ++ ".p_a",
+                   "lib" ++ lib ++ "_p.a",
                    "lib" ++ lib ++ "-ghc" ++ Version.version ++ ".so",
                    "lib" ++ lib ++ "-ghc" ++ Version.version ++ ".dylib",
                             lib ++ "-ghc" ++ Version.version ++ ".dll"]