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

network 3.1.2.1, 3.1.2.2 fail to build with GHC 8.10.5 on Mac OS Catalina #500

Closed
peterbecich opened this issue Jun 15, 2021 · 9 comments
Closed

Comments

@peterbecich
Copy link
Member

peterbecich commented Jun 15, 2021

 % cabal build
Resolving dependencies...
Build profile: -w ghc-8.10.5 -O1
In order, the following will be built (use -v for more details):
 - network-3.1.2.1 (lib:network) (first run)
Configuring network-3.1.2.1...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... x86_64-apple-darwin19.6.0
checking host system type... x86_64-apple-darwin19.6.0
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether the compiler supports GNU C... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to enable C11 features... none needed
checking for an ANSI C-conforming const... yes
checking for stdio.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for strings.h... yes
checking for sys/stat.h... yes
checking for sys/types.h... yes
checking for unistd.h... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for fcntl.h... yes
checking for sys/uio.h... yes
checking for sys/socket.h... yes
checking for netinet/in.h... yes
checking for netinet/tcp.h... yes
checking for sys/un.h... yes
checking for arpa/inet.h... yes
checking for netdb.h... yes
checking for net/if.h... yes
checking for netioapi.h... no
checking for struct ucred... no
checking for gai_strerror... yes
checking for gethostent... yes
checking for accept4... no
checking for getpeereid... yes
checking for /usr/bin/gcc options needed to detect all undeclared functions... none needed
checking whether AI_ADDRCONFIG is declared... yes
checking whether AI_ALL is declared... yes
checking whether AI_NUMERICSERV is declared... yes
checking whether AI_V4MAPPED is declared... yes
checking whether IPV6_V6ONLY is declared... yes
checking whether IPPROTO_IP is declared... yes
checking whether IPPROTO_TCP is declared... yes
checking whether IPPROTO_IPV6 is declared... yes
checking whether SO_PEERCRED is declared... no
checking for struct msghdr.msg_control... yes
checking for struct msghdr.msg_accrights... no
checking for struct sockaddr.sa_len... yes
configure: creating ./network.buildinfo
configure: creating ./config.status
config.status: creating include/HsNetworkConfig.h
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for network-3.1.2.1..

The build stalls on the last step.

 % clang --version
Apple clang version 12.0.0 (clang-1200.0.32.29)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Build is successful with GHC 8.10.4.

Is it configure: WARNING: unrecognized options: --with-compiler?

Thank you

@larskuhtz
Copy link

larskuhtz commented Jun 15, 2021

I can confirm this behavior. Building network-3.1.2.2 with GHC-8.10.5 on Github actions runner with macOS-latest hangs.

Current runner version: '2.278.0'
Operating System: Mac OS X 10.15.7 19H1217
Virtual Environment: Environment: macos-10.15 Version: 20210607.1
ghc --version
The Glorious Glasgow Haskell Compilation System, version 8.10.5
cabal --version
cabal-install version 3.4.0.0
compiled using version 3.4.0.0 of the Cabal library 
shell: /bin/bash -e {0}
Build profile: -w ghc-8.10.5 -O1
...
Building     network-3.1.2.2 (all, legacy fallback)

@larskuhtz
Copy link

This problem may be specific to Github actions. I was able to build network-3.1.2.2 on macOS Big Sur (Version 11.3) with GHC-8.10.5 on a laptop.

@peterbecich peterbecich changed the title network-3.1.2.1 fails to build with GHC 8.10.5 on Mac network 3.1.2.1, 3.1.2.2 fail to build with GHC 8.10.5 on Mac OS Catalina Jun 15, 2021
@peterbecich
Copy link
Member Author

peterbecich commented Jun 15, 2021

Thanks @larskuhtz , I observe this behavior on my laptop running Catalina:

config.status: creating include/HsNetworkConfig.h
config.status: include/HsNetworkConfig.h is unchanged
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for network-3.1.2.2..

I'm guessing your version of Clang must be at least 12.0.5: https://en.wikipedia.org/wiki/Xcode#Xcode_11.x_-_13.x_(since_SwiftUI_framework)_2 My version is 12.0.0. Maybe that is the critical difference.

@peterbecich
Copy link
Member Author

No issue with GHC 9.0.1:

 % cabal build 
Resolving dependencies...
Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
 - network-3.1.2.2 (lib:network) (first run)
Configuring network-3.1.2.2...
configure: WARNING: unrecognized options: --with-compiler
....
configure: creating ./network.buildinfo
configure: creating ./config.status
config.status: creating include/HsNetworkConfig.h
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library for network-3.1.2.2..
Building library for network-3.1.2.2..

Success

@peterbecich
Copy link
Member Author

peterbecich commented Jun 15, 2021

A little more information:

% cabal build -v
...
Preprocessing library for network-3.1.2.2..

creating

..../network/dist-newstyle/build/x86_64-osx/ghc-8.10.5/network-3.1.2.2/build/Network/Socket/ByteString

~/.ghcup/bin/hsc2hs '..../network/dist-newstyle/build/x86_64-osx/ghc-8.10.5/network-3.1.2.2/build/Network/Socket/ByteString/hsc2hs-response10750-0.txt'

The version of ~/.ghcup/bin/hsc2hs:

% hsc2hs --version
hsc2hs version 0.68.7

@larskuhtz
Copy link

I'm guessing your version of Clang must be at least 12.0.5: https://en.wikipedia.org/wiki/Xcode#Xcode_11.x_-_13.x_(since_SwiftUI_framework)_2 My version is 12.0.0. Maybe that is the critical difference.

yes, my laptop has 12.0.5:

$ clang --version
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: x86_64-apple-darwin20.4.0
$ hsc2hs --version
hsc2hs version 0.68.7

@kazu-yamamoto
Copy link
Collaborator

See https://gitlab.haskell.org/ghc/ghc/-/issues/19968

@peterbecich
Copy link
Member Author

#500 (comment)
Thanks, I was unaware of this

@kazu-yamamoto
Copy link
Collaborator

This is due to GHC. Let's close.

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

3 participants