summaryrefslogtreecommitdiff
path: root/ghc/utils/ghc-pkg
Commit message (Collapse)AuthorAgeFilesLines
* Reorganisation of the source treeSimon Marlow2006-04-073-1299/+0
| | | | | | | | | | | | | | | Most of the other users of the fptools build system have migrated to Cabal, and with the move to darcs we can now flatten the source tree without losing history, so here goes. The main change is that the ghc/ subdir is gone, and most of what it contained is now at the top level. The build system now makes no pretense at being multi-project, it is just the GHC build system. No doubt this will break many things, and there will be a period of instability while we fix the dependencies. A straightforward build should work, but I haven't yet fixed binary/source distributions. Changes to the Building Guide will follow, too.
* Look for a package.conf.d directory containing per-package .conf filesSimon Marlow2006-03-131-2/+12
| | | | | | Contributed by Duncan Coutts, with changes to merge into the HEAD. This isn't the full deal, ghc-pkg still modifies files only, but it's enough to help the Gentoo folk along.
* catch up with changes to Distribution.ParseUtils.ParseResultSimon Marlow2006-02-071-1/+1
|
* [project @ 2005-11-25 09:56:59 by simonmar]simonmar2005-11-251-1/+15
| | | | sort packages by name and version in the 'ghc-pkg list' output
* [project @ 2005-11-08 14:18:35 by simonmar]simonmar2005-11-081-2/+6
| | | | | | | | when GHC_PACKAGE_PATH is set, treat the database at the bottom of the stack as the "global" one, ie. the one we modify by default. This means that GHC_PACKAGE_PATH can be used to set up a virtual GHC package environment into which packages can be installed using Cabal, without setting anything other than GHC_PACKAGE_PATH.
* [project @ 2005-11-05 00:23:36 by ross]ross2005-11-051-0/+4
| | | | fix for pre-6.0 ghc's
* [project @ 2005-11-04 15:48:25 by simonmar]simonmar2005-11-041-23/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | - Add support for the GHC_PACKAGE_PATH environment variable, which specifies a :-separated (;-separated on Windows) list of package database files. If the list ends in : (; on Windows), then the normal user and global databases are added. GHC_PACKAGE_PATH is searched left-to-right for packages, like $PATH, but unlike -package-conf flags, which are searched right-to-left. This isn't ideal, but it seemed the least worst to me (command line flags always override right-to-left (except -i), whereas the PATH environment variable overrides left-to-right, I chose to follow the environment variable convention). I can always change it if there's an outcry. - Rationalise the interpretation of --user, --global, and -f on the ghc-pkg command line. The story is now this: --user and --global say which package database to *act upon*, they do not change the shape of the database stack. -f pushes a database on the stack, and also requests that the specified database be the one to act upon, for commands that modify the database. If a database is already on the stack, then -f just selects it as the one to act upon. This means you can have a bunch of databases in GHC_PACKAGE_PATH, and use -f to select the one to modify.
* [project @ 2005-09-13 12:50:59 by simonmar]simonmar2005-09-131-4/+0
| | | | | | Never use an installed Cabal package when building GHC (except when bootstrapping in stages 2 & 3). This insulates us from changes the user may have made to their Cabal installation.
* [project @ 2005-08-03 09:34:55 by simonmar]simonmar2005-08-031-35/+28
| | | | | | | | | | | | | Tidyup, and make all the commands that take a package identifier behave the same. Previously, naming a package without a version number only matched the same package identifier, if you wanted to match multiple packages you had to say P-*. However, the new list and latest commands behave differently, which was inconsistent. I believe the previous behaviour was for backwards compatibility with packages that had no version number. However, it's unlikely that this is ever useful, so I've changed the semantics so that a package name on its own matches all versions of that package.
* [project @ 2005-08-03 09:13:32 by simonmar]simonmar2005-08-031-11/+52
| | | | | | | | | - Add "ghc-pkg list <pkg>" to list packages matching <pkg> - Add "ghc-pkg latest <pkg>" to show the latest version of <pkg> - Add --simple-output option to produce a more easily slurpable output from ghc-pkg list. Patch from Lennart Kolmodin <kolmodin at dtek.chalmers.se>
* [project @ 2005-08-01 15:25:09 by simonmar]simonmar2005-08-011-6/+0
| | | | Rmoeve a few lines that are provided by lib/compat/compat.mk
* [project @ 2005-06-16 09:45:28 by simonmar]simonmar2005-06-161-21/+2
| | | | | | | | Move the boilerplate Makefile code for using libghccompat.a into a shared .mk file, lib/compat/compat.mk. libghccompat.a is really a poor-mans package, but to make it a real package would mean dealing with variationg in the package support of different GHC versions, so this is easier for now.
* [project @ 2005-05-20 12:50:42 by simonmar]simonmar2005-05-201-61/+157
| | | | | | | | | | | | | | | | | | | Implement some more error checking to catch some cases where registering a package will lead to a package database containing conflicts, which would otherwise prevent GHC from being used without any -hide-package options. In 'update' mode, instead of complaining about conflicts, we now attempt to hide any packages which would cause a conflict. Previously this was limited to just older versions of the current package, now it applies to all packages which contain, or depend on packages which contain, modules which conflict with any module belonging to the current package or a dependency of it. Unfortunately we still can't cope with conflicts that cross the boundary between the user package databse and the global one. We will need some kind of white-out mechanism in order to be able to hide a global package in the user database.
* [project @ 2005-04-29 08:59:30 by simonmar]simonmar2005-04-291-84/+30
| | | | | Re-instate support for environment variable expansion and the -D flag. Now it is done pre-parsing, however.
* [project @ 2005-03-16 10:24:47 by simonmar]simonmar2005-03-161-3/+5
| | | | Further to previous patch: only create the user database if we're modifying
* [project @ 2005-03-16 10:18:28 by simonmar]simonmar2005-03-161-7/+9
| | | | | Be a bit less eager about creating the user database: now we only create it when explicitly asked to use it with --user.
* [project @ 2005-03-05 13:54:36 by panne]panne2005-03-051-0/+2
| | | | Clean up Version.hs for distclean target
* [project @ 2005-03-05 13:48:42 by panne]panne2005-03-052-5/+7
| | | | Warning police
* [project @ 2005-02-21 10:13:00 by simonmar]simonmar2005-02-211-1/+1
| | | | For some reason rev. 1.71 undid rev. 1.70. Restore it.
* [project @ 2005-02-18 15:06:38 by simonmar]simonmar2005-02-181-4/+4
| | | | | | | | | | | Rename fields in InstalledPackageInfo for consistency with PackageDescription & buildInfo: extra-libs (extraLibraries) --> extra-libraries (extraLibraries) extra-cc-opts (extraCcOpts) --> cc-options (ccOptions) extra-ld-opts (extraLdOpts) --> ld-options (ldOptions) extra-hugs-opts (extraHugsOpts) --> hugs-options (hugsOptions) extra-frameworks (extraFrameworks) --> frameworks (frameworks)
* [project @ 2005-02-15 16:41:25 by simonmar]simonmar2005-02-151-1/+1
| | | | Fix test in findPackages
* [project @ 2005-02-15 10:51:37 by simonmar]simonmar2005-02-151-69/+96
| | | | | | | | | | | | | Change in semantics: - commands which only inspect the databse (list,describe,field) now take into account the user database unless --global is given. This behaviour matches GHC, which also uses the user database by default. - However, commands which modify the database still use the global database, unless --user is given. Also, allow P-* to be given as a package identifier, which means "all versions of package P".
* [project @ 2005-02-14 10:33:58 by simonmar]simonmar2005-02-141-2/+2
| | | | | | Fix help text for ghc-pkg list to match the implementation (it was easier to do this than fix the implementation, and in fact this is more consistent).
* [project @ 2005-02-11 10:35:06 by simonmar]simonmar2005-02-111-12/+13
| | | | Allow package identifiers with versions in the old command-line syntax
* [project @ 2005-02-10 15:12:22 by simonmar]simonmar2005-02-101-0/+12
| | | | | Make sure we don't register a package with an identifier that cannot be parsed later.
* [project @ 2005-01-31 14:53:13 by simonpj]simonpj2005-01-311-0/+5
| | | | Compile utilities and lib/compat with GhcHcOpts, in case it is profiled
* [project @ 2005-01-28 12:55:17 by simonmar]simonmar2005-01-281-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rationalise the BUILD,HOST,TARGET defines. Recall that: - build is the platform we're building on - host is the platform we're running on - target is the platform we're generating code for The change is that now we take these definitions as applying from the point of view of the particular source code being built, rather than the point of view of the whole build tree. For example, in RTS and library code, we were previously testing the TARGET platform. But under the new rule, the platform on which this code is going to run is the HOST platform. TARGET only makes sense in the compiler sources. In practical terms, this means that the values of BUILD, HOST & TARGET may vary depending on which part of the build tree we are in. Actual changes: - new file: includes/ghcplatform.h contains platform defines for the RTS and library code. - new file: includes/ghcautoconf.h contains the autoconf settings only (HAVE_BLAH). This is so that we can get hold of these settings independently of the platform defines when necessary (eg. in GHC). - ghcconfig.h now #includes both ghcplatform.h and ghcautoconf.h. - MachRegs.h, which is included into both the compiler and the RTS, now has to cope with the fact that it might need to test either _TARGET_ or _HOST_ depending on the context. - the compiler's Makefile now generates stage{1,2,3}/ghc_boot_platform.h which contains platform defines for the compiler. These differ depending on the stage, of course: in stage2, the HOST is the TARGET of stage1. This was wrong before. - The compiler doesn't get platform info from Config.hs any more. Previously it did (sometimes), but unless we want to generate a new Config.hs for each stage we can't do this. - GHC now helpfully defines *_{BUILD,HOST}_{OS,ARCH} automatically in CPP'd Haskell source. - ghcplatform.h defines *_TARGET_* for backwards compatibility (ghcplatform.h is included by ghcconfig.h, which is included by config.h, so code which still #includes config.h will get the TARGET settings as before). - The Users's Guide is updated to mention *_HOST_* rather than *_TARGET_*. - coding-style.html in the commentary now contains a section on platform defines. There are further doc updates to come. Thanks to Wolfgang Thaller for pointing me in the right direction.
* [project @ 2005-01-27 12:55:15 by simonmar]simonmar2005-01-271-0/+4
| | | | bootstrapping wibbles
* [project @ 2005-01-27 12:16:51 by simonpj]simonpj2005-01-271-9/+18
| | | | Fix handling of dependent packages without a version
* [project @ 2005-01-27 10:44:00 by simonpj]simonpj2005-01-271-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -------------------------------------------- Replace hi-boot files with hs-boot files -------------------------------------------- This major commit completely re-organises the way that recursive modules are dealt with. * It should have NO EFFECT if you do not use recursive modules * It is a BREAKING CHANGE if you do ====== Warning: .hi-file format has changed, so if you are ====== updating into an existing HEAD build, you'll ====== need to make clean and re-make The details: [documentation still to be done] * Recursive loops are now broken with Foo.hs-boot (or Foo.lhs-boot), not Foo.hi-boot * An hs-boot files is a proper source file. It is compiled just like a regular Haskell source file: ghc Foo.hs generates Foo.hi, Foo.o ghc Foo.hs-boot generates Foo.hi-boot, Foo.o-boot * hs-boot files are precisely a subset of Haskell. In particular: - they have the same import, export, and scoping rules - errors (such as kind errors) in hs-boot files are checked You do *not* need to mention the "original" name of something in an hs-boot file, any more than you do in any other Haskell module. * The Foo.hi-boot file generated by compiling Foo.hs-boot is a machine- generated interface file, in precisely the same format as Foo.hi * When compiling Foo.hs, its exports are checked for compatibility with Foo.hi-boot (previously generated by compiling Foo.hs-boot) * The dependency analyser (ghc -M) knows about Foo.hs-boot files, and generates appropriate dependencies. For regular source files it generates Foo.o : Foo.hs Foo.o : Baz.hi -- Foo.hs imports Baz Foo.o : Bog.hi-boot -- Foo.hs source-imports Bog For a hs-boot file it generates similar dependencies Bog.o-boot : Bog.hs-boot Bog.o-boot : Nib.hi -- Bog.hs-boto imports Nib * ghc -M is also enhanced to use the compilation manager dependency chasing, so that ghc -M Main will usually do the job. No need to enumerate all the source files. * The -c flag is no longer a "compiler mode". It simply means "omit the link step", and synonymous with -no-link.
* [project @ 2005-01-26 16:03:40 by simonmar]simonmar2005-01-261-3/+0
| | | | | | | Common up the ghc_ge_XXX variables into config.mk, and add the ability to build ghc/lib and ghc/utils using the stage1 compiler, by saying 'make UseStage1=YES'. This is going to be useful for bootstrapping.
* [project @ 2005-01-26 15:04:08 by simonmar]simonmar2005-01-261-1/+1
| | | | Remove System.FilePath, use System.Directory.Internals for now.
* [project @ 2005-01-26 13:45:11 by simonmar]simonmar2005-01-261-1/+42
| | | | Avoid use of System.FilePath, which is going away
* [project @ 2005-01-21 11:04:39 by simonmar]simonmar2005-01-211-6/+9
| | | | Update the --help text
* [project @ 2005-01-20 16:15:02 by simonmar]simonmar2005-01-201-2/+4
| | | | ghc-pkg list: show hidden packages in parentheses
* [project @ 2005-01-20 14:22:19 by simonmar]simonmar2005-01-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fill in the haddock-interfaces and haddock-html fields in the package.conf files. To do this I had to make some changes: - haddock-interfaces requires the value of $(datadir). We can't just plug this in, because $(datadir) might change at install-time (eg. a Windows installer can be placed anywhere, as can a Unix binary .tar.gz distribution). The current trick is for the compiler to splice in the value of $libdir in package.conf at runtime. So we could extend this mechanism and tell the compiler the value of $datadir via a command-line option, but that seems ugly. On Windows, $datadir==$libdir, so we don't need any changes: package.conf still uses $libdir, and a Windows installation is independent of its absolute location. Even 'make install' on Windows should have this property. On Unix: - for 'make install' and in-place execution, we just use absolute paths in package.conf - for a binary dist, we generate a package.conf that refers to $libdir and $datadir, and splice in the values at install-time (distrib/Makefile-bin.in). - Also, I renamed $libdir to $topdir to more closely reflect its actual meaning. This is somewhat malicious in that it will flush out all those clients using $libdir when they really shouldn't be :-)
* [project @ 2005-01-12 13:44:20 by simonmar]simonmar2005-01-122-5/+3
| | | | Track removal of Distribution.Compat.Error.
* [project @ 2005-01-10 23:48:07 by krasimir]krasimir2005-01-101-20/+7
| | | | | | | | createDirectoryIfMissing is added to Compat.Directory and is used in ghc-pkg. The mingw32_HOST_OS is replaced with mingw32_TARGET_OS. I don't know why but prior the last commit the tool was working with mingw32_HOST_OS fine but not it isn't. Maybe I miss something. Simon, could you check whether the patch is fine?
* [project @ 2005-01-10 12:34:21 by simonmar]simonmar2005-01-101-44/+2
| | | | | Remove copied definitions for joinFileName, splitFileName: System.FilePath is in libghccompat now.
* [project @ 2005-01-08 16:37:09 by krasimir]krasimir2005-01-081-8/+5
| | | | | | | | system is replaced with rawSystem. This allows to use path names with embeded spaces under Windows. This is the same story as with hsc2hs but ghc-pkg is used only with GHC, so the change will not affect other compilers. Cabal uses "Program Files" as default installation path and this manifests the bug.
* [project @ 2005-01-06 15:10:21 by simonmar]simonmar2005-01-061-0/+1
| | | | Add Distribution.Compat to libghccompat
* [project @ 2004-12-03 16:25:58 by simonmar]simonmar2004-12-031-4/+4
| | | | Get rid of some `...' style quotes
* [project @ 2004-12-03 13:57:19 by simonmar]simonmar2004-12-031-21/+26
| | | | | - Implement expose/hide - fix parsing of package identifiers (forgot to commit this the other day)
* [project @ 2004-12-03 13:01:28 by simonmar]simonmar2004-12-031-2/+6
| | | | Support the --auto-ghci-libs option in conjuction with 'register'.
* [project @ 2004-12-01 09:51:50 by simonmar]simonmar2004-12-011-3/+8
| | | | Update the excluded modules for libghccompat
* [project @ 2004-11-26 16:50:56 by simonmar]simonmar2004-11-261-17/+25
| | | | | | | | unregister/describe: allow the package name to be given without the version, as long as it is unambiguous. Strange, I was sure I'd implemented expose/hide in here, but they're stubbed out. Oh well.
* [project @ 2004-11-26 16:19:45 by simonmar]simonmar2004-11-263-301/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Further integration with the new package story. GHC now supports pretty much everything in the package proposal. - GHC now works in terms of PackageIds (<pkg>-<version>) rather than just package names. You can still specify package names without versions on the command line, as long as the name is unambiguous. - GHC understands hidden/exposed modules in a package, and will refuse to import a hidden module. Also, the hidden/eposed status of packages is taken into account. - I had to remove the old package syntax from ghc-pkg, backwards compatibility isn't really practical. - All the package.conf.in files have been rewritten in the new syntax, and contain a complete list of modules in the package. I've set all the versions to 1.0 for now - please check your package(s) and fix the version number & other info appropriately. - New options: -hide-package P sets the expose flag on package P to False -ignore-package P unregisters P for this compilation For comparison, -package P sets the expose flag on package P to True, and also causes P to be linked in eagerly. -package-name is no longer officially supported. Unofficially, it's a synonym for -ignore-package, which has more or less the same effect as -package-name used to. Note that a package may be hidden and yet still be linked into the program, by virtue of being a dependency of some other package. To completely remove a package from the compiler's internal database, use -ignore-package. The compiler will complain if any two packages in the transitive closure of exposed packages contain the same module. You *must* use -ignore-package P when compiling modules for package P, if package P (or an older version of P) is already registered. The compiler will helpfully complain if you don't. The fptools build system does this. - Note: the Cabal library won't work yet. It still thinks GHC uses the old package config syntax. Internal changes/cleanups: - The ModuleName type has gone away. Modules are now just (a newtype of) FastStrings, and don't contain any package information. All the package-related knowledge is in DynFlags, which is passed down to where it is needed. - DynFlags manipulation has been cleaned up somewhat: there are no global variables holding DynFlags any more, instead the DynFlags are passed around properly. - There are a few less global variables in GHC. Lots more are scheduled for removal. - -i is now a dynamic flag, as are all the package-related flags (but using them in {-# OPTIONS #-} is Officially Not Recommended). - make -j now appears to work under fptools/libraries/. Probably wouldn't take much to get it working for a whole build.
* [project @ 2004-11-23 14:24:53 by simonmar]simonmar2004-11-231-0/+5
| | | | This should fix the build for GHC 6.3+
* [project @ 2004-11-22 17:00:54 by simonmar]simonmar2004-11-221-1/+11
| | | | Fix mkdependHS behaviour
* [project @ 2004-11-22 14:18:40 by simonmar]simonmar2004-11-221-10/+9
| | | | Check the result of System.Cmd.system