Skip to content

error with bump/diff when docs.json line is longer than 65535 (in 0.19.1 but not 0.19.0) #2055

Open
@rlefevre

Description

@rlefevre

Quick Summary:

When running elm bump on justgook/alt-linear-algebra with elm 0.19.1, we get the following error:

$ elm bump
-- PROBLEM LOADING DOCS --------------------------------------------------------

I need the docs for 1.0.0 to compute the next version number, so I fetched:

    https://package.elm-lang.org/packages/justgook/alt-linear-algebra/1.0.0/docs.json

I got the data back, but it was not what I was expecting. The response body
contains 82839 bytes. Here is the beginning:

    [{"name":"AltMath.Alternative.ADT.Matrix4","comment":" This library uses ...

Does this error keep showing up? Maybe there is something weird with your
internet connection. We have gotten reports that schools, businesses, airports,
etc. sometimes intercept requests and add things to the body or change its
contents entirely. Could that be the problem?

When running the same command with elm 0.19.0, it works as expected.

SSCCE

git clone https://github.com/justgook/alt-linear-algebra.git
cd alt-linear-algebra
git checkout 1.0.0
elm bump
  • Elm: 0.19.1 (works with 0.19.0)
  • Operating System: Linux Ubuntu 18.04 & MacOS X

Additional Details

As it works with elm 0.19.0, it seems to be a regression.

The compiler fails to parse the alt-linear-algebra package documentation.

When adding a putStrLn in the compiler, we get the following error:

(Index 12 (Field "aliases" (Index 1 (Field "type" (Failure (Region (Position 1 65376) (Position 1 164)) BadType)))))

By getting the same index with jq, we get:

$ jq '.[12]["aliases"][1]["type"]' docs.json
"{ m11 : Basics.Float, m21 : Basics.Float, m31 : Basics.Float, m41 : Basics.Float, m12 : Basics.Float, m22 : Basics.Float, m32 : Basics.Float, m42 : Basics.Float, m13 : Basics.Float, m23 : Basics.Float, m33 : Basics.Float, m43 : Basics.Float, m14 : Basics.Float, m24 : Basics.Float, m34 : Basics.Float, m44 : Basics.Float }"

The full type is Matrix4Record:

{"name":"Matrix4Record","comment":" Just type alias for matrix record\n","args":[],"type":"{ m11 : Basics.Float, m21 : Basics.Float, m31 : Basics.Float, m41 : Basics.Float, m12 : Basics.Float, m22 : Basics.Float, m32 : Basics.Float, m42 : Basics.Float, m13 : Basics.Float, m23 : Basics.Float, m33 : Basics.Float, m43 : Basics.Float, m14 : Basics.Float, m24 : Basics.Float, m34 : Basics.Float, m44 : Basics.Float }"}

The fact that this type goes above the 65535 offset (error is at 65376) might also be significant if this is another 16bits integer optimization issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions