haskell / haskell/cabal

dynlibdir does not work with build-type Custom

Open
#4,284 7 comments 0 reactions 0 assignees View on GitHub
Cabal: custom type: bug
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

When the build-type is set to Custom in a cabal file, the dynlibdir feature is not working. Instead of placing the .so in the per-abi directory, the .so is placed in the per-module directory.

The following example shows the issue:

```
$ cabal --version
cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library

host ~ $ ls -a
. .. Setup.hs tmp.cabal Tmp.hs

host ~ $ cat tmp.cabal
name: tmp
version: 0.1.0.0
build-type: Custom
cabal-version: >=1.10

library
build-depends: base >=4.9 && <4.10
exposed-modules: Tmp
default-language: Haskell2010
host ~ $ cat Setup.hs
import Distribution.Simple
main = defaultMain

host ~ $ cabal install
Config file path source is default config file.
Config file /tmp/tmp.U0EaAhFT29/.cabal/config not found.
Writing default configuration to /tmp/tmp.U0EaAhFT29/.cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
Configuring tmp-0.1.0.0...
Building tmp-0.1.0.0...
Installed tmp-0.1.0.0

host ~ $ ls .cabal/lib/x86_64-linux-ghc-8.0.1
tmp-0.1.0.0-8QuMQemfWDcEGULIePzdl7

host ~ $ ls .cabal/lib/x86_64-linux-ghc-8.0.1/tmp-0.1.0.0-8QuMQemfWDcEGULIePzdl7
libHStmp-0.1.0.0-8QuMQemfWDcEGULIePzdl7.a libHStmp-0.1.0.0-8QuMQemfWDcEGULIePzdl7-ghc8.0.1.so Tmp.dyn_hi Tmp.hi

host ~ $ rm -rf .ghc .cabal dist

host ~ $ sed --in-place s/Custom/Simple/ tmp.cabal

host ~ $ cabal install
Config file path source is default config file.
Config file /tmp/tmp.U0EaAhFT29/.cabal/config not found.
Writing default configuration to /tmp/tmp.U0EaAhFT29/.cabal/config
Warning: The package list for 'hackage.haskell.org' does not exist. Run 'cabal
update' to download it.
Resolving dependencies...
Configuring tmp-0.1.0.0...
Building tmp-0.1.0.0...
Installed tmp-0.1.0.0

host ~ $ ls .cabal/lib/x86_64-linux-ghc-8.0.1
libHStmp-0.1.0.0-8QuMQemfWDcEGULIePzdl7-ghc8.0.1.so tmp-0.1.0.0-8QuMQemfWDcEGULIePzdl7
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.