Opened 17 months ago

Closed 14 months ago

Last modified 11 months ago

#9010 closed bug (fixed)

TemplateHaskell leads to an "unknown symbol" error

Reported by: Feuerbach Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.6.3
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Revisions:

Description

Code:

{-# LANGUAGE TemplateHaskell #-}
module M where

import System.Console.Editline
import Data.Lens.Template

data S = S { _a :: EditLine }

makeLens ''S

When compiled with ghc link.hs, everything is fine;

[1 of 1] Compiling M                ( link.hs, link.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package array-0.4.0.1 ... linking ... done.
Loading package deepseq-1.3.0.1 ... linking ... done.
Loading package containers-0.5.0.0 ... linking ... done.
Loading package bytestring-0.10.0.2 ... linking ... done.
Loading package tagged-0.7.1 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package transformers-compat-0.1.1.1 ... linking ... done.
Loading package contravariant-0.4.4 ... linking ... done.
Loading package distributive-0.4.3.1 ... linking ... done.
Loading package mtl-2.1.3.1 ... linking ... done.
Loading package text-1.1.0.1 ... linking ... done.
Loading package hashable-1.2.1.0 ... linking ... done.
Loading package nats-0.1.2 ... linking ... done.
Loading package unordered-containers-0.2.3.3 ... linking ... done.
Loading package semigroups-0.12.2 ... linking ... done.
Loading package comonad-4.0.1 ... linking ... done.
Loading package semigroupoids-4.0.1 ... linking ... done.
Loading package data-lens-2.10.4 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package data-lens-template-2.1.8 ... linking ... done.

However, when compiling with ghc -package-id editline-0.2.1.1-ef91ae78e7ea1b9142c2fb0b84e85c11 link.hs, I get

[1 of 1] Compiling M                ( link.hs, link.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package editline-0.2.1.1 ... linking ... ghc: /home/feuerbach/work/.cabal-sandbox/lib/i386-linux-ghc-7.6.3/editline-0.2.1.1/HSeditline-0.2.1.1.o: unknown symbol `el_reset'
ghc: unable to load package `editline-0.2.1.1'

This is a problem because that's how cabal invokes ghc.

This looks similar to #4899, except there's nothing "non-standard" here (no profiling or dynamic linking).

Change History (3)

comment:1 Changed 14 months ago by rwbarton

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

I was able to reproduce this in 7.6 but not 7.8, so I assume it has been fixed by the switch to using dynamic libraries for TH. Please reopen if you find otherwise.

comment:2 Changed 11 months ago by Fuuzetsu

Is there any workaround at all for 7.6.3? We're currently hitting this from new Yi dependency (bug filed with library author at https://github.com/Aelve/charsetdetect-ae/issues/1) and I would hate to find out it's ‘don't use this library or drop support for 7.6.3’, especially considering there aren't exactly many alternative libraries for this.

comment:3 Changed 11 months ago by rwbarton

Note: See TracTickets for help on using tickets.