summaryrefslogtreecommitdiff
path: root/utils/ghc-pkg/Main.hs
Commit message (Collapse)AuthorAgeFilesLines
...
* Package keys (for linking/type equality) separated from package IDs.Edward Z. Yang2014-08-051-13/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch set makes us no longer assume that a package key is a human readable string, leaving Cabal free to "do whatever it wants" to allocate keys; we'll look up the PackageId in the database to display to the user. This also means we have a new level of qualifier decisions to make at the package level, and rewriting some Safe Haskell error reporting code to DTRT. Additionally, we adjust the build system to use a new ghc-cabal output Make variable PACKAGE_KEY to determine library names and other things, rather than concatenating PACKAGE/VERSION as before. Adds a new `-this-package-key` flag to subsume the old, erroneously named `-package-name` flag, and `-package-key` to select packages by package key. RFC: The md5 hashes are pretty tough on the eye, as far as the file system is concerned :( ToDo: safePkg01 test had its output updated, but the fix is not really right: the rest of the dependencies are truncated due to the fact the we're only grepping a single line, but ghc-pkg is wrapping its output. ToDo: In a later commit, update all submodules to stop using -package-name and use -this-package-key. For now, we don't do it to avoid submodule explosion. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonpj, simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D80
* Support ghc-pkg --ipid to query package ID.Edward Z. Yang2014-07-281-34/+56
| | | | | | | | | | | | Summary: Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: hvr, simonmar, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D98
* Module reexports, fixing #8407.Edward Z. Yang2014-07-251-1/+54
| | | | | | | | | | | | | | | | | | | | | | | | | The general approach is to add a new field to the package database, reexported-modules, which considered by the module finder as possible module declarations. Unlike declaring stub module files, multiple reexports of the same physical package at the same name do not result in an ambiguous import. Has submodule updates for Cabal and haddock. NB: When a reexport renames a module, that renaming is *not* accessible from inside the package. This is not so much a deliberate design choice as for implementation expediency (reexport resolution happens only when a package is in the package database.) TODO: Error handling when there are duplicate reexports/etc is not very well tested. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Conflicts: compiler/main/HscTypes.lhs testsuite/.gitignore utils/haddock
* Documentation for substringCheck.Edward Z. Yang2014-07-211-0/+22
| | | | Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
* [ghc-pkg] Fix #5442 by using the flag db stack to modify packages.Edward Z. Yang2014-07-211-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously, the full database stack was used for ghc-pkg to modify packages, which meant that commands like 'ghc-pkg unregister --user' worked the same as 'ghc-pkg unregister'. Since package modification is a "read and write" operation, we should use the flag db stack (which is currently used for reads) to determine which database to update. There is also a new flag --user-package-db, which lets you explicitly set the user database (as seen by --user). This was mostly added to aid in testing, but could be useful for end users as well. Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu> Test Plan: validate Reviewers: simonmar, hvr, austin Subscribers: simonmar, relrod, carter Differential Revision: https://phabricator.haskell.org/D84
* ghc-pkg register/update --enable-multi-instanceAustin Seipp2014-07-021-13/+36
| | | | | | | | | | | | | | | | | | | | | Summary: New flag to ghc-pkg register/update to lift the restriction on multiple instances of the same package version being in a db at once. Lifting the restriction is easy. The tricky bit is checking ghc does something sensible, but from the reading of the code it should treat such instances the same way it does with multiple instances between multiple DBs. We'll also need a way to unregister by installed package id. Test Plan: need to test that ghc is doing what we expect, at least if you use it like -hide-all-packages -package-id this -package-id that Reviewers: ezyang, simonmar Reviewed By: simonmar Subscribers: relrod Projects: #ghc Differential Revision: https://phabricator.haskell.org/D32
* Avoid NondecreasingIndentation syntax in ghc-pkgHerbert Valerio Riedel2014-05-151-30/+30
| | | | | | | | | This also makes ghc-pkg.cabal `default-extensions`-free NB: Printing this commit via `git show --ignore-all-spaces` shows the only non-whitespaces changes are in `ghc-pkg.cabal` Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Remove LANGUAGE pragrams implied by Haskell2010Herbert Valerio Riedel2014-05-141-1/+1
| | | | | | | | | Haskell2010 implies (at least) EmptyDataDecls, ForeignFunctionInterface, PatternGuards, DoAndIfThenElse, and RelaxedPolyRec. This is a follow-up to dd92e2179e3171a0630834b773c08d416101980d Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
* Fix AMP warnings.Austin Seipp2013-09-111-0/+8
| | | | | Authored-by: David Luposchainsky <dluposchainsky@gmail.com> Signed-off-by: Austin Seipp <austin@well-typed.com>
* Fix ghc-pkg list --simple-output not being alphabetical (#8245).Niklas Hambüchen2013-09-061-8/+9
| | | | | | | | | It was sorted by version number so far. I also added a sort to the normal output (without --simple-output) since the source it comes from does not guarantee sortedness. Signed-off-by: Austin Seipp <aseipp@pobox.com>
* Update the package database directory's timestamps when rebuilding the ↵Geoffrey Mainland2013-06-241-0/+4
| | | | | | | | | | package cache. I was seeing many "WARNING: cache is out of date" errors during validation claiming that my package cache was out of date. This patch eliminates those errors by ensuring that when we rebuild the package cache, the modification time of the directory containing the package database is set to be the same as the modification time of the cache.
* When verbose, give more information about cache statusIan Lynagh2013-05-301-17/+35
|
* Small refactoring in ghc-pkgIan Lynagh2013-04-281-6/+4
|
* Remove some old "backwards compatibility" codeIan Lynagh2013-04-281-24/+4
| | | | | | It was marked as "backwards compatibility" in 2006, so I think can be removed now. It allowed using old field names when looking at fields with ghc-pkg.
* Make "ghc-pkg field pkg field --simple-output" do something usefulIan Lynagh2013-04-281-16/+20
| | | | It used to just ignore the --simple-output flag
* Stop using the deprecated System.CmdIan Lynagh2013-02-151-2/+1
|
* Make ghc-pkg print less on error.Ben Millwood2012-11-301-5/+6
|
* fix typo, courtesy of Jon Cave, thanks!Gabor Greif2012-11-081-1/+1
|
* Make "ghc-pkg check" check for prof and dyn ways, as well as vanillaIan Lynagh2012-10-251-17/+23
| | | | | In particular, this fixes it if we are using dynamic libraries by default and don't build the vanilla way.
* Remove an outdated commentIan Lynagh2012-10-251-1/+1
|
* ghc-pkg: Print something when no packages are found; fixes #6119Ian Lynagh2012-10-111-1/+4
| | | | | | | | | | We used to say $ ghc-pkg list blargle /usr/local/lib/ghc-7.4.1/package.conf.d which may imply that blargle was found in /usr/local/lib/ghc-7.4.1/package.conf.d
* ghc-pkg: restore -no-user-package-conf flag.Paolo Capriotti2012-07-181-0/+2
|
* improve the --help docs a bit (#7008)Simon Marlow2012-07-021-4/+6
|
* Accept -package-conf so cabal-install worksIan Lynagh2012-05-271-1/+1
| | | | | Really we ought to support all the old flags, but warn that they are deprecated.
* Don't use stdcall on Win64: It isn't supported; ccall is used insteadIan Lynagh2012-05-161-1/+11
|
* Rename package-conf flags to package-db.Paolo Capriotti2012-05-151-10/+10
| | | | | | | | Rename package database flags in both GHC and ghc-pkg so that they are consistent with Cabal nomenclature. Add a version check to the build system so that the correct set of package db flags are used when the bootstrapping GHC has version < 7.5.
* ghc-pkg: make sure info messages go to stdout and errors to stderr (#3818)Paolo Capriotti2012-03-081-30/+40
|
* Fix ghc-pkg's quoting of the pkgroot fieldIan Lynagh2011-06-191-1/+1
|
* SafeHaskell: Add trust flag to packagesDavid Terei2011-06-171-2/+20
|
* Fix parsing "$topdir" in package configIan Lynagh2011-06-101-18/+20
| | | | It was only working when followed by something, e.g. "$topdir/base".
* Fix buildIan Lynagh2011-06-091-1/+1
|
* Fix for $topdir appearing in the haddock-html fieldDuncan Coutts2011-06-091-1/+2
| | | | | I'd naively assumed that the haddock-html field would only use the $httptopdir variable. Hopefully this will fix the windows build.
* ghc-pkg: report parser warnings when registering packagesDuncan Coutts2011-05-251-4/+11
|
* Provide the pkgroot value in ghc-pkg dump & describe when necessaryDuncan Coutts2011-05-251-40/+84
| | | | | | | | | | | | | | | | | | | | | | Tools handling installed packages need to be able to interpret the paths which are relative to the ${pkgroot} which means they need to know the value of ${pkgroot}. With ghc-pkg this is not always obvious since ghc-pkg does not currently have any way machine interface for reporting the location of its package dbs (global, user). The solution we have arrived at is simply to emit the pkgroot as an extra field when it is needed. There are two cases: * --no-expand-pkgroot: ghc-pkg dump/describe will not expand the ${pkgroot} var, so it will appear literally in the output and the pkgroot field will be generated so that tools know what value to use for the ${pkgroot}. * --expand-pkgroot: ghc-pkg dump/describe will expand the ${pkgroot} and ${pkgrooturl} vars and will not generate the pkgroot field. The defaults are: * ghc-pkg dump/describe --no-expand-pkgroot * ghc-pkg field --expand-pkgroot
* Add stricter ghc-pkg checks on package file/dir/url fieldsDuncan Coutts2011-05-251-10/+25
| | | | | | | The haddock-html and haddock-interface fields are now checked as well. Had to fix up ghc-cabal as it used relative paths for the inplace package's haddock-html. It turns out that these were never used so it could simply be omitted.
* Implement ${pkgroot} spec, allows relocatable registered packagesDuncan Coutts2011-05-251-51/+100
| | | | | | | | | | | | | | Historically ghc implemented relocatable packages by allowing "$topdir" in the package registration info and having ghc expand this with its notion of $topdir. The topdir refers to where ghc itself is installed (specifically the libdir). The ${pkgroot} spec takes this idea and makes it portable. (http://www.haskell.org/pipermail/libraries/2009-May/011772.html) Instead of paths relative to where ghc is installed, they can be relative to the package database itself. Thus it is no longer a ghc-specific idea and can work for package collections other than the global package db.
* Deprecate the ghc-pkg --auto-ghci-libs flagDuncan Coutts2011-05-251-0/+3
| | | | | | It was never a universal solution. It only worked with the GNU linker. It has not been used by Cabal for ages. GHCi can now load .a files so it will not be needed in future.
* ghc-pkg: don't expand ${name}-style env vars by defaultDuncan Coutts2011-05-251-4/+12
| | | | | | | | | | | | | For shell-based build systems the feature is still available as: ghc-pkg register --expand-env-vars Historically, ghc-pkg allowed environment variables to appear in the input files for ghc-pkg register. They are not stored in the package database but are expanded upon registration. This feature helped for build systems based on makefiles and shell scripts. These days the vast majority of such files are generated by Cabal and we don't want any ${name} strings (e.g. perhaps in a package description) getting accidentally interpreted as an environment variable.
* Unicode fixes, taking into account PEP383 supportMax Bolingbroke2011-05-141-10/+11
|
* Replace uses of the old try function with the new oneIan Lynagh2010-12-181-4/+6
|
* Replace uses of the old catch function with the new oneIan Lynagh2010-12-181-6/+6
|
* Remove more dead code now we require GHC >= 6.12Ian Lynagh2010-12-151-71/+3
|
* Remove the no-ghci-lib warning in ghc-pkgIan Lynagh2010-11-271-7/+4
| | | | | GHCi libs are no longer necessary, as we can use the .a or .so versions instead.
* Remove ghc-pkg's dependency on haskell98Ian Lynagh2010-10-131-3/+1
|
* Fix build on Windows: ghc-pkg/Main.hs needs ForeignFunctionInterfaceIan Lynagh2010-10-121-1/+1
|
* Fix build following haskell98 and -fglasgow-exts changesIan Lynagh2010-10-061-1/+1
|
* Fix build: Add newline to end of ghc-pkg/Main.hsIan Lynagh2010-08-011-1/+1
|
* ghc-pkg: don't fail, if a file is already removedich@christoph-bauer.net2010-07-251-4/+10
|
* Remove an unnecessary #includeIan Lynagh2010-07-151-2/+0
|
* Simplify some more CPP __GLASGOW_HASKELL__ testsIan Lynagh2010-07-151-10/+1
|