| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
| |
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.
|
| | |
|
| |
|
|
| |
sort packages by name and version in the 'ghc-pkg list' output
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
fix for pre-6.0 ghc's
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- 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.
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
| |
- 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>
|
| |
|
|
| |
Rmoeve a few lines that are provided by lib/compat/compat.mk
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
| |
Re-instate support for environment variable expansion and the -D flag.
Now it is done pre-parsing, however.
|
| |
|
|
| |
Further to previous patch: only create the user database if we're modifying
|
| |
|
|
|
| |
Be a bit less eager about creating the user database: now we only
create it when explicitly asked to use it with --user.
|
| |
|
|
| |
Clean up Version.hs for distclean target
|
| |
|
|
| |
Warning police
|
| |
|
|
| |
For some reason rev. 1.71 undid rev. 1.70. Restore it.
|
| |
|
|
|
|
|
|
|
|
|
| |
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)
|
| |
|
|
| |
Fix test in findPackages
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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".
|
| |
|
|
|
|
| |
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).
|
| |
|
|
| |
Allow package identifiers with versions in the old command-line syntax
|
| |
|
|
|
| |
Make sure we don't register a package with an identifier that cannot
be parsed later.
|
| |
|
|
| |
Compile utilities and lib/compat with GhcHcOpts, in case it is profiled
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
bootstrapping wibbles
|
| |
|
|
| |
Fix handling of dependent packages without a version
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
--------------------------------------------
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.
|
| |
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Remove System.FilePath, use System.Directory.Internals for now.
|
| |
|
|
| |
Avoid use of System.FilePath, which is going away
|
| |
|
|
| |
Update the --help text
|
| |
|
|
| |
ghc-pkg list: show hidden packages in parentheses
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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 :-)
|
| |
|
|
| |
Track removal of Distribution.Compat.Error.
|
| |
|
|
|
|
|
|
| |
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?
|
| |
|
|
|
| |
Remove copied definitions for joinFileName, splitFileName:
System.FilePath is in libghccompat now.
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
Add Distribution.Compat to libghccompat
|
| |
|
|
| |
Get rid of some `...' style quotes
|
| |
|
|
|
| |
- Implement expose/hide
- fix parsing of package identifiers (forgot to commit this the other day)
|
| |
|
|
| |
Support the --auto-ghci-libs option in conjuction with 'register'.
|
| |
|
|
| |
Update the excluded modules for libghccompat
|
| |
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
|
| |
This should fix the build for GHC 6.3+
|
| |
|
|
| |
Fix mkdependHS behaviour
|
| |
|
|
| |
Check the result of System.Cmd.system
|