Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preprocessing src/Foreign/Storable/Generic/Instances.hs fails for stack+OSX+ghc-8.0.1 #1

Closed
iand675 opened this issue Oct 28, 2016 · 3 comments

Comments

@iand675
Copy link

iand675 commented Oct 28, 2016

derive-storable-0.1.0.3: configure
derive-storable-0.1.0.3: build
Progress: 1/2
--  While building package derive-storable-0.1.0.3 using:
      /Users/ian/.stack/setup-exe-cache/x86_64-osx/setup-Simple-Cabal-1.24.0.0-ghc-8.0.1 --builddir=.stack-work/dist/x86_64-osx/Cabal-1.24.0.0 build --ghc-options " -ddump-hi -ddump-to-file"
    Process exited with code: ExitFailure 1
    Logs have been written to: .stack-work/logs/derive-storable-0.1.0.3.log

    Configuring derive-storable-0.1.0.3...
    Building derive-storable-0.1.0.3...
    Preprocessing library derive-storable-0.1.0.3...
    [1 of 4] Compiling Foreign.Storable.Generic.Tools ( src/Foreign/Storable/Generic/Tools.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/Foreign/Storable/Generic/Tools.o )
    [2 of 4] Compiling Foreign.Storable.Generic.Internal ( src/Foreign/Storable/Generic/Internal.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/Foreign/Storable/Generic/Internal.o )
    [3 of 4] Compiling Foreign.Storable.Generic.Instances ( src/Foreign/Storable/Generic/Instances.hs, .stack-work/dist/x86_64-osx/Cabal-1.24.0.0/build/Foreign/Storable/Generic/Instances.o )

    /private/var/folders/v6/w9s25grj1xg_9tj3dg07cflc0000gn/T/stack2438/derive-storable-0.1.0.3/src/Foreign/Storable/Generic/Instances.hs:55:1: error:
        Parse error: naked expression at top level
        Perhaps you intended to use TemplateHaskell
@mkloczko
Copy link
Owner

I will look more into it when I'll have access to OSX.

In the meantime: does the error occur when building derive-storable as a dependency ? Or when built by itself ? I am quite curious why the 'naked expression' appears at line 55, and not before. Is there some noise in the source file ?

@codygman
Copy link

codygman commented Nov 24, 2016

I have this issue as well. I did a bit of research and it may be related to this:

haskell/cabal#1740

root cause of that issue (basically preprocessing twice): https://gist.github.com/mzero/d4ba11c567977111749a

However using -optP-P did not fix this issue for me.

mkloczko pushed a commit that referenced this issue Nov 29, 2016
mkloczko pushed a commit that referenced this issue Nov 30, 2016
Fixes issue #1 on OSX.

Removed the tests related to bad numbering of fields.
@mkloczko
Copy link
Owner

Thank you for your help!

It seems like the issue was with the white space between MakeGStorable and it's argument.

This should be fixed by now. The fix was uploaded to hackage.

mkloczko pushed a commit that referenced this issue Nov 30, 2016
Fixes issue #1 on OSX.

Removed the tests related to bad numbering of fields.
@mkloczko mkloczko closed this as completed Dec 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants