[Hackage] #295: ld-options parsing treats , as separator

Hackage trac at galois.com
Wed Jun 18 13:16:57 EDT 2008

#295: ld-options parsing treats , as separator
  Reporter:  duncan         |        Owner:           
      Type:  defect         |       Status:  new      
  Priority:  normal         |    Milestone:  Cabal-1.4
 Component:  Cabal library  |      Version:  HEAD     
  Severity:  normal         |     Keywords:           
Difficulty:  normal         |   Ghcversion:  6.8.2    
  Platform:                 |  
 Say we've got X11.buildinfo.in:
 ld-options: @X_LIBS@ @LDFLAGS@

 and imagine that someone has all kinds of crazy `LDFLAGS`:
 LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--hash-style=gnu -Wl,-z,relro -Wl
 ,--as-needed -Wl,-z,now"

 Can you guess what happens?

 We end up parsing that as:

 ldOptions = ["-Wl", "-O1", "-Wl", "--sort-common",
              "-Wl", "--hash-style=gnu",
              "-Wl", "-z", "relro",
              "-Wl", "--as-needed",
              "-Wl", "-z", "now"]

 This is because the parser for the `ld-options` field is defined using
 `listField` which uses `parseOptCommaList` which uses space and `','` as
 value separators. We should use just spaces for this field and also for
 `cc-options` and `cpp-options`.

 If we make this change we'll have to check that we're not going to break
 things for existing .cabal files that might use ',' as a separator. Will
 require an audit of .cabal files on hackage.

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/295>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list