Skip to content

Avoid compiling setup executable when cross-compiling #2085

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
sergv opened this issue Sep 1, 2014 · 5 comments
Closed

Avoid compiling setup executable when cross-compiling #2085

sergv opened this issue Sep 1, 2014 · 5 comments

Comments

@sergv
Copy link
Collaborator

sergv commented Sep 1, 2014

It seems currently cabal cannot know whether it cross-compiles or not, i.e. you can pass --with-ghc, --with-gcc, --with-ld etc flags pointing to cross-compiler and other tools but there's no way to tell cabal to not try building setup executable with these tools.

When build-type of a package is Simple the cabal can avoid creating setup executable and is able to cross-compile a package. But when build-type is Custom, or when, for some other reason which I haven't figured out, cabal decides to build setup executable it uses cross-compiler and executable generally cannot be runned on the platform you're compiling. And so the cross-compilation process fails even when it could be successfully finished by using /usr/bin/runghc Setup.hs (presuming that runghc is the native interpreter for the platform you`re building on).

Given the need to support Custom build types I'd like to suggest to add an option to cabal to compile Setup.hs files with user-supplied ghc or to run them with user-supplied runghc rather than compiling them with compiler from --with-ghc.

Or maybe I missed something obvious and someone can point it out.

@23Skidoo
Copy link
Member

23Skidoo commented Sep 2, 2014

Yes, Cabal should be made aware of the distinction between host and build.

@cetu86
Copy link

cetu86 commented Sep 12, 2014

How would you implement that? Using an additional switch like --with-build-ghc?

@23Skidoo
Copy link
Member

Yes, something like configure --build-hc.

@rwbarton
Copy link
Contributor

Isn't this the same as #1493?

@23Skidoo
Copy link
Member

Closing in favour of #1493.

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