# Testing Julia 1.10.5: Circular dependency detected warning

**URL:** <https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723>\
**Category:** General Usage\
**Tags:** question\
**Created:** [August 28, 2024, 4:30pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723 "2024-08-28T16:30:15Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2024, 4:30pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/1 "2024-08-28T16:30:15Z")

</div>

Just installed Julia 1.10.5, and I am getting new warnings:

```julia
┌ Warning: Circular dependency detected. Precompilation will be skipped for:
│ CSV [336ed68f-0bac-5ca0-87d4-7b16caf5d00b]
│ FilePathsBaseTestExt [36f6b4e4-024d-52bd-a01f-148eb20c09de]
│ FilePathsBaseMmapExt [968c5e7e-8fc3-5f0f-93d2-8a5e0e125e4f]
└ @ Pkg.API ~/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/share/julia/stdlib/v1.10/Pkg/src/API.jl:1279

```

Steps to reproduce:

```julia
mkdir test
cd test
git clone https://github.com/ufechner7/KiteModels.jl.git
cd KiteModels.jl/bin
./create_sys_image --update

```

Any idea?

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [August 28, 2024, 4:38pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/2 "2024-08-28T16:38:56Z")

</div>

Possible related to [Remove as much dependencies as possible by longemen3000 · Pull Request #172 · rofinn/FilePathsBase.jl · GitHub](https://github.com/rofinn/FilePathsBase.jl/pull/172)

From my experience creating package extensions on the standard library packages can easily create many strange issues when not done very carefully, at least in the current version of Julia. See also: [Don't make Test a dependency by ChrisRackauckas · Pull Request #164 · JuliaObjects/Accessors.jl · GitHub](https://github.com/JuliaObjects/Accessors.jl/pull/164)

---

<div class="post-metadata">

**Author:** ![nsajko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nsajko/32/221187_2.png) [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Post date:** [August 28, 2024, 4:45pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/3 "2024-08-28T16:45:58Z")

</div>

Related discussion:

> <https://github.com/JuliaLang/julia/issues/55557>
>
> The attached test package imports many packages, including ModelingToolkit which… currently has a circular dependency among its extensions. In a case with circular deps like this, \`pkg\> precompile\` seems to be much less successful on 1.10.5 (which back-ported circularity detection) vs. 1.10.4
> 
> A locally-built v1.10.5 shows the warning regarding the circularity:
> \`\`\`julia
> (Circularity\_MWE) pkg\> precompile
> ┌ Warning: Circular dependency detected. Precompilation will be skipped for:
> │ ModelingToolkitStandardLibrary \[16a59e39-deab-5bd0-87e4-056b12336739\]
> │ NonlinearSolve \[8913a72c-1f9b-4ce2-8d82-65094dcecaec\]
> ...
> │ BoundaryValueDiffEq \[764a87c0-6b3e-53db-9096-fe964310641d\]
> │ ManifoldsBoundaryValueDiffEqExt \[eb713886-0b96-5c41-a09d-5e8967e02f7d\]
> └ @ Pkg.API ~/repos/julia/usr/share/julia/stdlib/v1.10/Pkg/src/API.jl:1279
> ...
> 342 dependencies successfully precompiled in 294 seconds. 31 skipped due to circular dependency.
> \`\`\`
> 
> The \`using Circularity\_MWE\` message is quite scary and cryptic:
> \`\`\`julia
> ┌ Warning: Module SymbolicsPreallocationToolsExt with build ID ffffffff-ffff-ffff-0000-6f7fcf83bfa3 is missing from the cache.
> │ This may mean SymbolicsPreallocationToolsExt \[d479e226-fb54-5ebe-a75e-a7af7f39127f\] does not support precompilation but is imported by a module that does.
> └ @ Base loading.jl:1948
> ┌ Error: Error during loading of extension SymbolicsPreallocationToolsExt of Symbolics, use \`Base.retry\_load\_extensions()\` to retry.
> │ exception =
> │ 1-element ExceptionStack:
> │ Declaring \_\_precompile\_\_(false) is not allowed in files that are being precompiled.
> │ Stacktrace:
> │ \[1\] \_require(pkg::Base.PkgId, env::Nothing)
> │ @ Base ./loading.jl:1952
> ... (many stack frames skipped)
> \`\`\`
> 
> The real problem though, is it takes about \*\*25 minutes\*\* for the first \`using X\` to complete on my machine:
> \`\`\`julia
> $ time julia --project=Circularity\_MWE -e "using Circularity\_MWE"
> 2076.34s user 31.37s system 139% cpu 24:53.46 total
> \`\`\`
> 
> On v1.10.4, this takes ~10 seconds.
> 
> \*\*MWE:\*\* \[Circularity\_MWE.tar.gz\](https://github.com/user-attachments/files/16698188/Circularity\_MWE.tar.gz)
> 
> Related: #55543

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [August 28, 2024, 4:46pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/4 "2024-08-28T16:46:19Z")

</div>

Yes, it’s the same issue as [Extensions: pre-compilation fails if more than one extension · Issue #52511 · JuliaLang/julia · GitHub](https://github.com/JuliaLang/julia/issues/52511) reported last year – the warning message became less scary, but it’s still present.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2024, 5:25pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/5 "2024-08-28T17:25:50Z")

</div>

And what is the way forward to fix this issue?

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [August 28, 2024, 7:25pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/6 "2024-08-28T19:25:27Z")

</div>

I think reverting [Remove as much dependencies as possible by longemen3000 · Pull Request #172 · rofinn/FilePathsBase.jl · GitHub](https://github.com/rofinn/FilePathsBase.jl/pull/172)  
and adding the changes back more carefully is the way forward.

There is some very fishy stuff going on in [FilePathsBase.jl/ext/FilePathsBaseTestExt.jl at master · rofinn/FilePathsBase.jl · GitHub](https://github.com/rofinn/FilePathsBase.jl/blob/master/ext/FilePathsBaseTestExt.jl) and [FilePathsBase.jl/src/test\_stub.jl at master · rofinn/FilePathsBase.jl · GitHub](https://github.com/rofinn/FilePathsBase.jl/blob/master/src/test_stub.jl)

Generally, any extension needing stubs like this indicates a big issue.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 28, 2024, 7:43pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/7 "2024-08-28T19:43:05Z")

</div>

Do you think there is also a problem with the CSV package, or not so much?

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [August 28, 2024, 8:27pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/8 "2024-08-28T20:27:31Z")

</div>

CSV has implicit imports with a `using FilePathsBase` which should probably be made explicit using tools like [GitHub - ericphanson/ExplicitImports.jl: Developer tooling for Julia namespace management: detecting implicit imports, improper explicit imports, and improper qualified accesses](https://github.com/ericphanson/ExplicitImports.jl) but I don’t think that is directly related to this issue.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [August 29, 2024, 12:56am UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/9 "2024-08-29T00:56:24Z")

</div>

Another issue is in [KiteModels.jl/bin/create\_sys\_image at 48464497de7752b3e3dc55ffd3557019a27f6950 · ufechner7/KiteModels.jl · GitHub](https://github.com/ufechner7/KiteModels.jl/blob/48464497de7752b3e3dc55ffd3557019a27f6950/bin/create_sys_image#L32)

This is adding a package to the global package environment, which you probably want to avoid doing in a build script.

You should try and run julia with:

```sh
JULIA_LOAD_PATH="@:@stdlib" julia --startup-file=no --project

```

In your script to avoid having compatibility issues with the global environment, or packages being used in the startup file.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 29, 2024, 3:19am UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/10 "2024-08-29T03:19:46Z")

</div>

> [@nhz2](#):
>
> which you probably want to avoid

No, this is what I want. I want that the users of my package to have TestEnv in the global environment because it is needed for the examples. If I have it in the project PackageEval will always fail because it is only available for released Julia versions.

I agree that this is just a workaround for the problem that Pkg has no command to activate a sub-environment, and the only sub-environment you can define in Project.toml is the test environment. I assume that when workspaces are supported (Julia 1.12+) this workaround will not be needed any longer.

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [August 29, 2024, 4:37am UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/11 "2024-08-29T04:37:13Z")

</div>

Why is it needed for the examples? Why not have all the examples run in a self-contained environment with all the dependencies they need to work properly?

Also, with your current script I am getting a different error:

```sh
mkdir test
cd test
git clone https://github.com/ufechner7/KiteModels.jl.git
cd KiteModels.jl/bin
./create_sys_image --update

```

```julia
Precompiling project...
  23 dependencies successfully precompiled in 10 seconds. 324 already precompiled.
[ Info: Loading packages ...
[ Info: Creating sysimage ...
[ Info: PackageCompiler: Executing /home/nathan/Downloads/test/KiteModels.jl/test/test_for_precompile.jl => /tmp/jl_packagecompiler_phS3rT/jl_VauxTl
ERROR: LoadError: InitError: PyError (PyImport_ImportModule

The Python package matplotlib could not be imported by pyimport. Usually this means
that you did not install matplotlib in the Python version being used by PyCall.

PyCall is currently configured to use the Python version at:

/usr/bin/python3

and you should use whatever mechanism you usually use (apt-get, pip, conda,
etcetera) to install the Python package containing the matplotlib module.

One alternative is to re-configure PyCall to use a different Python
version on your system: set ENV["PYTHON"] to the path/name of the python
executable you want to use, run Pkg.build("PyCall"), and re-launch Julia.

Another alternative is to configure PyCall to use a Julia-specific Python
distribution via the Conda.jl package (which installs a private Anaconda
Python distribution), which has the advantage that packages can be installed
and kept up-to-date via Julia. As explained in the PyCall documentation,
set ENV["PYTHON"]="", run Pkg.build("PyCall"), and re-launch Julia. Then,
To install the matplotlib module, you can use `pyimport_conda("matplotlib", PKG)`,
where PKG is the Anaconda package that contains the module matplotlib,
or alternatively you can use the Conda package directly (via
`using Conda` followed by `Conda.add` etcetera).

) <class 'ModuleNotFoundError'>
ModuleNotFoundError("No module named 'matplotlib'")

Stacktrace:
  [1] pyimport(name::String)
    @ PyCall ~/.julia/packages/PyCall/1gn3u/src/PyCall.jl:558
  [2] pyimport_conda(modulename::String, condapkg::String, channel::String)
    @ PyCall ~/.julia/packages/PyCall/1gn3u/src/PyCall.jl:716
  [3] pyimport_conda
    @ ~/.julia/packages/PyCall/1gn3u/src/PyCall.jl:715 [inlined]
  [4] __init__ ()
    @ PyPlot ~/.julia/packages/PyPlot/rWSdf/src/init.jl:174
  [5] run_module_init(mod::Module, i::Int64)
    @ Base ./loading.jl:1134
  [6] register_restored_modules(sv::Core.SimpleVector, pkg::Base.PkgId, path::String)
    @ Base ./loading.jl:1122
  [7] _include_from_serialized(pkg::Base.PkgId, path::String, ocachepath::Nothing, depmods::Vector{Any})
    @ Base ./loading.jl:1067
  [8] _tryrequire_from_serialized(modkey::Base.PkgId, path::String, ocachepath::Nothing, sourcepath::String, depmods::Vector{Any})
    @ Base ./loading.jl:1481
  [9] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String, build_id::UInt128)
    @ Base ./loading.jl:1574
 [10] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:1938
 [11] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [12] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [13] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [14] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [15] macro expansion
    @ ./loading.jl:1790 [inlined]
 [16] macro expansion
    @ ./lock.jl:267 [inlined]
 [17] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [18] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [19] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [20] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [21] top-level scope
    @ ~/Downloads/test/KiteModels.jl/test/test_for_precompile.jl:12
during initialization of module PyPlot
in expression starting at /home/nathan/Downloads/test/KiteModels.jl/test/test_for_precompile.jl:1
ERROR: LoadError: failed process: Process(setenv(`/home/nathan/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/bin/julia --color=yes --startup-file=no --pkgimages=no --sysimage=/home/nathan/.julia/juliaup/julia-1.10.5+0.x64.linux.gnu/lib/julia/sys.so --compile=all --trace-compile=/tmp/jl_packagecompiler_phS3rT/jl_VauxTl test/test_for_precompile.jl`,[…]), ProcessExited(1)) [1]

Stacktrace:
  [1] pipeline_error
    @ ./process.jl:565 [inlined]
  [2] run(::Cmd; wait::Bool)
    @ Base ./process.jl:480
  [3] run
    @ ./process.jl:477 [inlined]
  [4] run_precompilation_script(project::String, sysimg::String, precompile_file::String, precompile_dir::String)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/nT5sD/src/PackageCompiler.jl:306
  [5] create_sysimg_object_file(object_file::String, packages::Vector{String}, packages_sysimg::Set{Base.PkgId}; project::String, base_sysimage::String, precompile_execution_file::Vector{String}, precompile_statements_file::Vector{String}, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, extra_precompiles::String, incremental::Bool)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/nT5sD/src/PackageCompiler.jl:344
  [6] create_sysimg_object_file
    @ ~/.julia/packages/PackageCompiler/nT5sD/src/PackageCompiler.jl:311 [inlined]
  [7] create_sysimage(packages::Vector{Symbol}; sysimage_path::String, project::String, precompile_execution_file::String, precompile_statements_file::Vector{String}, incremental::Bool, filter_stdlibs::Bool, cpu_target::String, script::Nothing, sysimage_build_args::Cmd, include_transitive_dependencies::Bool, base_sysimage::Nothing, julia_init_c_file::Nothing, julia_init_h_file::Nothing, version::Nothing, soname::Nothing, compat_level::String, extra_precompiles::String)
    @ PackageCompiler ~/.julia/packages/PackageCompiler/nT5sD/src/PackageCompiler.jl:628
  [8] top-level scope
    @ ~/Downloads/test/KiteModels.jl/test/create_sys_image.jl:14
  [9] include(fname::String)
    @ Base.MainInclude ./client.jl:489
 [10] top-level scope
    @ none:1
in expression starting at /home/nathan/Downloads/test/KiteModels.jl/test/create_sys_image.jl:14

```

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [August 29, 2024, 1:29pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/12 "2024-08-29T13:29:24Z")

</div>

> [@ufechner7](#):
>
> ```julia
> #!/bin/bash -eu
> rm -rf /tmp/testdepot
> mkdir /tmp/testdepot
> rm -rf /tmp/test
> mkdir /tmp/test
> cd /tmp/test
> export JULIA_DEPOT_PATH=/tmp/testdepot 
> git clone https://github.com/ufechner7/KiteModels.jl.git
> cd KiteModels.jl/bin
> ./create_sys_image --update
> 
> ```

I added the detection/ installation of matplotlib and added --startup-file=no

Does it work for you now?

---

<div class="post-metadata">

**Author:** ![nhz2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nhz2/32/44428_2.png) [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Post date:** [August 29, 2024, 3:50pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/13 "2024-08-29T15:50:05Z")

</div>

Yes, that works for me now, and I am getting the same Circular dependency warning you got.

---

<div class="post-metadata">

**Author:** ![filchristou](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/filchristou/32/26760_2.png) [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Post date:** [August 29, 2024, 5:40pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/14 "2024-08-29T17:40:15Z")

</div>

Can I somehow ask why a dependency is circular? Something like `Pkg.why` that explains how the circle appears. This would help on eliminating them.

---

<div class="post-metadata">

**Author:** ![giordano](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/giordano/32/2166_2.png) [@giordano](https://discourse.julialang.org/u/giordano)\
**Post date:** [August 29, 2024, 7:23pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/15 "2024-08-29T19:23:50Z")

</div>

Not for extensions you can use [GitHub - KristofferC/EnvironmentGraph.jl](https://github.com/KristofferC/EnvironmentGraph.jl)

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 1, 2024, 2:21pm UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/16 "2024-09-01T14:21:46Z")

</div>

Created a bug report: [Circular dependency warning · Issue #179 · rofinn/FilePathsBase.jl · GitHub](https://github.com/rofinn/FilePathsBase.jl/issues/179)

This issue is really annoying because I get these warnings each time I run one of my examples.

---

<div class="post-metadata">

**Author:** ![ufechner7](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ufechner7/32/51363_2.png) [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Post date:** [September 3, 2024, 8:59am UTC](https://discourse.julialang.org/t/testing-julia-1-10-5-circular-dependency-detected-warning/118723/17 "2024-09-03T08:59:48Z")

</div>

This issue was connected to the fact that I precompiled the system image with the parameter “include\_transitive\_dependencies=false”. Changing that to “include\_transitive\_dependencies=true” made the warning go away.
