ClapeyronThermo / Clapeyron.jl

Clapeyron provides a framework for the development and use of fluid-thermodynamic models, including SAFT, cubic, activity, multi-parameter, and COSMO-SAC.
https://clapeyronthermo.github.io/Clapeyron.jl/
MIT License
210 stars 52 forks source link

Installation problems with precompilation (`Setfield` not defined) #257

Closed ianhbell closed 9 months ago

ianhbell commented 9 months ago

Been running into a lot of issues with changing version of Clapeyron, and I think it is related to some sort of precompilation cache. Version 0.5.10 has problems with CPA parameters (#256 ) so I tried to downgrade one patch release with:

(@v1.9) pkg> add Clapeyron@0.5.9,

but then I get a big precompilation backtrace that looks something like this:

julia> using Clapeyron
[ Info: Precompiling Clapeyron [7c7805af-46cc-48c9-995b-ed0ed2dc909a]
ERROR: LoadError: UndefVarError: `Setfield` not defined
Stacktrace:
 [1] include(mod::Module, _path::String)
   @ Base ./Base.jl:457
 [2] include(x::String)
   @ Clapeyron ~/.julia/packages/Clapeyron/i9Ruc/src/Clapeyron.jl:1
 [3] top-level scope
   @ ~/.julia/packages/Clapeyron/i9Ruc/src/Clapeyron.jl:124
 [4] include
   @ ./Base.jl:457 [inlined]
 [5] include_package_for_output(pkg::Base.PkgId, input::String, depot_path::Vector{String}, dl_load_path::Vector{String}, load_path::Vector{String}, concrete_deps::Vector{Pair{Base.PkgId, UInt128}}, source::Nothing)
   @ Base ./loading.jl:2049
 [6] top-level scope
   @ stdin:3
in expression starting at /Users/ihb/.julia/packages/Clapeyron/i9Ruc/src/models/EmpiricHelmholtz/SingleFluid/SingleFluid.jl:179
in expression starting at /Users/ihb/.julia/packages/Clapeyron/i9Ruc/src/models/EmpiricHelmholtz/SingleFluid/SingleFluid.jl:178
in expression starting at /Users/ihb/.julia/packages/Clapeyron/i9Ruc/src/Clapeyron.jl:1
in expression starting at stdin:3
ERROR: Failed to precompile Clapeyron [7c7805af-46cc-48c9-995b-ed0ed2dc909a] to "/Users/ihb/.julia/compiled/v1.9/Clapeyron/jl_GvzrL6".
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)
   @ Base ./loading.jl:2300
 [3] compilecache
   @ ./loading.jl:2167 [inlined]
 [4] _require(pkg::Base.PkgId, env::String)
   @ Base ./loading.jl:1805
 [5] _require_prelocked(uuidkey::Base.PkgId, env::String)
   @ Base ./loading.jl:1660
 [6] macro expansion
   @ ./loading.jl:1648 [inlined]
 [7] macro expansion
   @ ./lock.jl:267 [inlined]
 [8] require(into::Module, mod::Symbol)
   @ Base ./loading.jl:1611

and I keep getting the same problem until I downgrade to 0.4.0 where the problem seems to go away. I have tried to remove the .julia folder and try again and that didn't fix the precompilation problem.

longemen3000 commented 9 months ago

this is because i used to depend on Setfield (coming from another package). try downgrading Roots to 2.0.22 i will see what i can do on my part

ianhbell commented 9 months ago

How do I force that since the add follows the dependency tree of Clapeyron?

longemen3000 commented 9 months ago

if you do:

(@v1.10) pkg> add Roots@2.0.22
(@v1.10) pkg> pin Roots

in the same enviroment that has the Clapeyron instalation, that seems to work.

ianhbell commented 9 months ago

Thanks, that works perfectly