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

atomic-primops does not compile with ghc-7.4, problem with Any type #9

Closed
robstewart57 opened this issue Jul 17, 2013 · 1 comment
Closed

Comments

@robstewart57
Copy link
Contributor

I've spotted this commit that suggests the Any type should not cause issues with GHC-7.4. However, at least on Linux, the following is me trying with 7.4 and failing, then 7.6 and succeeding:

$ export PATH=~/sw/ghc/7.4.1/x86_64/bin:$PATH
bash-4.1$ cabal clean
cleaning...
Error while removing dist/: dist/setup: removeDirectory: unsatisified constraints (Directory not empty)
bash-4.1$ cabal install
Resolving dependencies...
[1 of 1] Compiling Main             ( Setup.hs, dist/setup/Main.o )
Linking ./dist/setup/setup ...
Configuring atomic-primops-0.2.2.1...
Building atomic-primops-0.2.2.1...
Preprocessing library atomic-primops-0.2.2.1...
[1 of 6] Compiling Data.Atomics.Counter.Foreign ( Data/Atomics/Counter/Foreign.hs, dist/build/Data/Atomics/Counter/Foreign.o )
[2 of 6] Compiling Data.Atomics.Counter.Reference ( Data/Atomics/Counter/Reference.hs, dist/build/Data/Atomics/Counter/Reference.o )
[3 of 6] Compiling Data.Atomics.Internal ( Data/Atomics/Internal.hs, dist/build/Data/Atomics/Internal.o )

Data/Atomics/Internal.hs:115:1:
    Unacceptable argument type in foreign declaration: Any (* -> *) ()
    When checking declaration:
      foreign import prim safe "static stg_casArrayzh" casArrayTypeErased#
        :: MutableArray# RealWorld ()
           -> Int#
              -> Any ()
                 -> Any ()
                    -> State# RealWorld -> (# State# RealWorld, Int#, Any () #)

Data/Atomics/Internal.hs:115:1:
    Unacceptable argument type in foreign declaration: Any (* -> *) ()
    When checking declaration:                                                                                                                                                     
      foreign import prim safe "static stg_casArrayzh" casArrayTypeErased#
        :: MutableArray# RealWorld ()
           -> Int#
              -> Any ()
                 -> Any ()
                    -> State# RealWorld -> (# State# RealWorld, Int#, Any () #)

Data/Atomics/Internal.hs:123:1:
    Unacceptable argument type in foreign declaration: Any (* -> *) ()
    When checking declaration:
      foreign import prim safe "static stg_casMutVar2zh" casMutVar_TypeErased#
        :: MutVar# RealWorld ()
           -> Any ()
              -> Any ()
                 -> State# RealWorld -> (# State# RealWorld, Int#, Any () #)

Data/Atomics/Internal.hs:123:1:
    Unacceptable argument type in foreign declaration: Any (* -> *) ()
    When checking declaration:
      foreign import prim safe "static stg_casMutVar2zh" casMutVar_TypeErased#
        :: MutVar# RealWorld ()
           -> Any ()
              -> Any ()
                 -> State# RealWorld -> (# State# RealWorld, Int#, Any () #)
cabal: Error: some packages failed to install:
atomic-primops-0.2.2.1 failed during the building phase. The exception was:
ExitFailure 1

$ export PATH=~/sw/ghc/ghc-7.6.3-BUILD/bin:$PATH
bash-4.1$ cabal clean
cleaning...
Error while removing dist/: dist/setup: removeDirectory: unsatisified constraints (Directory not empty)
bash-4.1$ cabal install
Resolving dependencies...
[1 of 1] Compiling Main             ( /tmp/bits-atomic-0.1.3-19929/bits-atomic-0.1.3/Setup.hs, /tmp/bits-atomic-0.1.3-19929/bits-atomic-0.1.3/dist/setup/Main.o )

/tmp/bits-atomic-0.1.3-19929/bits-atomic-0.1.3/Setup.hs:15:35: Warning:
    In the use of `runTests'
    (imported from Distribution.Simple, but defined in Distribution.Simple.UserHooks):
    Deprecated: "Please use the new testing interface instead!"
Linking /tmp/bits-atomic-0.1.3-19929/bits-atomic-0.1.3/dist/setup/setup ...
Configuring bits-atomic-0.1.3...
Building bits-atomic-0.1.3...
Preprocessing library bits-atomic-0.1.3...
[1 of 1] Compiling Data.Bits.Atomic ( Data/Bits/Atomic.hs, dist/build/Data/Bits/Atomic.o )
cbits/atomic-bitops-gcc.c: In function ‘nand_and_fetch_word’:

cbits/atomic-bitops-gcc.c:260:0:
     note: ‘__sync_nand_and_fetch’ changed semantics in GCC 4.4
cbits/atomic-bitops-gcc.c: In function ‘fetch_and_nand_word’:

cbits/atomic-bitops-gcc.c:242:0:
     note: ‘__sync_fetch_and_nand’ changed semantics in GCC 4.4
In-place registering bits-atomic-0.1.3...
Installing library in ~/.cabal/lib/bits-atomic-0.1.3/ghc-7.6.3
Registering bits-atomic-0.1.3...
[1 of 1] Compiling Main             ( Setup.hs, dist/setup/Main.o )
Linking ./dist/setup/setup ...
Configuring atomic-primops-0.2.2.1...
Building atomic-primops-0.2.2.1...
Preprocessing library atomic-primops-0.2.2.1...
[1 of 6] Compiling Data.Atomics.Counter.Foreign ( Data/Atomics/Counter/Foreign.hs, dist/build/Data/Atomics/Counter/Foreign.o )
[2 of 6] Compiling Data.Atomics.Counter.Reference ( Data/Atomics/Counter/Reference.hs, dist/build/Data/Atomics/Counter/Reference.o )
[3 of 6] Compiling Data.Atomics.Internal ( Data/Atomics/Internal.hs, dist/build/Data/Atomics/Internal.o )
[4 of 6] Compiling Data.Atomics     ( Data/Atomics.hs, dist/build/Data/Atomics.o )
[5 of 6] Compiling Data.Atomics.Counter.IORef ( Data/Atomics/Counter/IORef.hs, dist/build/Data/Atomics/Counter/IORef.o )
[6 of 6] Compiling Data.Atomics.Counter ( Data/Atomics/Counter.hs, dist/build/Data/Atomics/Counter.o )
In-place registering atomic-primops-0.2.2.1...
Installing library in ~/.cabal/lib/atomic-primops-0.2.2.1/ghc-7.6.3
Registering atomic-primops-0.2.2.1...
@rrnewton
Copy link
Owner

rrnewton commented Feb 5, 2014

Thanks.. I just made the package require 7.6 plus to avoid this.

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

2 participants