Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install-includes is ignored in foreign-library target. #5299

Closed
qnikst opened this issue May 2, 2018 · 1 comment
Closed

install-includes is ignored in foreign-library target. #5299

qnikst opened this issue May 2, 2018 · 1 comment

Comments

@qnikst
Copy link
Collaborator

qnikst commented May 2, 2018

install-includes field is only processed for the library target. And it doesn't work for foreign-library:

Minimal example:

foreign.cabal:

-- Initial foreign.cabal generated by cabal init.  For further 
-- documentation, see http://haskell.org/cabal/users-guide/

name:                foreign
version:             0.1.0.0
synopsis:            An example of the foreign library.
description:         Foreign library example, this project is done as
                     a simple test of the foreign libraries inclusion.
license:             BSD3
license-file:        LICENSE
author:              Alexander Vershilov
maintainer:          [email protected]
build-type:          Simple
extra-source-files:  ChangeLog.md
cabal-version:       >=2.0

-- uncomment to fix an issue:
--library
--  build-depends:       base >=4.9 && <4.10
--  hs-source-dirs:      src
--  other-modules:       Lib
--  install-includes:    Lib_stub.h  
--  default-language:    Haskell2010
 

foreign-library      mylib
  type:              native-shared
  lib-version-info:  6:3:2
  build-depends:       base >=4.9 && <4.10
  hs-source-dirs:      src
  other-modules:       Lib
  install-includes:    Lib_stub.h
  other-extensions:    ForeignFunctionInterface
  default-language:    Haskell2010

src/Lib.hs

{-# LANGUAGE ForeignFunctionInterface #-}
module Lib
  ( fac1
  ) where

foreign export ccall fac1 :: Int -> Int

fac1 :: Int -> Int
fac1 n = product [1..n]

Relevant call in codebase:

installIncludeFiles verbosity lib lbi buildPref incPref

@23Skidoo
Copy link
Member

23Skidoo commented Jun 8, 2018

Fixed by #5302.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants