New ghc-pkg option 'check'
Lennart Kolmodin
kolmodin at dtek.chalmers.se
Mon Nov 6 16:27:30 EST 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hi!
I've got a patch for ghc-pkg show broken packages (due to missing
dependencies) with a new command 'check', and also indicate brocken
packages when using the command 'list'.
ghc-pkg: New command 'check' and made 'list' indicate broken packages
Command 'check': print a list of all packages that are broken and
which dependencies they are missing.
Command 'list': updated by making it put brackets around broken
packages.
I hope you like it.
Cheers,
Lennart Kolmodin
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFFT6jC4txYG4KUCuERAm2PAKCqNZPL8C3iWpJlAHki/LDe9IWilACeIWpN
Lh9f7Gs4hlnsKH4BSPiUe2s=
=nw5u
-----END PGP SIGNATURE-----
-------------- next part --------------
New patches:
[ghc-pkg: New command 'check' and made 'list' indicate broken packages
Lennart Kolmodin <kolmodin at dtek.chalmers.se>**20061105183851
Command 'check': print a list of all packages that are broken and
which dependencies they are missing.
Command 'list': updated by making it put brackets around broken
packages.
] {
hunk ./utils/ghc-pkg/Main.hs 138
- "print output in easy-to-parse format when running command 'list'"
+ "print output in easy-to-parse format for some commands"
hunk ./utils/ghc-pkg/Main.hs 174
+ " Accepts the --simple-output flag.\n" ++
hunk ./utils/ghc-pkg/Main.hs 179
+ " $p check\n" ++
+ " Check the consistency of package depenencies and list broken packages.\n" ++
+ " Accepts the --simple-output flag.\n" ++
+ "\n" ++
hunk ./utils/ghc-pkg/Main.hs 244
+ ["check"] -> do
+ checkConsistency cli
hunk ./utils/ghc-pkg/Main.hs 486
- show_func = if simple_output then show_easy else mapM_ show_regular
+ pkg_map = map (\p -> (package p, p)) $ concatMap snd db_stack
+ show_func = if simple_output then show_simple else mapM_ (show_normal pkg_map)
hunk ./utils/ghc-pkg/Main.hs 491
- where show_regular (db_name,pkg_confs) =
+ where show_normal pkg_map (db_name,pkg_confs) =
hunk ./utils/ghc-pkg/Main.hs 493
- text (db_name ++ ":") $$ nest 4 packages
+ text db_name <> comma $$ nest 4 packages
hunk ./utils/ghc-pkg/Main.hs 497
+ | isBrokenPackage p pkg_map = braces doc
hunk ./utils/ghc-pkg/Main.hs 502
- show_easy db_stack = do
+ show_simple db_stack = do
hunk ./utils/ghc-pkg/Main.hs 580
+
+-- -----------------------------------------------------------------------------
+-- Check: Check consistency of installed packages
+
+checkConsistency :: [Flag] -> IO ()
+checkConsistency flags = do
+ db_stack <- getPkgDatabases False flags
+ let pkgs = map (\p -> (package p, p)) $ concatMap snd db_stack
+ broken_pkgs = do
+ (pid, p) <- pkgs
+ let broken_deps = missingPackageDeps p pkgs
+ guard (not . null $ broken_deps)
+ return (pid, broken_deps)
+ mapM_ (putStrLn . render . show_func) broken_pkgs
+ where
+ show_func | FlagSimpleOutput `elem` flags = show_simple
+ | otherwise = show_normal
+ show_simple (pid,deps) =
+ text (showPackageId pid) <> colon
+ <+> fsep (punctuate comma (map (text . showPackageId) deps))
+ show_normal (pid,deps) =
+ text "package" <+> text (showPackageId pid) <+> text "has missing dependencies:"
+ $$ nest 4 (fsep (punctuate comma (map (text . showPackageId) deps)))
+
+missingPackageDeps :: InstalledPackageInfo
+ -> [(PackageIdentifier, InstalledPackageInfo)]
+ -> [PackageIdentifier]
+missingPackageDeps pkg pkg_map =
+ [ d | d <- depends pkg, isNothing (lookup d pkg_map)] ++
+ [ d | d <- depends pkg, Just p <- return (lookup d pkg_map), isBrokenPackage p pkg_map]
+
+isBrokenPackage :: InstalledPackageInfo -> [(PackageIdentifier, InstalledPackageInfo)] -> Bool
+isBrokenPackage pkg pkg_map = not . null $ missingPackageDeps pkg pkg_map
+
+
}
Context:
[Various debugging print changes; nothing exciting
simonpj at microsoft.com**20061106160244]
[Tidy up substitutions
simonpj at microsoft.com**20061106155901
The new simplifer stuff exposed the fact that the invariants on the
TvSubstEnv and IdSubstEnv were insufficiently explicit. (Resulted in
a bug found by Sam Brosnon.)
This patch fixes the bug, and tries to document the invariants pretty
thoroughly. See
Note [Extending the TvSubst] in Type
Note [Extenting the Subst] in CoreSubst
(Most of the new lines are comments.)
]
[Get External Core (-fext-core) working with readline
Samuel Bronson <naesten at gmail.com>**20061101003649
Had to add support for dynamic C calls and for foreign labels (Addr#
constants). Actually I only did the printing side -- parsing is not
done yet. But at least now you can build the libraries with -fext-core.
I also got the function arrow to print out properly again (it was
printing fully-qualified and z-coded!)
I also added a field for calling convention name to the External
data constructor in ExternalCore.Exp (for static C calls).
I'm not exactly sure where to document all of this, so I haven't done
that, though I did comment the code a bit.
]
[Remove pre-5.04 code
Ian Lynagh <igloo at earth.li>**20061024011026]
[Major overhaul of the Simplifier
simonpj at microsoft.com**20061101164329
This big patch completely overhauls the Simplifier. The simplifier
had grown old and crufty, and was hard to understand and maintain.
This new version is still quite complicated, because the simplifier
does a lot, but it's much easier to understand, for me at least.
It does mean that I have touched almost every line of the simplifier,
so the diff is a large one.
Big changes are these
* When simplifying an Expr we generate a simplified Expr plus a
bunch of "floats", which are bindings that have floated out
of the Expr. Before, this float stuff was returned separately,
but not they are embedded in the SimplEnv, which makes the
plumbing much easier and more robust. In particular, the
SimplEnv already meaintains the "in-scope set", and making
that travel with the floats helps to ensure that we always
use the right in-scope set.
This change has a pervasive effect.
* Rather than simplifying the args of a call before trying rules
and inlining, we now defer simplifying the args until both
rules and inlining have failed, so we're going to leave a
call in the result. This avoids the risk of repeatedly
simplifying an argument, which was handled by funny ad-hoc
flags before.
The downside is that we must apply the substitution to the args before
rule-matching; and if thep rule doesn't match that is wasted work.
But having any rules at all is the exception not the rule, and the
substitution is lazy, so we only substitute until a no-match is found.
The code is much more elegant though.
* A SimplCont is now more zipper-like. It used to have an embedded
function, but that was a bit hard to think about, and now it's
nice and consistent. The relevant constructors are StrictArg
and StrictBind
* Each Rule now has an *arity* (gotten by CoreSyn.ruleArity), which
tells how many arguments it matches against. This entailed adding
a field ru_nargs to a BuiltinRule. And that made me look at
PrelRules; I did quite a bit of refactoring in the end, so the
diff in PrelRules looks much biggger than it really is.
* A little refactoring in OccurAnal. The key change is that in
the RHS of x = y `cast` co
we regard 'y' as "many", so that it doesn't get inlined into
the RHS of x. This allows x to be inlined elsewhere. It's
very like the existing situation for
x = Just y
where we treat 'y' as "many".
]
[Improve error message from ghc --make when filename and modulename differ
simonpj at microsoft.com**20061102123111]
[Improve handling of unused imports (test is mod75)
simonpj at microsoft.com**20061102120441]
[Remove unused lookupDeprec function
simonpj at microsoft.com**20061102120402]
[Fix handling of non-in-scope exports (fixes test mod7)
simonpj at microsoft.com**20061102120304]
[Comments and layout only
simonpj at microsoft.com**20061102093954]
[import Maybes wibble
sof at galois.com**20061101221108]
[add a few #includes to make it compile
sof at galois.com**20061101220950]
[Trim imports
simonpj at microsoft.com**20061101173439]
[Default the kind of unconstrained meta-type variables before tcSimplifyTop
simonpj at microsoft.com**20061101173325
This patch fixes a long standing bug, Trac #179,
and a recently reported one, Trac #963.
The problem in both cases was an unconstrained type variable 'a', of kind
argTypeKind (printed "??") or openTypeKind ("?"). At top level we now default
the kind of such variables to liftedTypeKind ("*"). This is important because
then instance declarations can match it. The defaulting function is called
TcMType.zonkTopTyVar, and is commented. (Most of the extra lines in the
patch are comments!)
]
[Comments and layout only
simonpj at microsoft.com**20061101170448]
[Minor refactoring
simonpj at microsoft.com**20061101143416]
[Remove unused import
simonpj at microsoft.com**20061101142550]
[Comments only
simonpj at microsoft.com**20061101142343]
[Make idInfo fail more informatively on TyVars
simonpj at microsoft.com**20061101142246]
[Improve error message (push to 6.6 branch)
simonpj at microsoft.com**20061101123727]
[Fix error reporting for contexts during deriving (Trac 958)
simonpj at microsoft.com**20061101122120
When doing the fixpoint iteration for 'deriving' we have to be careful
not to end up in a loop, even if we have -fallow-undecidable-instances.
Test is tcfail169
]
[Fix a long-standing but obscure bug in worker-wrapper generation
simonpj at microsoft.com**20061101110442
Worker/wrapper generation sometimes has to add a dummy void (State#) argument
to retain laziness. But when generating the strictness signature for the
worker, I forgot to take account of the extra argument, resulting in a
bogus strictness signature.
Result, chaos. Trac 317 shows this up, and this patch fixes it.
]
[Move --help, --version etc to 4.4 (modes) because that is what they really are
simonpj at microsoft.com**20061030135204]
[remove the *.raw files
Simon Marlow <simonmar at microsoft.com>**20061027152129]
[improve the diagnostic generated by memInventory() for a memory leak
Simon Marlow <simonmar at microsoft.com>**20061027133611]
[count mut-list bytes, not words
Simon Marlow <simonmar at microsoft.com>**20061027133445]
[fix calculation of GC Work for 6.6+
Simon Marlow <simonmar at microsoft.com>**20061027103439]
[copyright updates and add Commentary links
Simon Marlow <simonmar at microsoft.com>**20061026092536]
[rename spin lock functions, and use macros for non-THREADED_RTS
Simon Marlow <simonmar at microsoft.com>**20061026091814]
[Remove PAR/GRAN code from the storage manager
Simon Marlow <simonmar at microsoft.com>**20061025111114
]
[markRootPtrTable: write out type in full instead of using evac_fn typedef
Simon Marlow <simonmar at microsoft.com>**20061026085418
Fixes stage 2 build with -fvia-C
]
[an expression with a TickBox round it is not in HNF.
andy at galois.com**20061025203829]
[Adding arrows to the acceptable code for hpc
andy at galois.com**20061025201514]
[fixing type error inside Hpc inc; we had a 32 bit '1'.
andy at galois.com**20061025201422]
[Improving error message in CmmLint
andy at galois.com**20061025201338]
[Changing Main.tix to <prog_name>.tix in the Hpc RTS
andy at galois.com**20061025201229]
[Add pointer to coding conventions to HACKING
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20061025164331]
[6.4 compatiblity
andy at galois.com**20061025075900]
[Haskell Program Coverage
andy at galois.com**20061024212907
This large checkin is the new ghc version of Haskell
Program Coverage, an expression-level coverage tool for Haskell.
Parts:
- Hpc.[ch] - small runtime support for Hpc; reading/writing *.tix files.
- Coverage.lhs - Annotates the HsSyn with coverage tickboxes.
- New Note's in Core,
- TickBox -- ticked on entry to sub-expression
- BinaryTickBox -- ticked on exit to sub-expression, depending
-- on the boolean result.
- New Stg level TickBox (no BinaryTickBoxes, though)
You can run the coverage tool with -fhpc at compile time.
Main must be compiled with -fhpc.
]
[fix 5.04 compile
Simon Marlow <simonmar at microsoft.com>**20061024133943]
[fix indentation wibble to make it compile with 5.04
Simon Marlow <simonmar at microsoft.com>**20061024122800]
[Re-enable TABLES_NEXT_TO_CODE for powerpc (was accidentally disabled)
wolfgang.thaller at gmx.net**20061023203321]
[Split GC.c, and move storage manager into sm/ directory
Simon Marlow <simonmar at microsoft.com>**20061024091357
In preparation for parallel GC, split up the monolithic GC.c file into
smaller parts. Also in this patch (and difficult to separate,
unfortunatley):
- Don't include Stable.h in Rts.h, instead just include it where
necessary.
- consistently use STATIC_INLINE in source files, and INLINE_HEADER
in header files. STATIC_INLINE is now turned off when DEBUG is on,
to make debugging easier.
- The GC no longer takes the get_roots function as an argument.
We weren't making use of this generalisation.
]
[fix a printf format warning
Simon Marlow <simonmar at microsoft.com>**20061024091323]
[add prototypes for exitHashTable()
Simon Marlow <simonmar at microsoft.com>**20061020102934]
[remove ^Ms
Simon Marlow <simonmar at microsoft.com>**20061019141218]
[add pure spin locks
Simon Marlow <simonmar at microsoft.com>**20061019135620]
[comments only: document allocateLocal()
Simon Marlow <simonmar at microsoft.com>**20061019101200]
[rename allocated_bytes() to allocatedBytes()
Simon Marlow <simonmar at microsoft.com>**20061019101129]
[remove performGCWithRoots()
Simon Marlow <simonmar at microsoft.com>**20061019101102
I don't think this can ever be useful, because to add more roots you
need to do it consistently for every GC. The right way to add roots
is to use newStablePtr.
]
[Bump the HEAD to 6.7
Ian Lynagh <igloo at earth.li>**20061024003553]
[Clean up debugging code in RnNames
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20061023180503]
[wibble in parseStaticFlags
Simon Marlow <simonmar at microsoft.com>**20061023145817
should fix profiling and unreg in HEAD
]
[Improve error messages for indexed types
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20061022171212]
[A little abstraction
basvandijk at home.nl**20061019152328]
[Fix handling of family instances in the presense of this doc stuff
Manuel M T Chakravarty <chak at cse.unsw.edu.au>**20061022004904
- Not sure whether I do the right thing, because I don't understand the
doc stuff. However, the original code was definitely wrong and
breaking the renaming of family instance declarations.
- The important point is that in
data instance T pats = rhs
T is *not* a defining occurence of T (similarly as C is not a defining
occurence in "instance C Int").
]
[TAG 2006-10-22
Ian Lynagh <igloo at earth.li>**20061022003640]
Patch bundle hash:
593652f45ace4b98d84a5ce4600e59bf0be6dd52
More information about the Cvs-ghc
mailing list