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

bash 4.4 fails to cross-compile for Windows (pkgsCross.mingwW64.bash) #119206

Closed
ramirez7 opened this issue Apr 12, 2021 · 3 comments
Closed

bash 4.4 fails to cross-compile for Windows (pkgsCross.mingwW64.bash) #119206

ramirez7 opened this issue Apr 12, 2021 · 3 comments
Labels
0.kind: bug Something is broken 6.topic: windows Running, or buiding, packages on Windows

Comments

@ramirez7
Copy link
Contributor

Describe the bug
pkgsCross.mingwW64.bash fails with

nix-repl> :b p.pkgsCross.mingwW64.bash
builder for '/nix/store/wpxw7f2dh4aandb84r8jw84r9vq9dc4k-bash-4.4-p23-x86_64-w64-mingw32.drv' failed with exit code 2; last 10 log lines:
  rm -f mksyntax.exe
  gcc  -DPROGRAM='"bash.exe"' -DCONF_HOSTTYPE='"x86_64"' -DCONF_OSTYPE='"mingw32"' -DCONF_MACHTYPE='"x86_64-w64-mingw32"' -DCONF_VENDOR='"w64"' -DLOCALEDIR='"/nix/store/z8fqks8jcmkd203yjwqlpf5dj6zivk69-bash-4.4-p23-x86_64-w64-mingw32/share/locale"' -DPACKAGE='"bash"' -DSHELL -DHAVE_CONFIG_H   -I.  -I. -I./include -I./lib -I./lib/intl -I/build/bash-4.4/lib/intl  -g -DCROSS_COMPILING  -g -DCROSS_COMPILING -o mksyntax.exe ./mksyntax.c 
  In file included from ./mksyntax.c:23:
  ./config.h:353:19: error: two or more data types in declaration specifiers
    353 | #define socklen_t unsigned int
        |                   ^~~~~~~~
  ./config.h:353:28: error: two or more data types in declaration specifiers
    353 | #define socklen_t unsigned int
        |                            ^~~
  make: *** [Makefile:691: mksyntax.exe] Error 1
[0 built (1 failed), 58 copied (2551.9 MiB), 443.8 MiB DL]
error: build of '/nix/store/wpxw7f2dh4aandb84r8jw84r9vq9dc4k-bash-4.4-p23-x86_64-w64-mingw32.drv' failed

To Reproduce
Steps to reproduce the behavior:

  1. Build pkgsCross.mingwW64.bash on either 20.09 or current HEAD (61886ca7b264a83dad1bcdf10d1a6965aab6556f)

Expected behavior
The package would build correctly.

Screenshots
n/a

Additional context
n/a
Notify maintainers

Metadata
Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module:
@ramirez7 ramirez7 added the 0.kind: bug Something is broken label Apr 12, 2021
@ramirez7
Copy link
Contributor Author

ramirez7 commented Apr 12, 2021

Looking further, I believe that bash's configure is doing this bad define because sys/socket.h is missing..which is a POSIX header, so it makes sense it isn't present for mingwW64

Maybe the issue here isn't bash but rather the fact that I'm trying to build it to begin with?

@veprbl veprbl added the 6.topic: windows Running, or buiding, packages on Windows label Apr 12, 2021
@jbalme
Copy link
Contributor

jbalme commented Apr 12, 2021

Maybe the issue here isn't bash but rather the fact that I'm trying to build it to begin with?

I believe this is correct.

Bash doesn't natively support Windows - you need to build for Cygwin (or MSYS) instead

@ramirez7
Copy link
Contributor Author

Bash doesn't natively support Windows - you need to build for Cygwin (or MSYS) instead

I'm actually only building bash transitively, so it sounds like one package in my dependency graph is not properly packaged for Windows. I'll have to hunt down the offender.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken 6.topic: windows Running, or buiding, packages on Windows
Projects
None yet
Development

No branches or pull requests

3 participants