-package data in ghc-5.04.3

Simon Marlow simonmar@microsoft.com
Wed, 7 May 2003 13:21:11 +0100


=20
> This refers the issues of   `data' package (FiniteMap),=20
>                             user package setting =20
>=20
> The Manual tells about `base' to replace `data'.
>=20
> 1.=20
> If I put to  Main.hs
>=20
>   import FiniteMap
>   main =3D putStr $ shows (fmToList $ listToFM $ zip "abc" "abc") "\n"
>=20
> , then   ghc -package data --make Main=20
> works.=20
> And      ghc -package base --make Main=20
> reports
>          ghc-5.04.3: chasing modules from: Main
>          ghc-5.04.3: can't find module `FiniteMap' ...

The FiniteMap module from package 'data' is now available as
Data.FiniteMap from package 'base' (there's no need to explicitly
request 'base', it's always available).

> 2.
> Makefile  sets my user package as it was with  5.02 :
>  ...
>  packDocon =3D Package {name            =3D "\"docon\"",  \
>                       import_dirs     =3D ["\"$(e)\""], \
>                       source_dirs     =3D ["\"$(e)\""], \
>                       library_dirs    =3D ["\"$(e)\""], \
>                       hs_libraries    =3D ["\"HSdocon\""], \
>                       extra_libraries =3D [], \
>                       include_dirs    =3D [], \
>                       c_includes      =3D [], \
>                       package_deps    =3D [\"data\"], \
>                       extra_ghc_opts  =3D [$(extraPackageOpts)], \
>                       extra_cc_opts   =3D [], \
>                       extra_ld_opts   =3D [] }
>  ...
>=20
> ghc-5.04.3 reports:    dependency `data' doesn't exist=20

This is a problem that will be fixed in the next release.  For now, just
omit the dependency.

> Renaming  data <- base  gives similar report.
> After changing it to   package_deps =3D [],
>=20
> it reports:=20
>=20
> ---------------------------------
>  if [ ! -d /home/mechvel/docon/2.06/docon/source/export ];
>      then mkdir /home/mechvel/docon/2.06/docon/source/export; fi
> ghc-pkg -f /home/mechvel/docon/2.06/docon/source/docon.conf -l
>=20
> echo Package {name            =3D "\"docon\"",=20
> import_dirs     =3D=20
> ["\"/home/mechvel/docon/2.06/docon/source/export\""],
>  source_dirs     =3D=20
> ["\"/home/mechvel/docon/2.06/docon/source/export\""],=20
> library_dirs    =3D=20
> ["\"/home/mechvel/docon/2.06/docon/source/export\""],=20
> hs_libraries    =3D ["\"HSdocon\""], extra_libraries =3D [],=20
> include_dirs    =3D [], c_includes      =3D [], package_deps    =3D =
[],=20
> extra_ghc_opts =3D ["\"-package data\"",=20
> "\"-fno-warn-overlapping-patterns\"", "\"-fwarn-unused-binds\"",
> "\"-fwarn-unused-matches\"", "\"-fwarn-unused-imports\"",=20
> "\"-fglasgow-exts\"", "\"-fallow-overlapping-instances\"",=20
> "\"-fallow-undecidable-instances\"" ], extra_cc_opts   =3D [],=20
> extra_ld_opts   =3D [] }=20
> |=20
> ghc-pkg -f /home/mechvel/docon/2.06/docon/source/docon.conf -a
>=20
> Reading package info from stdin... done.
> Expanding embedded variables...done.
> cannot find `libHSdocon.a' on library path

The error is self-explanatory: it can't find libHSdocon.a on the path
given in the package specification.  It looks like you might have some
extra quotation marks in there.

Also, I wouldn't put '-package data' in extra_ghc_opts.  I think that is
unlikely to work.

Cheers,
	Simon