Skip to content

c2hs does not accept options after filenames #86

Closed
@mietek

Description

@mietek

The Cabal --c2hs-option option has been ineffective for a long time (haskell/cabal#853), because c2hs does not accept options passed after filenames on the command line:

$ cabal repl --c2hs-option=-h
...
There must be exactly one binding file (suffix .chs),
and optionally one or more header files (suffix .h).
Try the option `--help' on its own for more information.

This is how Cabal attempts to invoke c2hs:

/Users/mietek/Foo/.cabal-sandbox/bin/c2hs
--cpp=/usr/bin/gcc
--cppopts=-E
--cppopts=-D__GLASGOW_HASKELL__=708
--cppopts=-Ddarwin_BUILD_OS=1
--cppopts=-Dx86_64_BUILD_ARCH=1
--cppopts=-Ddarwin_HOST_OS=1
--cppopts=-Dx86_64_HOST_ARCH=1
--cppopts=-Icbits
--include=dist/build
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/process-1.2.0.0/include
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/directory-1.2.1.0/include
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/unix-2.7.0.1/include
--cppopts=-I/Users/mietek/Foo/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.2/vector-0.10.9.2/include
--cppopts=-I/Users/mietek/Foo/.cabal-sandbox/lib/x86_64-osx-ghc-7.8.2/primitive-0.5.3.0/include
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/time-1.4.2/include
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/bytestring-0.10.4.0/include
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/base-4.7.0.0/include
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/integer-gmp-0.5.1.0/include
--cppopts=-I/opt/ghc-7.8.2/lib/ghc-7.8.2/include
--output-dir=dist/build
--output=Foo.hs
src/Foo.chs
-h

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions