Skip to content

cross compilation tries to compile and run setup program #2164

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

Closed
joeyh opened this issue Oct 15, 2014 · 4 comments
Closed

cross compilation tries to compile and run setup program #2164

joeyh opened this issue Oct 15, 2014 · 4 comments

Comments

@joeyh
Copy link

joeyh commented Oct 15, 2014

I am using ghc-android to cross compile for android, and cabal used to detect it was being used with a cross compiling ghc, for Build-Type: simple packages, always run the simple setup code that's built into cabal. However, I rebuilt my environment today (also changing it to be based on Debian jessie instead of Debian wheezy, but not otherwise changing anything except the version of cabal), and this no longer works properly. Cabal instead compiles a setup program, and tries to run it, which of course fails because the program was built targeting a different OS than the host OS.

Stracing cabal showed it was copying the compiled setup program into a setup-exe-cache inside .cabal.

I see a comment in the cabal source that parallel installs always use external setup. I was not explictly using -j, but that seems a broken thing to do for cross compile setups anyhow.

I plan to check why determineSetupMethod is picking external, and follow up to this bug.

cabal-install version 1.20.0.3
using version 1.20.0.2 of the Cabal library

@23Skidoo
Copy link
Member

Duplicate of #1493.

@joeyh
Copy link
Author

joeyh commented Oct 15, 2014

#1493 is not the same as this bug, that is about Build-Type: Custom, and this is about Build-Type: simple.

Looking at the ghc-ios docs, they include a note that the user needs to comment out jobs: $ncpus in .cabal/config, so default parallel installs is probably the cause of the problem.

So I think that cabal should disable paralelism when cross compiling.

@joeyh
Copy link
Author

joeyh commented Oct 15, 2014

Confirmed that -j1 avoids this problem, so I will make ghc-android use that by default in its cabal wrapper.

@23Skidoo
Copy link
Member

#1493 is not the same as this bug, that is about Build-Type: Custom, and this is about Build-Type: simple.

The root cause is the same, since install -j always uses the external setup method.

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