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

update/make default GHC 9.0 #1615

Merged
merged 10 commits into from
Jul 21, 2021
Merged

update/make default GHC 9.0 #1615

merged 10 commits into from
Jul 21, 2021

Conversation

simonmichael
Copy link
Owner

@simonmichael simonmichael commented Jul 17, 2021

Update tests, stack, CI configs for GHC 9.0. Part of #1503.

@simonmichael simonmichael added packaging Dependencies, version constraints, packaging.. tools hledger developer tools, scripts, processes.. labels Jul 17, 2021
@simonmichael
Copy link
Owner Author

@Xitian9 in case you have some spare time: Hledger.Data.Json is producing an unstable order for object fields, or at least different between our GHC 8.10 and GHC 9.0 builds. Possibly related to the *KV code ? pairs or mconcat producing a different ordering ?

$ stack exec -- shelltest hledger/test/json.test -i1:hledger/test/json.test:1: [Failed]
Command (at line 6):
hledger -f- reg --output-format=json
Expected stdout: 
[
    [
        "2019-01-01",
        null,
        "",
        {
            "pbalanceassertion": null,
            "pstatus": "Unmarked",
            "pamount": [
                {
                    "aprice": null,
                    "acommodity": "AAA",
                    "aquantity": {
                        "floatingPoint": 1,
                        "decimalPlaces": 1,
                        "decimalMantissa": 10
                    },
                    "aismultiplier": false,
    ...(1165 more)
Got stdout:      
[
    [
        "2019-01-01",
        null,
        "",
        {
            "pdate": null,
            "poriginal": null,
            "ptags": [],
            "paccount": "a",
            "pdate2": null,
            "ptype": "VirtualPosting",
            "pbalanceassertion": null,
            "pstatus": "Unmarked",
            "pamount": [
                {
                    "aprice": null,
                    "acommodity": "AAA",
                    "astyle": {
                        "aspr...(1165 more)

         Test Cases  Total      
 Passed  0           0          
 Failed  1           1          
 Total   1           1          

I think these are the package versions used in the GHC 8.10 build:

hledger-lib-1.22
template-haskell-2.16.0.0
Decimal-0.5.2
Glob-0.10.1
aeson-1.5.6.0
aeson-pretty-0.8.8
ansi-terminal-0.11
array-0.5.4.0
base-4.14.1.0
base-compat-batteries-0.11.2
blaze-markup-0.8.2.8
bytestring-0.10.12.0
call-stack-0.3.0
cassava-0.5.2.0
cassava-megaparsec-2.0.2
cmdargs-0.10.21
containers-0.6.2.1
data-default-0.7.1.1
directory-1.3.6.0
doctest-0.18.1
extra-1.7.9
file-embed-0.0.14.0
filepath-1.4.2.1
hashtables-1.2.4.1
megaparsec-9.0.1
mtl-2.2.2
old-time-1.1.0.3
parser-combinators-1.2.1
pretty-simple-4.0.0.0
regex-tdfa-1.3.1.1
safe-0.3.19
tabular-0.2.2.8
tasty-1.4.1
tasty-hunit-0.10.0.3
template-haskell-2.16.0.0
text-1.2.4.1
time-1.9.3
timeit-2.0
transformers-0.5.6.2
uglymemo-0.1.0.1
unordered-containers-0.2.14.0
utf8-string-1.0.2

And these with the GHC 9.0 build:

hledger-lib-1.22
template-haskell-2.17.0.0
Decimal-0.5.2
Glob-0.10.1
aeson-1.5.6.0
aeson-pretty-0.8.8
ansi-terminal-0.11
array-0.5.4.0
base-4.15.0.0
base-compat-batteries-0.11.2
blaze-markup-0.8.2.8
bytestring-0.10.12.1
call-stack-0.4.0
cassava-0.5.2.0
cassava-megaparsec-2.0.2
cmdargs-0.10.21
containers-0.6.4.1
data-default-0.7.1.1
directory-1.3.6.1
doctest-0.18.1
extra-1.7.9
file-embed-0.0.14.0
filepath-1.4.2.1
hashtables-1.2.4.1
megaparsec-9.0.1
mtl-2.2.2
old-time-1.1.0.3
parser-combinators-1.3.0
pretty-simple-4.0.0.0
regex-tdfa-1.3.1.1
safe-0.3.19
tabular-0.2.2.8
tasty-1.4.1
tasty-hunit-0.10.0.3
template-haskell-2.17.0.0
text-1.2.4.1
time-1.9.3
timeit-2.0
transformers-0.5.6.2
uglymemo-0.1.0.1
unordered-containers-0.2.14.0
utf8-string-1.0.2

@simonmichael
Copy link
Owner Author

containers-0.6.2.1 -> containers-0.6.4.1 maybe.

@Xitian9
Copy link
Collaborator

Xitian9 commented Jul 20, 2021

Perhaps related to this: haskell/aeson#837

@Xitian9
Copy link
Collaborator

Xitian9 commented Jul 21, 2021

Just random speculation here: this might be related to the change in underlying integer representation in ghc-9.0.

The question is what to do about it. The ordering of fields has never been guaranteed by the aeson library, and any choice we make may fail on other platforms or when versions change. Ideally we would find a way to test which does not care about field ordering: either with unit tests or some other non-functest. Alternately we could make sure to sort the output before printing, but this seems like unnecessary work just to make sure functests work.

@simonmichael
Copy link
Owner Author

simonmichael commented Jul 21, 2021 via email

@Xitian9
Copy link
Collaborator

Xitian9 commented Jul 21, 2021

Actually, it looks like aeson-pretty provides an option for specifying sort order if we don't use the default configuration. I'll submit a PR.

@Xitian9
Copy link
Collaborator

Xitian9 commented Jul 21, 2021

Question: do we want to tweak the sort order so it is identical to identical to that in the tests (essentially manually defining the order: very labour intensive), or do we want a sensible order which differs from previous behaviour, like alphabetical?

@simonmichael
Copy link
Owner Author

simonmichael commented Jul 21, 2021 via email

@Xitian9
Copy link
Collaborator

Xitian9 commented Jul 21, 2021

Implemented in #1618.

@simonmichael simonmichael marked this pull request as ready for review July 21, 2021 06:38
@simonmichael simonmichael merged commit 861c344 into master Jul 21, 2021
@simonmichael
Copy link
Owner Author

Thank you very much! Merging that and this, so we can now use GHC 9.0 by default.

@simonmichael simonmichael deleted the ghc9 branch October 18, 2023 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging Dependencies, version constraints, packaging.. tools hledger developer tools, scripts, processes..
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants