Skip to content

Downgrade QA fails after test extras are promoted into runtime dependencies #5059

Description

@ChrisRackauckas-Claude

Summary

The downgrade-mtkbase (QA) lane fails on unmodified current master (e91f13e48fc4f2fdda67e66ad7b2d9c67234ac2b) with Julia 1.10.12 because julia-actions/julia-downgrade-compat@v2 rewrites every registry-backed old-style [targets].test extra into the package's runtime [deps].

For ModelingToolkitBase this changes the checkout project from 60 to 94 runtime dependencies. In particular, it makes ModelingToolkitStandardLibrary a runtime dependency of ModelingToolkitBase, while ModelingToolkitStandardLibrary already depends on ModelingToolkitBase. It also turns weak extension triggers such as DiffEqNoiseProcess into hard dependencies. Pkg then reports the cycle as:

Circular dependency detected.
Precompilation will be skipped for dependencies in this cycle:
 ┌ ModelingToolkitBase
 │  ModelingToolkitStandardLibrary
 └── ModelingToolkitBase → MTKDiffEqNoiseProcessExt

Aqua subsequently sees all promoted test extras as stale runtime dependencies and its persistent-task subprocess cannot precompile the cycle.

This is resolution/action-driven, not a ModelingToolkit source regression. The first bad action commit is 30b83cf94e89744fcbd7ea5496be4967d6fbe540 (v2.7.0); the immediately preceding 2c401f8b47edbcafc2e1edbff8e71f33dce71822 (v2.6.2) passes the exact same QA command on the exact same ModelingToolkit commit.

Exact reproduction

Run from a clean checkout of e91f13e48fc4f2fdda67e66ad7b2d9c67234ac2b, with julia-actions/julia-downgrade-compat checked out at 30b83cf94e89744fcbd7ea5496be4967d6fbe540 in $ACTION_DIR:

export JULIA_DEPOT_PATH="$PWD/.validation/depot"
export TMPDIR="$PWD/.validation/tmp"
mkdir -p "$JULIA_DEPOT_PATH" "$TMPDIR"

stdlibs="$(julia +1.10.12 --startup-file=no -e '
    using Pkg
    ns = String[]
    for v in values(Pkg.Types.stdlibs())
        push!(ns, v isa AbstractString ? v : first(v))
    end
    println(join(sort(unique(ns)), ","))
')"
sublibs="ModelingToolkitBase,SciCompDSL"
effective="$stdlibs,$sublibs"

julia +1.10.12 --startup-file=no \
    "$ACTION_DIR/downgrade.jl" \
    "$effective" "lib/ModelingToolkitBase" "alldeps" "1.10" ""

julia +1.10.12 --startup-file=no --project=lib/ModelingToolkitBase \
    -e 'using Pkg; Pkg.build()'
GROUP=QA julia +1.10.12 --startup-file=no --project=lib/ModelingToolkitBase \
    -e 'using Pkg; Pkg.test(; allow_reresolve=false)'

Observed locally:

315 dependencies successfully precompiled in 357 seconds. 120 already precompiled.
6 skipped due to circular dependency.

Stale dependencies: Test Failed
Persistent tasks: Test Failed

Test Summary: | Pass  Fail  Total     Time
Aqua Tests    |   17     2     19  4m44.4s
ERROR: Package ModelingToolkitBase errored during testing

The stale list is exactly the test extras promoted by the action. The source project after the action has:

deps=94 extras=42 weakdeps=10
ModelingToolkitStandardLibrary: dep=true, extra=true

Executable good/bad boundary

I reset the repository to the same e91f13e48fc4f2fdda67e66ad7b2d9c67234ac2b, kept Julia 1.10.12, the isolated depot, effective skip list, alldeps, GROUP=QA, and allow_reresolve=false unchanged, and changed only the action revision to 2c401f8b47edbcafc2e1edbff8e71f33dce71822 (v2.6.2). The downgrade left lib/ModelingToolkitBase/Project.toml byte-for-byte unchanged and the lane passed:

Test Summary: | Pass  Total   Time
JET Tests     |   54     54  27.7s
Test Summary: | Pass  Total     Time
Aqua Tests    |   19     19  5m10.7s
Testing ModelingToolkitBase tests passed

Action commit 30b83cf94e89744fcbd7ea5496be4967d6fbe540 added promote_test_target_registry_deps!, which is the transformation that changes the good project into the failing one.

Fix direction tested locally

This should be fixed in julia-downgrade-compat, not by ignoring Aqua checks in ModelingToolkitBase. As a prototype, I kept all registry-backed test targets in [extras]/[weakdeps], exact-pinned each target's compat entry to the version already selected in the downgrade manifest, updated the manifest project hash, and reran the exact QA command. That avoided the runtime cycle and passed:

Test Summary: | Pass  Total   Time
JET Tests     |   54     54  25.8s
Test Summary: | Pass  Total     Time
Aqua Tests    |   19     19  6m36.4s
Testing ModelingToolkitBase tests passed

The prototype project remained structurally correct:

deps=60 extras=42 weakdeps=13
ModelingToolkitStandardLibrary: dep=false, extra=true, compat==2.28.0

An action PR should add end-to-end coverage that proves the Pkg.test sandbox still runs every promoted test target at the resolved floor on Julia 1.10 and current Julia. The existing action test from v2.7 proves floor retention via runtime promotion; the replacement needs to retain that guarantee without altering the package's runtime dependency graph.

Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions