From d54dd0ef9cd216aa17913ef9cbd725945f56cbba Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 8 Oct 2020 10:50:39 -0400 Subject: [PATCH] Fix build on Windows with network-3 inet_addr was removed, but all this needs is localhost, so hardcoding it should work fine. It may be that this windows ifdef is no longer needed. It was added in 2013 with a note that getAddrInfo didn't work on windows, but it seems likely such a problem would have been fixed since. --- CHANGELOG | 6 ++++++ Utility/WebApp.hs | 5 +++-- ...ble_not_in_scope__34___when_compiling_on_Windows.mdwn | 2 ++ .../comment_1_8822bbeffb9a89daceb2900ecfe045f5._comment | 9 +++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows/comment_1_8822bbeffb9a89daceb2900ecfe045f5._comment diff --git a/CHANGELOG b/CHANGELOG index 5b14bf3e58..5bc58e6f36 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +git-annex (8.20201008) UNRELEASED; urgency=medium + + * Fix build on Windows with network-3. + + -- Joey Hess Thu, 08 Oct 2020 10:48:17 -0400 + git-annex (8.20201007) upstream; urgency=medium * --json output now includes a new field "input" which is the input diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index 62c6e2fd68..8e89517a6c 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -86,11 +86,12 @@ webAppSettings = setTimeout halfhour defaultSettings getSocket :: Maybe HostName -> IO Socket getSocket h = do #if defined (mingw32_HOST_OS) - -- getAddrInfo currently segfaults on Android. -- The HostName is ignored by this code. + -- getAddrInfo didn't used to work on windows; current status + -- unknown. when (isJust h) $ error "getSocket with HostName not supported on this OS" - addr <- inet_addr "127.0.0.1" + let addr = tupleToHostAddress (127,0,0,1) sock <- socket AF_INET Stream defaultProtocol preparesocket sock bind sock (SockAddrInet defaultPort addr) diff --git a/doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows.mdwn b/doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows.mdwn index 84d8b1cfd3..6b2069d57d 100644 --- a/doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows.mdwn +++ b/doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows.mdwn @@ -18,3 +18,5 @@ Utility\WebApp.hs:96:33: error: - stack version: 2.3.3 - Windows version: Windows 7 Enterprise, version 6.1 + +> [[fixed|done]] --[[Joey]] diff --git a/doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows/comment_1_8822bbeffb9a89daceb2900ecfe045f5._comment b/doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows/comment_1_8822bbeffb9a89daceb2900ecfe045f5._comment new file mode 100644 index 0000000000..00789c9c68 --- /dev/null +++ b/doc/bugs/__34__Variable_not_in_scope__34___when_compiling_on_Windows/comment_1_8822bbeffb9a89daceb2900ecfe045f5._comment @@ -0,0 +1,9 @@ +[[!comment format=mdwn + username="joey" + subject="""comment 1""" + date="2020-10-08T14:38:26Z" + content=""" +Those came from the network library, but were removed in network-3.0. + +I've updated it to work with the new library. +"""]] -- 2.30.2