PackageAnalyzer.jl icon indicating copy to clipboard operation
PackageAnalyzer.jl copied to clipboard

PackageAnalyzer tests fail on Julia 1.6 (because DSP.jl version 0.8.0 uses `const` fields in `mutable struct`s)

Open DilumAluthge opened this issue 11 months ago • 2 comments

See e.g. #108 for an example (see for example this CI log).

If I understand correctly, the basic issue is as follows. The PackageAnalyzer test suite has a section in which it does find_packages() on the DSP.jl package, and then does analyze_packages(). The problem is that PackageAnalyzer pulls the latest version of DSP.jl (DSP.jl version 0.8.0). DSP.jl version 0.8.0 requires Julia 1.10+. However, PackageAnalyzer is pulling DSP.jl version 0.8.0 even if the PackageAnalyzer tests are being run with Julia 1.6.

DSP version 0.8.0 doesn't support Julia 1.6. For example, DSP version 0.8.0 uses a const field inside a mutable struct, which is a Julia syntax feature that supported on newer versions of Julia but is not supported (and, it seems, is not even parseable) on old versions of Julia such as Julia 1.6.

So, if you run the PackageAnalyzer tests with Julia 1.6, then when PackageAnalyzer tries to parse the source code of DSP version 0.8.0, Julia ends up throwing a ParseError, which you can see by looking at the CI logs in #108. The error looks like this:

nested task error: ParseError:
# Error @ /tmp/jl_gUEoe7/DSP/qzZ42/src/unwrap.jl:83:5
    periods::Int
    const val::T
#   └──────────┘ ── `const` struct field not supported in Julia version 1.6 < 1.8

@giordano @ericphanson What do you think is the best way to proceed here?

DilumAluthge avatar Dec 19 '24 23:12 DilumAluthge