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

Fail building on SmartOS #506

Closed
complyue opened this issue Jul 7, 2021 · 2 comments
Closed

Fail building on SmartOS #506

complyue opened this issue Jul 7, 2021 · 2 comments

Comments

@complyue
Copy link
Contributor

complyue commented Jul 7, 2021

Seems related: joyent/libuv#1195 fixed by joyent/libuv@7233796

But I'm not sure where to put -D_XOPEN_SOURCE=500 to workaround this?

[root@swarmcc /swarmcc/edh-universe/haskell/network]# cabal build network
Resolving dependencies...
Build profile: -w ghc-8.8.4 -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
checking build system type... x86_64-pc-solaris2.11
checking host system type... x86_64-pc-solaris2.11
checking for gcc... /opt/local/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 we are using the GNU C compiler... yes
checking whether /opt/local/bin/gcc accepts -g... yes
checking for /opt/local/bin/gcc option to accept ISO C89... none needed
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... /opt/local/bin/gcc -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking limits.h usability... yes
checking limits.h presence... 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 fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking net/if.h usability... yes
checking net/if.h presence... yes
checking for net/if.h... yes
checking netioapi.h usability... no
checking netioapi.h presence... no
checking for netioapi.h... no
checking for struct ucred... no
checking for gai_strerror... no
checking for gethostent... no
checking for accept4... no
checking for getpeereid... no
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... no
checking for struct msghdr.msg_accrights... yes
checking for struct sockaddr.sa_len... no
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..
compiling /swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/Network/Socket/Posix/MsgHdr_hsc_make.c failed (exit code 1)
rsp file was: "/swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/Network/Socket/Posix/hsc2hscall30540-0.rsp"
command was: /opt/local/bin/gcc -c /swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/Network/Socket/Posix/MsgHdr_hsc_make.c -o /swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/Network/Socket/Posix/MsgHdr_hsc_make.o -m64 -m64 -L/opt/local/gcc9/lib/gcc/x86_64-sun-solaris2.11/9.3.0 -Wl,-R/opt/local/gcc9/lib/gcc/x86_64-sun-solaris2.11/9.3.0 -L/opt/local/lib -L/usr/lib/amd64 -Wl,-R/usr/lib/amd64 -Wl,-R/opt/local/lib -m64 -D__GLASGOW_HASKELL__=808 -Dsolaris2_BUILD_OS=1 -Dx86_64_BUILD_ARCH=1 -Dsolaris2_HOST_OS=1 -Dx86_64_HOST_ARCH=1 -Iinclude -I/swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/include -I/swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/autogen -I/swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/global-autogen -include /swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/autogen/cabal_macros.h -I/opt/local/lib/ghc-8.8.4/unix-2.7.2.2/include -I/opt/local/lib/ghc-8.8.4/time-1.9.3/include -I/opt/local/lib/ghc-8.8.4/bytestring-0.10.10.1/include -I/opt/local/include -I/opt/local/lib/ghc-8.8.4/base-4.13.0.0/include -I/opt/local/include -I/opt/local/lib/ghc-8.8.4/integer-gmp-1.0.2.0/include -I/opt/local/lib/ghc-8.8.4/include -I/opt/local/include -I/opt/local/lib/ghc-8.8.4/include/
error: In file included from /opt/local/lib/ghc-8.8.4/template-hsc.h:11,
                 from /swarmcc/edh-universe/dist-newstyle/build/x86_64-solaris/ghc-8.8.4/network-3.1.2.2/build/Network/Socket/Posix/MsgHdr_hsc_make.c:1:
MsgHdr.hsc: In function 'main':
/opt/local/lib/ghc-8.8.4/template-hsc.h:82:24: error: 'struct msghdr' has no member named 'msg_control'
   82 |                 (long) offsetof (t, f));
      |                        ^~~~~~~~
MsgHdr.hsc:35:5: note: in expansion of macro 'hsc_peek'
/opt/local/lib/ghc-8.8.4/template-hsc.h:82:24: error: 'struct msghdr' has no member named 'msg_controllen'
   82 |                 (long) offsetof (t, f));
      |                        ^~~~~~~~
MsgHdr.hsc:36:5: note: in expansion of macro 'hsc_peek'
/opt/local/lib/ghc-8.8.4/template-hsc.h:82:24: error: 'struct msghdr' has no member named 'msg_flags'
   82 |                 (long) offsetof (t, f));
      |                        ^~~~~~~~
MsgHdr.hsc:37:5: note: in expansion of macro 'hsc_peek'
/opt/local/lib/ghc-8.8.4/template-hsc.h:86:24: error: 'struct msghdr' has no member named 'msg_control'
   86 |                 (long) offsetof (t, f));
      |                        ^~~~~~~~
MsgHdr.hsc:49:5: note: in expansion of macro 'hsc_poke'
/opt/local/lib/ghc-8.8.4/template-hsc.h:86:24: error: 'struct msghdr' has no member named 'msg_controllen'
   86 |                 (long) offsetof (t, f));
      |                        ^~~~~~~~
MsgHdr.hsc:50:5: note: in expansion of macro 'hsc_poke'
/opt/local/lib/ghc-8.8.4/template-hsc.h:86:24: error: 'struct msghdr' has no member named 'msg_flags'
   86 |                 (long) offsetof (t, f));
      |                        ^~~~~~~~
MsgHdr.hsc:51:5: note: in expansion of macro 'hsc_poke'

[root@swarmcc /swarmcc/edh-universe/haskell/network]#
@complyue
Copy link
Contributor Author

complyue commented Jul 7, 2021

I think this is a regression:

https://github.com/haskell/network/pull/433/files#diff-4977bade46f19a34609d4fba8567cfbc94ab6b608492f9b6fa830e5912ed3a88L17-L18

- -- We don't use msg_control, msg_controllen, and msg_flags as these
- -- don't exist on OpenSolaris.

Seems OpenSolaris compatibility is not reserved in that PR.

@complyue
Copy link
Contributor Author

complyue commented Jul 7, 2021

I just drafted PR #507, it compiles in my case (on SunOS swarmcc 5.11 joyent_20210617T001230Z i86pc i386 i86pc), it appears OpenSolaris can supply the missing features, only if tweaked with certain CPP macros. But tbh I don't have enough expertise in justifying how it could impact others.

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

1 participant