Errors when upgrading from Julia 1.11.6 to Julia 1.12

After upgrading (via juliaup) to the newest version of Julia, I keep getting these errors/warnings:

đź”§ Setting up BraveNewAlgorithm.jl dependencies...
Activating project environment...
  Activating project at `~/Code/julia/BraveNewAlgorithm.jl`
Installing dependencies (this may take a few minutes)...
┌ Warning: The active manifest file has dependencies that were resolved with a different julia version (1.11.6). Unexpected behavior may occur.
â”” @ ~/Code/julia/BraveNewAlgorithm.jl/Manifest.toml:0
┌ Warning: The project dependencies or compat requirements have changed since the manifest was last resolved.
│ It is recommended to `Pkg.resolve()` or consider `Pkg.update()` if necessary.
â”” @ Pkg.API ~/.julia/juliaup/julia-1.12.0+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/API.jl:1211
  âś— MbedTLS
  âś— HTTP
  ? BraveNewAlgorithm
Precompiling packages finished.
  0 dependencies successfully precompiled in 3 seconds. 370 already precompiled.
  1 dependencies failed but may be precompilable after restarting julia
  1 dependency had output during precompilation:
┌ BraveNewAlgorithm

This causes it attempting precompilation over and over again, delaying runs. Is there any way to precompile to avoid this? Is there any specific thing I should do on a project after upgrading the Julia version?

Remove the Manifest file, or simply do Pkg.update().

Thanks for answer. I’ve tried that, and now I get different errors:

  Activating project at `~/Code/julia/BraveNewAlgorithm.jl`
Info Given BlackBoxOptimizationBenchmarking was explicitly requested, output will be shown live 
WARNING: Method definition (::Type{OptimizationBase.OptimizerMissingError})(Any) in module OptimizationBase at /home/jmerelo/.julia/packages/OptimizationBase/pyIG4/src/solve.jl:23 overwritten at /home/jmerelo/.julia/packages/OptimizationBase/pyIG4/src/solve.jl:177.
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.
  ? OptimizationBase
  ? Optimization
  ? BlackBoxOptimizationBenchmarking
WARNING: Method definition (::Type{OptimizationBase.OptimizerMissingError})(Any) in module OptimizationBase at /home/jmerelo/.julia/packages/OptimizationBase/pyIG4/src/solve.jl:23 overwritten at /home/jmerelo/.julia/packages/OptimizationBase/pyIG4/src/solve.jl:177.
ERROR: Method overwriting is not permitted during Module precompilation. Use `__precompile__(false)` to opt-out of precompilation.

This happens every time I try to precompile or run any script.

That’s a bug in OptimizationBase: OptimizationBase (v2) fails to precompile · Issue #1056 · SciML/Optimization.jl · GitHub

But it seems that it was already fixed, I just tried to pre-compile and it worked.

The issue is still open, right?
I saw they created a new release yesterday, but it doesn’t look like it includes it (or, TBH, I can figure out how to make Julia use that specific one)

]add Optimization@5 will install the latest one. If that doesn’t work you probably have a lower compatibility bound in your Project.toml

1 Like

it installs it correctly, but I’m still getting the same errors with Optimization and OptimizationBase. Should the “add” command change Project.toml or Manifest.tom? Do I have to do anything else to save it?

add will only change Project.toml if the project has been activated. Can you post your Project.toml here?

1 Like
name = "BraveNewAlgorithm"
uuid = "62e8e4ba-3e3d-40af-bbe6-192e07c2d347"
authors = ["ceciliamm <cecilia@badgermapping.com>"]
version = "0.1.2"

[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
BlackBoxOptimizationBenchmarking = "4552ee2b-11da-5aef-8e78-0d48532001f1"
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Cairo = "159f3aea-2a34-519c-b102-8c37f9878175"
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Distances = "b4f34e82-e78d-54a5-968a-f98e89d6e8f7"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Fontconfig = "186bb1d3-e1f7-5a2c-a377-96d770f13627"
Gadfly = "c91e804a-d5a3-530f-b6f0-dfbca275c004"
InformationMeasures = "96684042-fbdc-5399-9b8e-d34e539a126c"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Shuffle = "bf21e494-c40e-4daa-abfb-de5ec0aad010"
StatsBase = "2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91"
StatsPlots = "f3b207a7-027a-5e70-b257-86293d7955fd"

[compat]
BenchmarkTools = "^1.6.0"
julia = "1.4, 2"

Optimization is not a direct dependency

That’s the problem then, one of your dependencies must have a low compat bound for Optimization, and you should open an issue in their package to get it higher.

EDIT: Ah yes, your error message already says it, it’s BlackBoxOptimizationBenchmarking, they have fixed the compat bound to be 4, that’s the problem.