From 2eb8ae5b8f421fc77295f9cf382132d39e14d16f Mon Sep 17 00:00:00 2001
From: Ian Butterworth <i.r.butterworth@gmail.com>
Date: Fri, 10 Jan 2025 13:47:20 -0500
Subject: [PATCH] [release-1.11] 1.11 backports (#4133)

---
 src/Operations.jl | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/Operations.jl b/src/Operations.jl
index e52fd43f6e..c2ac100e5b 100644
--- a/src/Operations.jl
+++ b/src/Operations.jl
@@ -436,6 +436,13 @@ function resolve_versions!(env::EnvCache, registries::Vector{Registry.RegistryIn
         old_v = get(jll_fix, uuid, nothing)
         # We only fixup a JLL if the old major/minor/patch matches the new major/minor/patch
         if old_v !== nothing && Base.thispatch(old_v) == Base.thispatch(vers_fix[uuid])
+            new_v = vers_fix[uuid]
+            if old_v != new_v
+                compat_map[uuid][old_v] = compat_map[uuid][new_v]
+                # Note that we don't delete!(compat_map[uuid], old_v) because we want to keep the compat info around
+                # in case there's JLL version confusion between the sysimage pkgorigins version and manifest
+                # but that issue hasn't been fully specified, so keep it to be cautious
+            end
             vers_fix[uuid] = old_v
         end
     end