Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#5507 closed bug (fixed)

Template Haskell needs extra library dirs

Reported by: jwlato Owned by: igloo
Priority: normal Milestone: 7.4.1
Component: Template Haskell Version: 7.2.1
Keywords: template haskell, link Cc: jwlato@…
Operating System: MacOS X Architecture: x86_64 (amd64)
Type of failure: Compile-time crash Difficulty:
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Template Haskell fails to link c libraries which are located in non-standard locations. On my system, gtk libraries are installed in /opt/local/lib; ghc-pkg describe reports:

library-dirs: /Users/kathleenhouse/.cabal/lib/cairo-0.12.1/ghc-7.2.1
              /opt/local/lib

and building ordinary Haskell packages with cairo/gtk works properly.

However, if a package imports Cairo, Template Haskell fails to find the C library. The error (from ghc) is:

Loading package cairo-0.12.1 ... <command line>: can't load .so/.DLL for: libcairo.dylib (dlopen(libcairo.dylib, 9): image not found)
cabal: Error: some packages failed to install:

Attachments (1)

tester.tar.bz2 (11.2 KB) - added by jwlato 3 years ago.
test case

Download all attachments as: .zip

Change History (5)

Changed 3 years ago by jwlato

test case

comment:1 Changed 3 years ago by jwlato

In the test code, run the script runner.sh. This will install a Haskell package named testmod, then load ghci. In ghci, run main and TH should fail.

comment:2 Changed 3 years ago by igloo

  • Operating System changed from Unknown/Multiple to MacOS X
  • Owner set to igloo

Works for me on Linux. I'll try on OS X.

comment:3 Changed 3 years ago by igloo

  • Milestone set to 7.4.1
  • Resolution set to fixed
  • Status changed from new to closed

Aha, on OS X I can reproduce this with 7.2 but not HEAD. So I think this is fixed, although I can't easily find the patch that fixed it.

comment:4 Changed 3 years ago by jwlato

Great, thanks for looking into it.

Note: See TracTickets for help on using tickets.