This project is mirrored from https://github.com/haskell/Cabal. Pull mirroring updated .
  1. 27 Mar, 2008 6 commits
    • Duncan Coutts's avatar
      Parse Bool fields using more cunning, allow new parses with a warning · e92d6573
      Duncan Coutts authored
      We want to allow case-insensitive parsing however we don't want
      packages being uploaded to hackage that will break older versions of
      Cabal. If we allow new valid parses then we will end up breaking
      stuff. So what we really want to do is allow new parses but warn if
      they're not ones that older versions of Cabal would have allowed. So
      long as hackage rejects pakcages that have parse warnings then we can
      prevent new .cabal files appearing on hackage that would break older
      Cabal versions. Our current parser (ReadP) does not support warnings
      so we have to handle the bool fields specially in the parser wrapper
      layer that we added to handle errors and warnings. This can go away
      when we use a parser with support for error and warning messages.
      e92d6573
    • Duncan Coutts's avatar
      Add scripts for testing compatability with hackage packages · 75867d1c
      Duncan Coutts authored
      So far just a test that all the non-trivial Setup.(l)hs scripts
      compile. This only tests the latest versions, though if one were
      to download a complete archive then one could test them all.
      To speed up the check we skip Setup.hs scripts that have fewer
      than 22 words. Below this cutoff there are no custom hooks and
      it catches the great majority of scripts which greatly speeds up
      the check.
      75867d1c
    • Duncan Coutts's avatar
      Rename various *Verbose fields to *Verbosity instead · 556b9877
      Duncan Coutts authored
      Despite appearances this is actually not completely pointless.
      For the Cabal-1.4 branch we need the *Verbose fields to have the
      same types as they did in Cabal-1.2, becuase lots of Setup.hs
      scripts use them and our change to make them all have type Flag
      makes many Setup.hs scripts fail. A solution for the 1.4 branch
      is to rename the real field and to add the old field back in.
      To keep as much similarity as possible between the HEAD and 1.4
      branches I'm applying the name change in both.
      On the plus side it's a better name anyway.
      556b9877
    • Duncan Coutts's avatar
      Make UTF-8 decoding errors in .cabal files non-fatal · c4f0e7ca
      Duncan Coutts authored
      Previously we checked for invalid UTF-8 in the first phase of the
      parser, which splitting the file up into nested sections and fields.
      This meant the whole parser falls over if there is invalid UTF-8
      anywhere in the file. Sadly there are already packages on hackage
      with invalid UTF-8 so we would fail when parsing the hackage index.
      The solution is to move the check into the parsing of the individual
      fields and making it a warning not an error. We most typically get
      invalid UTF-8 in free text fields like author name, copyright,
      description etc so this should work out ok usually.
      We now get pretty decent error messages, like:
        Warning: hsx.cabal:5: Invalid UTF-8 text in the 'author' field.
      The warning type is now structured so that hackage will be able to
      distinguish general non-fatal warnings from UTF-8 decoding problems
      which really should be fatal errors for package uploads. 
      c4f0e7ca
    • Duncan Coutts's avatar
      Separate the OS/Arch classifiation used for different purposes · 507ed739
      Duncan Coutts authored
      We have to classify System.Info.{os,arch} strings into the OS and Arch
      enums. For that purpose we have to be quite permissive since there are
      lots of ailases that the various Haskell implementations use. However
      for parsing os and arch names in .cabal files we'd prefer to use
      canonical names, though we do have to allow the couple aliases already
      in common use.
      507ed739
    • Duncan Coutts's avatar
      Arch and OS names were previously allowed to contain "_-", restore that. · 0f45e192
      Duncan Coutts authored
      That is the arch and os strings in conditionals in .cabal files, like:
        if arch(x86_64)
      Previously the parser used isAlphaNum c || (c `elem` "_-"). This is
      crucial for arch names like "x86_64". So make the new parser for OS
      and Arch types use the same string parser as before (there is a string
      parse part and a separate classification of known OS/Arch values).
      0f45e192
  2. 26 Mar, 2008 5 commits
  3. 25 Mar, 2008 10 commits
  4. 24 Mar, 2008 11 commits
  5. 23 Mar, 2008 1 commit
  6. 21 Mar, 2008 3 commits
    • Duncan Coutts's avatar
      Make parsing of licenses more robust · 0f3d5966
      Duncan Coutts authored
      Added an UnknownLicense String constructor so that we can remember
      unknown license names and report them and prevent them from being
      uploaded to hackage, but not fail hard with a parse error upon
      encountering an unknown license. This does not add any new licesnes
      or and new valid parses of existing licenses. The parsing phase
      now allows an optional version like "GPL-3" however that would still
      be classified as an unknown license at the moment. The point is it's
      no longer a parse error but a semantic error instead.
      0f3d5966
    • Duncan Coutts's avatar
      -Wall police · 51538e89
      Duncan Coutts authored
      51538e89
    • mnislaih's avatar
      Automatically highlight default options of a CommandUI when converting it to a list of GetOpts · 77235603
      mnislaih authored
      I shamelessly stole some code from GHCi for the highlighting.
      77235603
  7. 20 Mar, 2008 1 commit
  8. 19 Mar, 2008 1 commit
  9. 21 Mar, 2008 2 commits
    • Duncan Coutts's avatar
      Add Text instance for License · 94522d99
      Duncan Coutts authored
      Initially it's exactly the same format as Read/Show.
      We can make it more liberal later.
      94522d99
    • Duncan Coutts's avatar
      Add Text instance for CompilerFlavor and CompilerId · a7c1b3cf
      Duncan Coutts authored
      This is a tad subtle since we actually have two ways of parsing
      compiler flavours. One expects, or at least allows lower case names
      like "ghc" and "nhc98", the other uses Read/Show which gives "GHC"
      and "NHC". What we're doing here is only changing the first variety.
      The cases where we parse using Read (and display using Show) are not
      changed. At some point we'll switch those over to the more liberal
      parser, but not yet as we don't want to cause compatibility problems.
      a7c1b3cf