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

cabal passes incorrect --host= when cross-compiling #5887

Open
trofi opened this issue Feb 11, 2019 · 3 comments
Open

cabal passes incorrect --host= when cross-compiling #5887

trofi opened this issue Feb 11, 2019 · 3 comments

Comments

@trofi
Copy link
Contributor

trofi commented Feb 11, 2019

Noticed today that ghc-HEAD now fails cross-compilation from linux to windows.

The cause is non-canonical for of the --host= passed by Cabal, likely caused by 5ef3478

Here is the reproducer:

cd ghc-HEAD
$ ./configure --target=x86_64-w64-mingw32
$ make
... <somewhere in base>
checking Haskell type for useconds_t... Word32
checking Haskell type for suseconds_t... configure: error: type not found

libraries/base/dist-install/build/config.log shows extra argument:

$ //home/slyfox/dev/git/ghc-mingw32/libraries/base/configure --with-compiler=ghc CFLAGS=-Wall     -Werror=unused-but-set-variable -Wno-error=inline LDFLAGS=   CPPFLAGS=    --host=x86_64-w64-mingw32 CC=/usr/lib/ccache/bin/x86_64-w64-mingw32-gcc --host=x86_64-windows

Note how --host is passed twice:

case $host in
    *mingw32*|*mingw64*|*cygwin*|*msys*)
        WINDOWS=YES;;
    *)
        WINDOWS=NO;;
esac

Cabal should pass --host= unmangled. Otherwise ${host}-<tool> toolchain tools would not detect correctly.

trofi pushed a commit to gentoo-haskell/gentoo-haskell that referenced this issue Feb 12, 2019
Starting from haskell/cabal@5ef34786d051d5
Cabal passes --host= to autoconf-based packages.

Unfortunately passed value does not match autoconf's tuple.
This causes mis-detection of a host and host tools.

Bug: haskell/cabal#5887
Package-Manager: Portage-2.3.60, Repoman-2.3.12
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
@angerman
Copy link
Collaborator

@hvr, @phadej, @bgamari shouldn't this be fixed for 8.8? Otherwise building ghc will just fail.

hamishmack added a commit to input-output-hk/haskell.nix that referenced this issue Dec 14, 2019
hamishmack added a commit to input-output-hk/haskell.nix that referenced this issue Dec 14, 2019
@nomeata
Copy link
Contributor

nomeata commented Mar 3, 2021

I think I ran into this a few weeks ago… what might be the status of that?

@jneira
Copy link
Member

jneira commented May 1, 2022

I tried recently to build base in windows and i've got the same error.
I got base with cabal get base-4.14.3.0 and build it with cabal build --allow-boot-library-installs -finteger-simple.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants