Skip to content

Conversation

fgittins
Copy link
Contributor

@fgittins fgittins commented Apr 5, 2025

Checklist

  • Appropriate tests were added
  • Any code changes were done in a way that does not break public API
  • All documentation related to code changes were updated
  • The new code follows the
    contributor guidelines, in particular the SciML Style Guide and
    COLPRAC.
  • Any new documentation only uses public API

Additional context

When testing SCCNonlinearSolve, I get the error

LoadError: ArgumentError: Package NonlinearSolveBase not found in current path.

I get this error while with Julia v1.11.4.

This pull request simply adds NonlinearSolveBase to the dependencies and resolves the error.

Testing logs

Before the change:

Testing Running tests...
┌ Info: Julia Version 1.11.4
│ Commit 8561cc3d68d (2025-03-10 11:36 UTC)
│ Build Info:
│   Official https://julialang.org/ release
│ Platform Info:
│   OS: macOS (arm64-apple-darwin24.0.0)
│   CPU: 8 × Apple M3
│   WORD_SIZE: 64
│   LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
│ Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
│ Environment:
└   JULIA_LOAD_PATH = @:/var/folders/_q/wph6zqg90hv7pbq2t9m89pwm0000gn/T/jl_tCF601
[ Info: Running tests for group: all with 4 workers
┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
│   caller = ip:0x0
└ @ Core :-1
[ Info: Scanning for test items in project `SCCNonlinearSolve` at paths: /Users/Gitti001/NonlinearSolve.jl/lib/SCCNonlinearSolve
[ Info: Finished scanning for test items in 0.85 seconds. Scheduling 3 tests on pid 44914 with 4 worker processes and 2 threads per worker.
[ Info: Starting test workers
  Worker 44925:  [ Info: Starting test worker 2 on pid = 44925, with 2 threads
  Worker 44927:  [ Info: Starting test worker 4 on pid = 44927, with 2 threads[ Info: Starting running test items

  Worker 44926:  [ Info: Starting test worker 3 on pid = 44926, with 2 threads
  Worker 44924:  [ Info: Starting test worker 1 on pid = 44924, with 2 threads
  Worker 44926:  17:39:07 | maxrss  2.3% | mem 87.5% | START (3/3) test item "Explicit Imports" at test/qa_tests.jl:17
  Worker 44925:  17:39:07 | maxrss  2.3% | mem 87.5% | START (2/3) test item "Aqua" at test/qa_tests.jl:1
  Worker 44924:  17:39:07 | maxrss  2.3% | mem 86.8% | START (1/3) test item "Manual SCC" at test/core_tests.jl:7
  Worker 44926:  ┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
  Worker 44926:  │   caller = ip:0x0
  Worker 44926:  └ @ Core :-1
  Worker 44925:  ┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
  Worker 44925:  │   caller = ip:0x0
  Worker 44925:  └ @ Core :-1
  Worker 44924:  ┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
  Worker 44924:  │   caller = ip:0x0
  Worker 44924:  └ @ Core :-1
  Worker 44924:  17:39:08 | maxrss  2.7% | mem 87.8% | DONE  (1/3) test item "Manual SCC" 0.6 secs

No Captured Logs for test item "Manual SCC" at test/core_tests.jl:7 on worker 44924
Error in testset "Manual SCC" on worker 44924:
Error During Test at /Users/Gitti001/NonlinearSolve.jl/lib/SCCNonlinearSolve/test/core_tests.jl:7
  Got exception outside of a @test
  LoadError: ArgumentError: Package NonlinearSolveBase not found in current path.
  - Run `import Pkg; Pkg.add("NonlinearSolveBase")` to install the NonlinearSolveBase package.
  Stacktrace:
    [1] macro expansion
      @ ./loading.jl:2296 [inlined]
    [2] macro expansion
      @ ./lock.jl:273 [inlined]
    [3] __require(into::Module, mod::Symbol)
      @ Base ./loading.jl:2271
    [4] #invoke_in_world#3
      @ ./essentials.jl:1089 [inlined]
    [5] invoke_in_world
      @ ./essentials.jl:1086 [inlined]
    [6] require(into::Module, mod::Symbol)
      @ Base ./loading.jl:2260
    [7] include(mod::Module, _path::String)
      @ Base ./Base.jl:557
    [8] include(x::String)
      @ Main.var"##CoreRootfindTesting#230" ~/NonlinearSolve.jl/lib/SCCNonlinearSolve/test/core_tests.jl:1
    [9] top-level scope
      @ ~/NonlinearSolve.jl/lib/SCCNonlinearSolve/test/core_tests.jl:3
   [10] eval
      @ ./boot.jl:430 [inlined]
   [11] #85
      @ ~/.julia/packages/ReTestItems/ecp6j/src/ReTestItems.jl:923 [inlined]
   [12] with_source_path(f::ReTestItems.var"#85#88"{Expr}, path::String)
      @ ReTestItems ~/.julia/packages/ReTestItems/ecp6j/src/ReTestItems.jl:885
   [13] #84
      @ ~/.julia/packages/ReTestItems/ecp6j/src/ReTestItems.jl:923 [inlined]
   [14] redirect_stdio(f::ReTestItems.var"#84#87"{Expr, TestSetup}; stdin::Nothing, stderr::IOContext{IOStream}, stdout::IOContext{IOStream})
      @ Base ./stream.jl:1448
   [15] redirect_stdio
      @ ./stream.jl:1411 [inlined]
   [16] _redirect_logs(f::ReTestItems.var"#84#87"{Expr, TestSetup}, target::IOStream)
      @ ReTestItems ~/.julia/packages/ReTestItems/ecp6j/src/log_capture.jl:124
   [17] macro expansion
      @ ~/.julia/packages/ReTestItems/ecp6j/src/ReTestItems.jl:922 [inlined]
   [18] macro expansion
      @ ./lock.jl:273 [inlined]
   [19] ensure_setup!(ctx::ReTestItems.TestContext, setup::Symbol, setups::Vector{TestSetup}, logs::Symbol)
      @ ReTestItems ~/.julia/packages/ReTestItems/ecp6j/src/ReTestItems.jl:897
   [20] runtestitem(ti::TestItem, ctx::ReTestItems.TestContext; test_end_expr::Expr, logs::Symbol, verbose_results::Bool, finish_test::Bool, catch_test_error::Bool, failfast::Bool)
      @ ReTestItems ~/.julia/packages/ReTestItems/ecp6j/src/ReTestItems.jl:1033
   [21] top-level scope
      @ none:1
   [22] eval
      @ ./boot.jl:430 [inlined]
   [23] execute
      @ ~/.julia/packages/ReTestItems/ecp6j/src/workers.jl:332 [inlined]
   [24] (::ReTestItems.Workers.var"#22#23"{Sockets.TCPSocket, ReentrantLock, ReTestItems.Workers.Request})()
      @ ReTestItems.Workers ~/.julia/packages/ReTestItems/ecp6j/src/workers.jl:346
  in expression starting at /Users/Gitti001/NonlinearSolve.jl/common/common_rootfind_testing.jl:1

  Worker 44924:  [44924] signal 15: Terminated: 15
in expression starting at none:1

  Worker 44926:  17:39:08 | maxrss  2.9% | mem 86.1% | DONE  (3/3) test item "Explicit Imports" 1.0 secs (65.3% compile, 3.4% recompile, 2.4% GC), 1.60 M allocs (95.125 MB)
  Worker 44926:  [44926] signal 15: Terminated: 15
in expression starting at none:1

  Worker 44925:  17:39:15 | maxrss  4.8% | mem 85.8% | DONE  (2/3) test item "Aqua" 7.5 secs (42.6% compile, 3.3% GC), 15.26 M allocs (1.051 GB)
  Worker 44925:  [44925] signal 15: Terminated: 15
in expression starting at none:1

Test Summary:          | Pass  Error  Total   Time
SCCNonlinearSolve      |   14      1     15  12.5s
  test                 |   14      1     15       
    test/core_tests.jl |           1      1       
      Manual SCC       |           1      1   0.6s
    test/qa_tests.jl   |   14            14       
ERROR: LoadError: Some tests did not pass: 14 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /Users/Gitti001/NonlinearSolve.jl/lib/SCCNonlinearSolve/test/runtests.jl:21
ERROR: Package SCCNonlinearSolve errored during testing

After the change:

Testing Running tests...
┌ Info: Julia Version 1.11.4
│ Commit 8561cc3d68d (2025-03-10 11:36 UTC)
│ Build Info:
│   Official https://julialang.org/ release
│ Platform Info:
│   OS: macOS (arm64-apple-darwin24.0.0)
│   CPU: 8 × Apple M3
│   WORD_SIZE: 64
│   LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
│ Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
│ Environment:
└   JULIA_LOAD_PATH = @:/var/folders/_q/wph6zqg90hv7pbq2t9m89pwm0000gn/T/jl_IF0oQP
[ Info: Running tests for group: all with 4 workers
┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
│   caller = ip:0x0
└ @ Core :-1
[ Info: Scanning for test items in project `SCCNonlinearSolve` at paths: /Users/Gitti001/NonlinearSolve.jl/lib/SCCNonlinearSolve
[ Info: Finished scanning for test items in 0.85 seconds. Scheduling 3 tests on pid 45179 with 4 worker processes and 2 threads per worker.
[ Info: Starting test workers
  Worker 45183:  [ Info: Starting test worker 1 on pid = 45183, with 2 threads
  Worker 45186:  [ Info: Starting test worker 4 on pid = 45186, with 2 threads
[ Info: Starting running test items
  Worker 45185:  [ Info: Starting test worker 3 on pid = 45185, with 2 threads
  Worker 45184:  [ Info: Starting test worker 2 on pid = 45184, with 2 threads
  Worker 45185:  17:46:32 | maxrss  2.4% | mem 87.1% | START (3/3) test item "Explicit Imports" at test/qa_tests.jl:17
  Worker 45184:  17:46:32 | maxrss  2.4% | mem 87.1% | START (2/3) test item "Aqua" at test/qa_tests.jl:1
  Worker 45183:  17:46:32 | maxrss  2.3% | mem 87.2% | START (1/3) test item "Manual SCC" at test/core_tests.jl:7
  Worker 45185:  ┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
  Worker 45185:  │   caller = ip:0x0
  Worker 45185:  └ @ Core :-1
  Worker 45184:  ┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
  Worker 45184:  │   caller = ip:0x0
  Worker 45184:  └ @ Core :-1
  Worker 45183:  ┌ Warning: Verbosity logging macros are deprecated as they are not compatible with juliac-compiled programs
  Worker 45183:  │   caller = ip:0x0
  Worker 45183:  └ @ Core :-1
  Worker 45185:  17:46:33 | maxrss  2.9% | mem 88.8% | DONE  (3/3) test item "Explicit Imports" 1.0 secs (65.9% compile, 3.6% recompile, 2.4% GC), 1.60 M allocs (95.126 MB)
  Worker 45185:  [45185] signal 15: Terminated: 15
in expression starting at none:1

  Worker 45183:  17:46:37 | maxrss  4.0% | mem 91.0% | DONE  (1/3) test item "Manual SCC" 4.5 secs (81.5% compile, 3.9% GC), 18.88 M allocs (1.026 GB)
  Worker 45183:  [45183] signal 15: Terminated: 15
in expression starting at none:1

  Worker 45184:  17:46:40 | maxrss  4.6% | mem 86.4% | DONE  (2/3) test item "Aqua" 8.2 secs (41.2% compile, 3.1% GC), 15.26 M allocs (1.051 GB)
  Worker 45184:  [45184] signal 15: Terminated: 15
in expression starting at none:1

Test Summary:     | Pass  Total   Time
SCCNonlinearSolve |   15     15  13.2s
     Testing SCCNonlinearSolve tests passed

@ErikQQY
Copy link
Member

ErikQQY commented Apr 5, 2025

This seems unnecessary, we don't need to explicitly use NonlinearSolveBase when testing SCCNonlinearSolve, but I am curious why the error occurred since the tests in the master branch are just fine.

@fgittins
Copy link
Contributor Author

fgittins commented Apr 5, 2025

In SCCNonlinearSolve/test/core_tests.jl, there is the line

include("../../../common/common_nlls_testing.jl")

This is the same line in the error message above

Error During Test at /Users/Gitti001/NonlinearSolve.jl/lib/SCCNonlinearSolve/test/core_tests.jl:7

This is speculation, but it seems plausible to me that the dependency may be inherited from the overall NonlinearSolve.jl package, where the common/ directory sits.

@fgittins
Copy link
Contributor Author

fgittins commented Apr 5, 2025

The other sub-libraries that include the common/ directory in their tests (NonlinearSolveFirstOrder, NonlinearSolveQuasiNewton and NonlinearSolveSpectralMethods) all have NonlinearSolveBase as an explicit dependency.

@ErikQQY
Copy link
Member

ErikQQY commented Apr 5, 2025

The other sub-libraries that include the common/ directory in their tests (NonlinearSolveFirstOrder, NonlinearSolveQuasiNewton and NonlinearSolveSpectralMethods) all have NonlinearSolveBase as an explicit dependency.

Because other subpackages are actually using utilities from NonlinearSolveBase. SCCNonlinearSolve is usually used together with one of the sub-libraries you mentioned in order to use the algorithms from them(they indeed reexport NonlinearSolveBase, that's why using NonlinearSolveBase in common/ working fine), but SCCNonlinearSolve doesn't need the NonlinearSolveBase as dependency or test dependency.

@fgittins
Copy link
Contributor Author

fgittins commented Apr 5, 2025

Are you able to re-create the error? I tested it also on Julia v1.10.9.

@ErikQQY
Copy link
Member

ErikQQY commented Apr 5, 2025

I can't reproduce the error. Ah, I know what's going on here, see

import Pkg
Pkg.Registry.update()
# Install packages present in subdirectories
dev_pks = Pkg.PackageSpec[]
for path in ("lib/SciMLJacobianOperators", "lib/NonlinearSolveBase")

When we run the test cases in CI or locally, we should always use the local directories of NonlinearSolveBase etc. so that we can make sure we are testing real changes.

@fgittins
Copy link
Contributor Author

fgittins commented Apr 5, 2025

The tests I have run have been

  1. Locally in the SCCNonlinearSolve directory
  2. In a separate environment with SCCNonlinearSolve installed and running Pkg.test("SCCNonlinearSolve")

Is there something I should be doing differently?

@fgittins
Copy link
Contributor Author

fgittins commented Apr 5, 2025

I followed the steps above and it does indeed proceed without errors. However, the error does appear if I test the package directly. Is this not an issue?

@ErikQQY
Copy link
Member

ErikQQY commented Apr 5, 2025

I followed the steps above and it does indeed proceed without errors. However, the error does appear if I test the package directly. Is this not an issue?

Nah, that is intended so that CI can pick the latest modified subpackages.

@ChrisRackauckas
Copy link
Member

This is fine. It probably will be made a hard dep at some point when we get to the reusage stuff anyways.

@fgittins
Copy link
Contributor Author

fgittins commented Apr 6, 2025

Are any of these errors my fault? When I tested it locally it was fine.

@ChrisRackauckas
Copy link
Member

no I'm fixing CI in another thread.

@ChrisRackauckas ChrisRackauckas merged commit 07e4d16 into SciML:master Apr 6, 2025
13 of 16 checks passed
@fgittins fgittins deleted the tests branch April 6, 2025 17:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants