Issue with using PrecompileTools.jl with a package that depends on ITensors

Hi,

I’m trying to improve precompile times of my package that depends on ITensors. I’m trying to do with PrecompileTools.jl. However, it complains about ITensors. Here’s the error:

ERROR: LoadError: Evaluation into the closed module `ITensors` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `ITensors` with `eval` during precompilation - don't do this.

Is this related to ITensors own precompilation code?

I haven’t seen that particular error message from our end.

The only precompilation issue we’ve had reported was: [NDTensors] [BUG] Precompilation issue with 1.10-beta1 · Issue #1164 · ITensor/ITensors.jl · GitHub which occurred in Julia 1.10, but that should be fixed now in the latest versions of NDTensors and ITensors.

I was using PyCall to access an mpmath function. Seems like that was preventing precompile when using precompile tools. I switched to PythonCall and it seems to work now.