jump-dev / JuMP.jl

Modeling language for Mathematical Optimization (linear, mixed-integer, conic, semidefinite, nonlinear)
http://jump.dev/JuMP.jl/
Other
2.17k stars 390 forks source link

Precompilation in CI fails on v1.22 #3746

Closed hexaeder closed 1 month ago

hexaeder commented 1 month ago

Hello, in the docs of some package I have JuMP as an indirect dependency. I experience precompile errors in the GH Actions CI on JuMP v1.22, by forcing v1.21 it works. I was not able to reproduce the problem locally.

The stacktrace

Stacktrace:
  [1] top-level scope
    @ ~/.julia/packages/JuMP/Y2NoH/src/macros/@NL.jl.3746.cov:6

implies, that this code

https://github.com/jump-dev/JuMP.jl/blob/71c7764b2861164f7e668120a8d9b700ab3e399a/src/macros.jl#L470-L472

tries to include some coverage file (don't now why it ends up therein my CI) and fails. Maybe it would already help to filter and only include *.jl files?

odow commented 1 month ago

My suggestion would be to move the documentation build to a new GitHub action job. At the moment it runs after testing, which populates the .cov coverage files: https://github.com/MakieOrg/GraphMakie.jl/blob/01c606eb7963fdad67ac91847f88a0e938ab3e91/.github/workflows/CI.yml#L44-L62

See JuMP's separate documentation.yml job: https://github.com/jump-dev/JuMP.jl/blob/master/.github/workflows/documentation.yml

exaexa commented 1 month ago

+1ing myself here, getting the same on LTS 1.6 and juMP 1.22. My logs here: https://github.com/COBREXA/COBREXA.jl/actions/runs/9118509444/job/25071800611#step:7:176

I'm using a separate documentation action workflow so I'm honestly quite puzzled on where the cov files come from. Maybe julia-cache action resurrects it from somewhere?

NOTE: it seems non-deterministic, the same code has magically fixed and broken itself again in a few instances already.

odow commented 1 month ago

I thought the loop and include was a common pattern, but it looks like I must have hit something similar, because elsewhere we also have the endswith(file, ".jl") pattern: https://github.com/jump-dev/MathOptInterface.jl/blob/8742ceb9f2a6853672f9a5c999d75ea3b162ac03/src/Test/Test.jl#L629-L630

odow commented 1 month ago

Here's another case: https://github.com/jump-dev/MultiObjectiveAlgorithms.jl/pull/81

https://github.com/jump-dev/MultiObjectiveAlgorithms.jl/blob/26a9a6462d3e948e5c8ed4c89bdfffe59bc6ca10/src/MultiObjectiveAlgorithms.jl#L633-L635

odow commented 1 month ago

I've audited jump-dev, and I think that's it: https://github.com/search?q=org%3Ajump-dev+readdir&type=code&p=1

odow commented 1 month ago

Prepping a new release: https://github.com/jump-dev/JuMP.jl/pull/3749

it'd be nice to understand why our extensions tests (https://github.com/jump-dev/JuMP.jl/actions/workflows/extension-tests.yml) didn't catch this. I guess because we run each package once, and this only shows up if you run twice, so that the .cov files get cached and included in the subsequent run.

odow commented 1 month ago

Closing because new release is https://github.com/JuliaRegistries/General/pull/107020