jump-dev / HiGHS.jl

A Julia interface to the HiGHS solver
https://highs.dev
MIT License
108 stars 15 forks source link

v1.7 fails to precompile due to ObjectiveLimit not defined #186

Closed hdunham closed 11 months ago

hdunham commented 11 months ago

Hi, I'm a developer of the National Renewable Energy Lab's REopt tool. Updating from HiGHS 1.6 to 1.7 recently broke tests in REopt#erp-leak because HiGHS now fails to precompile due to the following error:

ERROR: LoadError: UndefVarError: ObjectiveLimit not defined
Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base ./Base.jl:31
 [2] top-level scope
   @ ~/.julia/packages/HiGHS/rDeTZ/src/MOI_wrapper.jl:654
 [3] include(mod::Module, _path::String)
   @ Base ./Base.jl:419
 [4] include(x::String)
   @ HiGHS ~/.julia/packages/HiGHS/rDeTZ/src/HiGHS.jl:6
 [5] top-level scope
   @ ~/.julia/packages/HiGHS/rDeTZ/src/HiGHS.jl:18
 [6] include
   @ ./Base.jl:419 [inlined]
 [7] 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, UInt64}}, source::String)
   @ Base ./loading.jl:1554
 [8] top-level scope
   @ stdin:1
in expression starting at /home/runner/.julia/packages/HiGHS/rDeTZ/src/MOI_wrapper.jl:654
in expression starting at /home/runner/.julia/packages/HiGHS/rDeTZ/src/HiGHS.jl:6
in expression starting at stdin:1
odow commented 11 months ago

What version of HiGHS.jl is installed? This was fixed in https://github.com/jump-dev/HiGHS.jl/pull/180. You need HiGHS.jl v1.7.3 or v1.7.4.

I talked to @Bill-Becker about this last week. Repot should be using compat bounds https://github.com/NREL/REopt.jl/pull/292

Bill-Becker commented 11 months ago

The solution I ended up going with was to update the package dependencies, in particular MathOptInterface, instead of using the compat bound and removing the Manifest.toml. I believe the main issue with the latter is that we have a conditional dependency of an unregistered package (GhpGhx.jl) that gets loaded with the Require.jl package, and GitHub workflows was erroring when trying to load or compile the project without the specified GhpGhx.jl GitHub URL in the Manifest.toml. I'm sure there is a better way, but I didn't have time to look into that. @hdunham you could merge the develop branch into your branch and it should resolve this issue with the dependency updates. @odow we will work toward your "better practice" solution if we can find the right workaround for the GhpGhx.jl package issue. Thanks!

odow commented 11 months ago

is that we have a conditional dependency of an unregistered package (GhpGhx.jl)

Ahhhh. This is why you needed the Manifest. Yes, you're correct, there is no easy work-around at present.

odow commented 11 months ago

To summarize: this was a bug in HiGHS.jl and it is my fault. But it was fixed in HiGHS v1.7.3, and is only visible if you use HiGHS v1.7.0, v1.7.1, or v1.7.2 and an older version of MathOptInterface.

If you update to a newer version of HiGHS.jl, and/or you update to a newer version of MathOptInterface, the problem is fixed.

REopt is pinning versions using a Manifest.toml, which prevented it from using the latest versions with the bug fix.

odow commented 11 months ago

I've opened a PR to fix this in the general registry: https://github.com/JuliaRegistries/General/pull/93910

hdunham commented 11 months ago

Ah thank you! I thought it was failing with the latest HiGHS that included #180 but indeed it was 1.7.2. Merging develop into my branch didn't do the trick, but the general registry update did.

odow commented 11 months ago

Closing because this is also now fixed in the registry, so it shouldn't be possible install the mis-matched versions any more.