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

Dependency on 'linear' introduces many more recursive dependencies #37

Closed
sseefried opened this issue Jan 12, 2015 · 11 comments
Closed

Comments

@sseefried
Copy link

This is more of a comment than an issue but still worth bringing to your attention.

I'm currently working on a game that targets both iOS and Android. I am using an older binding to SDL2.
Today I tried to build the new-api branch and found that the dependency on package 'linear' introduces
a whole stack of extra dependencies. Normally I wouldn't care about this but I've found that in cross-compiling environments a lot of packages don't just build "out of the box".

Seeing at this library is intended to be used for building games in in Haskell, and one might want to target a mobile devices (necessitating a cross-compilation environment) this is something to keep in mind.

@ocharles
Copy link
Member

Do you know if the linear dependency actually causes problems, or is this just a worry in general? linear is somewhat dependency heavy, but I trust it as it's widely used - and with diagrams switching over to it, about to be even more widely used.

@sseefried
Copy link
Author

It's just a fear at this point. I'll let you know when I try it out.

@ocharles
Copy link
Member

Ok, I do hear that fear - but there's nothing much actionable from this issue right now, so I'd like to close it. Hope that's OK with you. If you do run into problems however - be sure to let us know! However, right now I think it would be wasted effort removing linear because it works.

@cies
Copy link

cies commented Dec 28, 2015

We found it to be true, after pulling in linear we cannot get the lib to cross-compile to Android. @sseefried is probably aware of this as well.

@ocharles
Copy link
Member

Could you mention what the issues are, and which packages are causing
problems?

On Mon, 28 Dec 2015 10:38 am Cies Breijs [email protected] wrote:

We found it to be true, after pulling in linear we cannot get the lib to
cross-compile to Android. @sseefried https://github.com/sseefried is
probably aware of this as well.


Reply to this email directly or view it on GitHub
#37 (comment).

@cies
Copy link

cies commented Dec 28, 2015

@EDeijl, could you please chime in here?

As I remember the issues were rather interesting, as in they just showed on Android.

@EDeijl
Copy link

EDeijl commented Dec 29, 2015

Using this Docker image, which has all the basic haskell dependencies and a ghc-7.8.3 cross-compiler.

Because cross compiling doesn't support packages with Type: Custom (issue) I manually installed all the dependencies:

cabal update
cabal get bytes-0.15.0.1 reflection-2.1 distributive-0.4.4 \
comonad-4.2.7.2 semigroupoids-5.0.0.4 lens-4.13 \
linear-1.19.1.3 sdl2-2.1.0

In all these packages I switched the project type from 'Custom' to 'Simple' and tried installing them in the order:

arm-linux-androideabi-cabal install bytes
arm-linux-androideabi-cabal install reflection -f-templatehaskell
arm-linux-androideabi-cabal install distributive
arm-linux-androideabi-cabal install comonad
arm-linux-androideabi-cabal install semigroupoids
arm-linux-androideabi-cabal install lens

Then lens fails on the package profunctors-5.1.1 with the following message:

Warning: The package list for 'hackage.haskell.org' is 218.2 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Configuring profunctors-5.1.1...
Building profunctors-5.1.1...
Preprocessing library profunctors-5.1.1...
[ 1 of 14] Compiling Data.Profunctor.Trace ( src/Data/Profunctor/Trace.hs,           dist/build/Data/Profunctor/Trace.o )
[ 2 of 14] Compiling Data.Profunctor.Unsafe ( src/Data/Profunctor/Unsafe.hs,     dist/build/Data/Profunctor/Unsafe.o )
Loading package ghc-prim ... linking ... ghc: /home/androidbuilder/.ghc/android-14/arm-linux-    androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.8.3/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o:     unhandled ELF relocation(Rel) type 28

ghc: unable to load package `ghc-prim'
Failed to install profunctors-5.1.1
Configuring vector-0.10.12.3...
Building vector-0.10.12.3...
Preprocessing library vector-0.10.12.3...
[ 1 of 19] Compiling Data.Vector.Storable.Internal ( Data/Vector/Storable/Internal.hs,     dist/build/Data/Vector/Storable/Internal.o )
[ 2 of 19] Compiling Data.Vector.Fusion.Util ( Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o )
[ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( Data/Vector/Fusion/Stream/Size.hs, dist/build/Data/Vector/Fusion/Stream/Size.o )

Data/Vector/Fusion/Stream/Size.hs:25:10: Warning:
    No explicit implementation for
      `*', `abs', and `signum'
    In the instance declaration for `Num Size'
[ 4 of 19] Compiling Data.Vector.Internal.Check ( Data/Vector/Internal/Check.hs,     dist/build/Data/Vector/Internal/Check.o )
[ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o )
Loading package ghc-prim ... linking ... ghc: /home/androidbuilder/.ghc/android-14/arm-linux-    androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.8.3/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o:     unhandled ELF relocation(Rel) type 28

ghc: unable to load package `ghc-prim'
Failed to install vector-0.10.12.3
cabal: Error: some packages failed to install:
adjunctions-4.2.1 depends on profunctors-5.1.1 which failed to install.
free-4.12.1 depends on profunctors-5.1.1 which failed to install.
kan-extensions-4.2.2 depends on profunctors-5.1.1 which failed to install.
lens-4.13 depends on vector-0.10.12.3 which failed to install.
profunctors-5.1.1 failed during the building phase. The exception was:
ExitFailure 1
vector-0.10.12.3 failed during the building phase. The exception was:
ExitFailure 1

@ocharles
Copy link
Member

It looks like your GHC can't find ghc-prim, which is going to cause all sorts of problems - not just with linear. E.g., vector also doesn't install.

@EDeijl
Copy link

EDeijl commented Dec 29, 2015

The file it is trying to link to is there, running file:

file ~/.ghc/android-14/arm-linux-androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.8.3/ghc- prim-0.3.1.0/HSghc-prim-0.3.1.0.o`

gives me the following output

/home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.8.3/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped

running the same command on an .o file for a library that did install returns the same ELF types

@ocharles
Copy link
Member

Right, but apparently it being there is not enough. I'm afraid I don't have much more that I can help you with because this is beyond my knowledge - is there a GHC-ARM community that you could reach out to here? Until you can solve the problem with

ghc: unable to load package `ghc-prim'

I think it's going to be hard to use a good part of Hackage (mostly due to the transitive dependency incurred by vector).

@cies
Copy link

cies commented Dec 30, 2015

It is probably related to this issue: neurocyte/ghc-android#25

Which is currently an unsolved issue.

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

4 participants