This causes problems on mac at least, and we already do it in
.github/workflows/linux.yml, so probably best not to add it here.
This reverts commit 84d479cdc4.
This commit introduces IPv6 support (and thus closes#1145).
It also allows using local hostnames as a parameter for --host.
For this, multiple things needed to be changed:
- checkWebOpts is dropped, as the supplied parameter is checked later
by Network.Socket.getAddrInfo
- defbaseurl needs to check if : is used in the host, as this indicates
the usage of an IPv6 address. In this case, the host needs to be
wrapped in [] for the base URL
- To allow opening such a modified base URL, runHostPortFullUrl is used
instead of runhostPortUrl, as it allows opening arbitrary URLs instead
of a path prefixed with http://127.0.0.1
As checking the host for validity is postponed until the webserver tries
to start, an invalid hostname leads to an exception caused by
Network.Socket.getAddrInfo.
This is still fine, as hledger-web won't start in an undefined state, but
will terminate with a nonzero exit code.
fail is moving out of Monad and into it's own MonadFail class.
This will be enforced in GHC 8.8 (I think).
base-compat/base-compat-batteries 0.11.0 have adapted to this,
and are approaching stackage nightly
(https://github.com/commercialhaskell/stackage/issues/4802).
hledger is now ready to build with base-compat-batteries 0.11.0, once
all of our deps do (eg aeson). We are still compatible with the older
0.10.x and GHC 7.10.3 as well.
For now we are using both fails:
- new fail (from Control.Monad.Fail), used in our parsers, imported
via base-compat-batteries Control.Monad.Fail.Compat to work with
older GHC versions.
- old fail (from GHC.Base, exported by Prelude, Control.Monad,
Control.Monad.State.Strict, Prelude.Compat, ...), used in easytest's
Test, since I couldn't find their existing fail implementation to update.
To reduce (my) confusion, these are imported carefully, consistently,
and qualified everywhere as Fail.fail and Prelude.fail, with clashing
re-exports suppressed, like so:
import Prelude hiding (fail)
import qualified Prelude (fail)
import Control.Monad.State.Strict hiding (fail)
import "base-compat-batteries" Prelude.Compat hiding (fail)
import qualified "base-compat-batteries" Control.Monad.Fail.Compat as Fail