JuliaTesting / Aqua.jl

Auto QUality Assurance for Julia packages
MIT License
334 stars 24 forks source link

Stale deps: False positive on Windows? #262

Closed andreasvarga closed 7 months ago

andreasvarga commented 7 months ago

I got the following diagnosis message for the DescriptorSystems package:

julia> Aqua.test_stale_deps(DescriptorSystems)
DescriptorSystems [top-level]: Test Failed at C:\Users\Andreas\.julia\packages\Aqua\jBmtw\src\stale_deps.jl:32
  Expression: result ⊜ true
   Evaluated: ⟪result: 😭 FAILED: DescriptorSystems [top-level]
    Some package(s) in `deps` of DescriptorSystems [top-level] are not loaded during via `using DescriptorSystems`.
    * MatrixEquations [99c1a7ee-ab34-5fd5-8076-27c950a045f4]
    * MatrixPencils [48965c70-4690-11ea-1f13-43a2532b2fa8]

    To ignore from stale dependency detection, pass the package name to `ignore` keyword argument of `Aqua.test_stale_deps`
⟫ ⊜ true

Stacktrace:
 [1] macro expansion
   @ C:\Users\Andreas\AppData\Local\Programs\Julia-1.9.2\share\julia\stdlib\v1.9\Test\src\Test.jl:478 [inlined]
 [2] macro expansion
   @ C:\Users\Andreas\.julia\packages\Aqua\jBmtw\src\stale_deps.jl:32 [inlined]
 [3] macro expansion
   @ C:\Users\Andreas\AppData\Local\Programs\Julia-1.9.2\share\julia\stdlib\v1.9\Test\src\Test.jl:1586 [inlined]
 [4] test_stale_deps(packages::Module; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Aqua C:\Users\Andreas\.julia\packages\Aqua\jBmtw\src\stale_deps.jl:30
Test Summary:                 | Fail  Total  Time
DescriptorSystems [top-level] |    1      1  0.0s
ERROR: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.

However, in the module definition I am using

module DescriptorSystems

using LinearAlgebra
using MatrixEquations
using MatrixPencils
using Polynomials
using Random

so, I assume that using DescriptorSystems should load both MatrixEquations and MatrixPencils, in accordance with the specified dependencies in Project.toml:


[deps]
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MatrixEquations = "99c1a7ee-ab34-5fd5-8076-27c950a045f4"
MatrixPencils = "48965c70-4690-11ea-1f13-43a2532b2fa8"
Polynomials = "f27b6e38-b328-58d1-80ce-0feddd5e7a45"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

Sorry, if my understanding is wrong, but I wonder what is the isssue here.

lgoettgens commented 7 months ago

Could you please have a look which Aqua version you are using?

andreasvarga commented 7 months ago

I was using v0.8.2. I updated to v0.8.4 and now I got

julia> Aqua.test_stale_deps(DescriptorSystems)
Test Failed at C:\Users\Andreas\.julia\packages\Aqua\9p8ck\src\stale_deps.jl:31
  Expression: isempty(stale_deps)
   Evaluated: isempty(Base.PkgId[MatrixEquations [99c1a7ee-ab34-5fd5-8076-27c950a045f4], MatrixPencils [48965c70-4690-11ea-1f13-43a2532b2fa8]])

ERROR: There was an error during testing 
lgoettgens commented 7 months ago

On my arch linux system, the test passes (with Aqua v0.8.4 and DescriptorSystems master):

julia> Aqua.test_stale_deps(DescriptorSystems)
Test Passed

so my only guess is that this is due to you using Windows.

If some other julia on windows stumbles over this thread, could they please try to run Aqua.test_stale_deps(DescriptorSystems) and paste the output together with a versioninfo()?

andreasvarga commented 7 months ago

I performed all tests on Windows and Linux starting with Julia 1.8. And all tests are OK (see here). So, I assume my local stuff is not compatible (somehow).

A possible pecularity could be that all packages in question (i.e., DescriptorSystems, MatrixEquations, MatrixPencils) are local modules. Could this be an issue for Aqua?

andreasvarga commented 7 months ago

Just for fun I executed the Aqua test on Aqua itself, with the following results:

julia> using Aqua

julia> Aqua.test_all(Aqua)
Skipping Base.active_repl
Skipping Base.active_repl_backend
Test Summary:    | Pass  Total  Time
Method ambiguity |    1      1  2.0s
Test Summary:           | Pass  Total  Time
Unbound type parameters |    1      1  0.1s
Test Summary:     | Pass  Total  Time
Undefined exports |    1      1  0.0s
Test Summary:                              | Pass  Total  Time
Compare Project.toml and test/Project.toml |    1      1  0.0s
Stale dependencies: Test Failed at C:\Users\Andreas\.julia\packages\Aqua\9p8ck\src\stale_deps.jl:31
  Expression: isempty(stale_deps)
   Evaluated: isempty(Base.PkgId[Compat [34da2185-b29b-5c13-b0c7-acf172513d20]])

Stacktrace:
 [1] macro expansion
   @ C:\Users\Andreas\AppData\Local\Programs\Julia-1.9.2\share\julia\stdlib\v1.9\Test\src\Test.jl:478 [inlined]
 [2] test_stale_deps(pkg::Base.PkgId; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
   @ Aqua C:\Users\Andreas\.julia\packages\Aqua\9p8ck\src\stale_deps.jl:31
Test Summary:      | Fail  Total  Time
Stale dependencies |    1      1  1.8s
ERROR: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.
julia> versioninfo()
Julia Version 1.9.2
Commit e4ee485e90 (2023-07-05 09:39 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 16 × Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
  Threads: 1 on 16 virtual cores

(@v1.9) pkg> status Aqua
Status `C:\Users\Andreas\.julia\environments\v1.9\Project.toml`
  [4c88cf16] Aqua v0.8.4

So, it seems to be not only my problem. A similar error occurs also with Julia 1.10!

lgoettgens commented 7 months ago

No, this error is indeed expected. Compat.jl is only conditionally loaded for some selected julia versions. Thus, we ignore Compat for the stale deps test, see https://github.com/JuliaTesting/Aqua.jl/blob/34a1a02c1bd13f2273c8dbd9b533acb20144c57e/test/test_smoke.jl#L8

andreasvarga commented 7 months ago

I loaded explicitly the two packages MatrixEquations and MatrixPencils with

Pkg.add("MatrixEquations")
Pkg.add("MatrixPencils")

and then

julia> Aqua.test_stale_deps(DescriptorSystems)
Test Passed

So, apparently local modules used for developments are treated differently than their registered versions.

andreasvarga commented 7 months ago

The next what I did was to restore the usage of the development versions, e.g.

(@v1.9) pkg> develop "C:\\Users\\Andreas\\Documents\\software\\Julia\\MatrixEquations.jl"
(@v1.9) pkg> develop "C:\\Users\\Andreas\\Documents\\software\\Julia\\MatrixPencils.jl"

(@v1.9) pkg> status MatrixEquations
Status `C:\Users\Andreas\.julia\environments\v1.9\Project.toml`
  [99c1a7ee] MatrixEquations v2.4.2 `C:\Users\Andreas\Documents\software\Julia\MatrixEquations.jl`

(@v1.9) pkg> status MatrixPencils
Status `C:\Users\Andreas\.julia\environments\v1.9\Project.toml`
  [48965c70] MatrixPencils v1.8.0 `C:\Users\Andreas\Documents\software\Julia\MatrixPencils.jl`

and executed once again

julia> Aqua.test_stale_deps(DescriptorSystems)
Test Passed 

So, it works also for the local modules. For me, the issue can be closed. I still wonder if for the development of Aqua this case is of some relevance.

lgoettgens commented 7 months ago

Let me close this for now. If we ever get a similar report from someone, this may be worth investigating

andreasvarga commented 7 months ago

Just a suggestion: Only for prestige, Aqua should be Aqua-aware, so it should not show failure when executed on itself.