Skip to content

--enable-executable-dynamic and template haskell causing errors #1553

Closed

Description

@MetaMemoryT

building yesod-bin leads to:

Scaffolding/Scaffolder.hs:54:22:
    Dynamic linking required, but this is a non-standard build (eg. prof).
    You need to build the program twice: once the normal way, and then
    in the desired way using -osuf to set the object file suffix.
cabal: Error: some packages failed to install:

with these command line options:

'cabal' 'install' '--builddir=/home/bob/.cache/haskell/ghc-7.6.3-package-build-files/yesod-bin' '--enable-library-profiling' '--enable-shared' '--with-compiler=/usr/bin/ghc-7.6.3' '--enable-executable-dynamic' '--reinstall' '--force-reinstalls'

I have tried cleaning the build directory, but the same message still occurs.

I have also tried removing profiling, but the same message still occurs:
'cabal' 'install' '--builddir=/home/bob/.cache/haskell/ghc-7.6.3-package-build-files/yesod-bin' '--enable-shared' '--with-compiler=/usr/bin/ghc-7.6.3' '--enable-executable-dynamic' '--reinstall' '--force-reinstalls'

I have also tried removing profiling and --enable-shared, but the same message still occurs:
'cabal' 'install' '--builddir=/home/bob/.cache/haskell/ghc-7.6.3-package-build-files/yesod-bin' '--with-compiler=/usr/bin/ghc-7.6.3' '--enable-executable-dynamic' '--reinstall' '--force-reinstalls'

I have also tried in-directory build with no dynamic first:

'cabal' 'install' '--with-compiler=/usr/bin/ghc-7.6.3' '--reinstall' '--force-reinstalls'

and then tried to add --enable-executable-dynamic:

'cabal' 'install' '--with-compiler=/usr/bin/ghc-7.6.3' '--reinstall' '--enable-executable-dynamic' '--force-reinstalls'

so it is really --enable-executable-dynamic and template haskell causing errors

Activity

  1. 23Skidoo commented on Oct 20, 2013

    @23Skidoo
    Member

    Try editing the .cabal file and adding Extensions: TemplateHaskell to the Executable stanza.

  2. 23Skidoo commented on Oct 25, 2013

    @23Skidoo
    Member

    Closing since this seems to be a bug in yesod-bin. Please reopen if you disagree.

  3. kulla commented on Mar 3, 2014

    @kulla

    I get the same error message each time I use executable-dynamic: True if I set executable-profiling: False:

    $ cabal clean && cabal configure && cabal build
    ...
    Loading package hslogger-1.2.3 ... linking ... done.
    Loading package regex-posix-0.95.2 ... linking ... done.
    Loading package regex-compat-0.95.1 ... linking ... done.
    Loading package MissingH-1.2.0.2 ... linking ... done.
    HTMLRenderer.hs:31:23:
        Dynamic linking required, but this is a non-standard build (eg. prof).
        You need to build the program twice: once the normal way, and then
        in the desired way using -osuf to set the object file suffix.
    

    If I set executable-profiling to True I get:

    $ cabal clean && cabal configure && cabal build
    cleaning...
    Resolving dependencies...
    Configuring RSSGen-0.1.0.0...
    Building RSSGen-0.1.0.0...
    Preprocessing executable 'RSSGen' for RSSGen-0.1.0.0...
    
    main.hs:1:1:
        Could not find module `Prelude'
        Perhaps you haven't installed the "p_dyn" libraries for package `base'?
        Use -v to see a list of the files searched for.    
    

    I compiled my whole haskell packages with cabal and the settings:

    library-profiling: True
    shared: True
    executable-dynamic: True
    executable-profiling: True
    

    I have Ubuntu 13.10 installed. Do I have to recompile everything with executable-profiling: False and library-profiling: False?

  4. kulla commented on Mar 3, 2014

    @kulla

    As suggested I already added Extensions: TemplateHaskell to my cabal file. My cabal version:

    $ cabal --version
    cabal-install version 1.16.0.2
    using version 1.16.0 of the Cabal library
    

    GHC version:

    $ ghc --version
    The Glorious Glasgow Haskell Compilation System, version 7.6.3
    
  5. kulla commented on Mar 3, 2014

    @kulla

    Mailinglist discussion about TemplateHaskell and dynamic linking: http://www.haskell.org/pipermail/glasgow-haskell-users/2014-February/024647.html (-dynamic will be mandatory for TemplateHaskell and is implied by using it). Maybe I have to upgrade to GHC 7.8 and Cabal 1.18?!

  6. 23Skidoo commented on Mar 3, 2014

    @23Skidoo
    Member

    @kulla Yes, please try with 1.18.

  7. kulla commented on Mar 3, 2014

    @kulla

    With cabal 1.18 everything worked fine! ;-)

    I noticed that now ghc is called 3 times (with cabal 1.16 just one time). First time with arguments -no-link -static, then with -no-link -dynamic -osuf dyn_o -dyn_hi dyn_hi and then with -dynamic -osuf dyn_o -hisuf dyn_hi. If I remember well with cabal 1.16 there was just one ghc call with argument -dynamic. This must be the reason, why it did not work...

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions