Skip to content

Commit f75ed76

Browse files
fix: make it a preference, not a fix
1 parent fa08cde commit f75ed76

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/Resolve/maxsum.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
# This file is a part of Julia. License is MIT: https://julialang.org/license
22

33
const DEFAULT_MAX_TIME = "300"
4-
const PREFERRED_VERSION_WEIGHT_BONUS = VersionWeight(typemax(Int32))
4+
# Prefer loaded versions, but not so strongly that it overrides compatibility constraints.
5+
# This bonus is added to the version weight of already-loaded packages, making them more
6+
# favorable than other versions but not creating hard requirements.
7+
const PREFERRED_VERSION_WEIGHT_BONUS = VersionWeight(100, 0, 0)
58

69
# Some parameters to drive the decimation process
710
mutable struct MaxSumParams

test/registry.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,13 @@ end
431431
# Tests that [email protected] does not get installed
432432
temp_pkg_dir() do env
433433
Pkg.Registry.add(url = "https://github.com/JuliaRegistries/Test")
434-
Pkg.add("Example"; prefer_loaded_versions = false)
434+
Pkg.add("Example")
435435
@test manifest_info(EnvCache().manifest, uuid).version == v"0.5.0"
436436
Pkg.update() # should not update Example
437437
@test manifest_info(EnvCache().manifest, uuid).version == v"0.5.0"
438438
@test_throws Pkg.Resolve.ResolverError Pkg.add(PackageSpec(name = "Example", version = v"0.5.1"))
439439
Pkg.rm("Example")
440-
Pkg.add("JSON"; prefer_loaded_versions = false) # depends on Example
440+
Pkg.add("JSON") # depends on Example
441441
@test manifest_info(EnvCache().manifest, uuid).version == v"0.5.0"
442442
Pkg.update()
443443
@test manifest_info(EnvCache().manifest, uuid).version == v"0.5.0"

0 commit comments

Comments
 (0)