Closed pbrisbin closed 4 years ago
Really not sure what's up on CI:
Progress 1/2: bcp47 bcp47 >
Progress 1/2: bcp47 bcp47 > library/Data/BCP47/Internal/Parser.hs:9:1: error:
Progress 1/2: bcp47 bcp47 > Could not load module ‘Text.Megaparsec’
Progress 1/2: bcp47 bcp47 > It is a member of the hidden package ‘megaparsec-7.0.5’.
Progress 1/2: bcp47 bcp47 > You can run ‘:set -package megaparsec’ to expose it.
Progress 1/2: bcp47 bcp47 > (Note: this unloads all the modules in the current scope.)
Progress 1/2: bcp47 bcp47 > Use -v to see a list of the files searched for.
Progress 1/2: bcp47 bcp47 > |
Progress 1/2: bcp47 bcp47 > 9 | import Text.Megaparsec (Parsec, eof, lookAhead)
Progress 1/2: bcp47 bcp47 > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Progress 1/2: bcp47 bcp47 >
Progress 1/2: bcp47 bcp47 > library/Data/BCP47/Internal/Parser.hs:10:1: error:
Progress 1/2: bcp47 bcp47 > Could not load module ‘Text.Megaparsec.Char’
Progress 1/2: bcp47 bcp47 > It is a member of the hidden package ‘megaparsec-7.0.5’.
Progress 1/2: bcp47 bcp47 > You can run ‘:set -package megaparsec’ to expose it.
Progress 1/2: bcp47 bcp47 > (Note: this unloads all the modules in the current scope.)
Progress 1/2: bcp47 bcp47 > Use -v to see a list of the files searched for.
Progress 1/2: bcp47 bcp47 > |
Progress 1/2: bcp47 bcp47 > 10 | import Text.Megaparsec.Char (char)
Progress 1/2: bcp47 bcp47 > | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Progress 1/2: bcp47 bcp47 > Test suite doctest failed
I can't reproduce it locally.
Old cache?
I can try busting it, but it doesn't appear to be that (everything seems to build that I'd expect to build). So I'm afraid if busting it works I might've just papered over something that'll bite someone else later.
It seems to be this bug: https://github.com/commercialhaskell/stack/issues/5159 "Doctests in multi-package project interfering with each other"
I can repro locally (only) with:
stack build -j1 bcp47:doctest bcp47-orphans --stack-yaml "stack.yaml" --no-terminal --pedantic --test
EDIT: This still doesn't reproduce reliably. Locally it almost always works, and on CI it almost always fails.
OK, building the packages independently seems to work around the shared-environment bug. I've cleaned up history (wiping out other failed workarounds), and will merge on Green.
4e7b147 Updates for newer GHC and --pedantic
DerivingStrategies
throughout414f9ab Fix style in touched files
3e69807 Add HttpApiData orphans
To use
BCP47
as a Persist key, we need these instances.21d5f9e Export parser
It can be useful to parse
BCP47
tags in the context of a larger parser, such as parsing the HTTPAccept-Language
Header, which is formatted asDoing this on top of
fromText
is possible, but a bit annoying.NOTE: I attempted to move this to a
Data.BCP47.Parser
, but the current top-level module contains too many lower-level data definitions for that to be possible without an import-cycle. To address that, we could move most ofData.BCP47
to.Internal
modules themselves, and leaveData.BCP47
as a re-export, higher-level interface for the most common usage. This would be a Good Thing, IMO, but has been deferred for now.