snapframework / io-streams-haproxy

HAProxy protocol v1.5 support for io-streams
BSD 3-Clause "New" or "Revised" License
7 stars 17 forks source link

conditional compilation for Windows and Linux #6

Closed mantkiew closed 7 years ago

mantkiew commented 9 years ago

Changed build type to Configure. Heavily based on the network package.

mantkiew commented 9 years ago

Some test cases fail and I don't know enough to fix them

Tests.HAProxy:
  test/old_ha_proxy: [Failed]
ERROR: getAddrInfo: does not exist (error 10093)
  test/old_ha_proxy6: [Failed]
ERROR: getAddrInfo: does not exist (error 10093)
  test/old_ha_proxy_failure: [OK]
  test/old_ha_proxy_local: [OK]
  test/old_ha_proxy_local6: [Failed]
ERROR: getAddrInfo: does not exist (error 10093)
  test/old_ha_proxy_bad_address: [OK]
  test/blackbox: [Failed]
ERROR: getAddrInfo: does not exist (error 10093)
  test/blackbox_local: [Failed]
ERROR: getAddrInfo: does not exist (error 10093)
  test/new_ha_proxy: [OK]
  test/new_ha_proxy_6: [Failed]
ERROR: getAddrInfo: does not exist (error 10093)
  test/new_ha_proxy_too_big: [OK]
  test/new_ha_proxy_too_small: [OK]
  test/new_ha_proxy_bad_version: [OK]
  test/new_ha_proxy_local: [OK]
  test/address/getSockAddr: [Failed]
ERROR: getAddrInfo: does not exist (error 10093)
  test/trivials: [OK]

         Test Cases  Total
 Passed  9           9
 Failed  7           7
 Total   16          16
Test suite testsuite: FAIL
mantkiew commented 9 years ago

I was then able to build the package snap-1.0.0.0 and the other packages.

gregorycollins commented 9 years ago

I really don't want to merge anything requiring autoconf or a configure script for this, I'm sorry. :-( I think it was a mistake for the network package to go in that direction in the first place.

Is it possible to reformulate this using cabal directives? I.e. you can write

if os(windows)
  cpp-options: -DWINDOWS
  c-sources: cbits/windows.c
else
  ...