Skip to content

cabal install ignores --enable-executable-dynamic flag #8909

Closed
@FedericoStra

Description

@FedericoStra

The bug

There is no (obvious) way to have cabal install a dynamically linked executable.

To Reproduce

With the following configuration

-- cabal.project
packages: .
executable-dynamic: True
-- cabal.project.local
ignore-project: False
executable-dynamic: True

if I run cabal install --enable-executable-dynamic, then a statically linked version of the executable gets installed:

$ ldd ~/.cabal/bin/<progname>
	linux-vdso.so.1 (0x00007ffc2934b000)
	libgmp.so.10 => /lib64/libgmp.so.10 (0x00007f1d49003000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f1d48e26000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f1d48d46000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f1d490cd000)

Expected behavior

$ ldd ~/.cabal/bin/<progname>
	linux-vdso.so.1 (0x00007ffe02fde000)
	libHSbase-4.16.4.0-ghc9.2.7.so => ~/.ghcup/ghc/9.2.7/lib/ghc-9.2.7/base-4.16.4.0/libHSbase-4.16.4.0-ghc9.2.7.so (0x00007f440b000000)
	libHSghc-bignum-1.2-ghc9.2.7.so => ~/.ghcup/ghc/9.2.7/lib/ghc-9.2.7/ghc-bignum-1.2/libHSghc-bignum-1.2-ghc9.2.7.so (0x00007f440baa4000)
	libHSghc-prim-0.8.0-ghc9.2.7.so => ~/.ghcup/ghc/9.2.7/lib/ghc-9.2.7/ghc-prim-0.8.0/libHSghc-prim-0.8.0-ghc9.2.7.so (0x00007f440aa00000)
	libHSrts-ghc9.2.7.so => ~/.ghcup/ghc/9.2.7/lib/ghc-9.2.7/rts/libHSrts-ghc9.2.7.so (0x00007f440af6e000)
	libffi.so.7 => ~/.ghcup/ghc/9.2.7/lib/ghc-9.2.7/rts/libffi.so.7 (0x00007f440a600000)
	libgmp.so.10 => /lib64/libgmp.so.10 (0x00007f440a95b000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f440a423000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f440a87b000)
	librt.so.1 => /lib64/librt.so.1 (0x00007f440ba7a000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f440ba75000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f440ba6e000)
	/lib64/ld-linux-x86-64.so.2 (0x00007f440baf9000)

System information

  • Operating system: Fedora Linux 37 (Workstation Edition) 6.2.10-200.fc37.x86_64
  • $ cabal --version
    cabal-install version 3.6.2.0
    compiled using version 3.6.2.0 of the Cabal library
    
    $ ghc --version
    The Glorious Glasgow Haskell Compilation System, version 9.2.7
    

Additional information

I can get around the problem by putting ghc-options: -dynamic in the package.cabal file, but I don't think it's the appropriate solution.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions