Skip to content

fix(hr): harden the collectible analyzer loader (review follow-up of #23863) (backport #23947) - #23971

Merged
kazo0 merged 3 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-23947
Aug 11, 2026
Merged

kazo0 merged 3 commits into
release/stable/6.7from
mergify/bp/release/stable/6.7/pr-23947

Conversation

@mergify

@mergify mergify Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #23863 — the review-round-4 changes: the PR auto-merged the moment its last review conversations were resolved, before these fixes were pushed, so the "Done" replies on those threads describe the changes delivered here.

Changes (all on CollectibleAnalyzerAssemblyLoader)

Validation

  • Uno.HotReload.Tests: 120/120 passing, including two new regression tests — When_CompilerContextResolvesLazily_Then_AnalyzerRequestsUnifyToIt (lazily-resolving compiler context + same-directory copy of the assembly: the request must materialize in the compiler context; fails on the previous enumeration-based code) and When_MultipleVersionsRegistered_Then_RequestedVersionWins (two registered versions: the exact requested one must win over the first registered).
  • Uno.HotReload compiles warning-free on both flavors: net9.0 (Roslyn 4.14) and net10.0 (Roslyn 5.6).

This is an automatic backport of pull request #23947 done by [Mergify](https://mergify.com).

dr1rrb added 3 commits August 5, 2026 13:55
…follow-up)

Delegate resolution to the compiler context (LoadFromAssemblyName, like
Roslyn's own loader) so host dependencies it has not loaded yet unify to it
instead of loading a split-identity analyzer-local copy; publish shadow
copies via a staging file + atomic rename so concurrent loads (threads or
dev-server processes sharing the temp root) never observe a partial PE;
retain every dependency location registered per file name and resolve to
the best version (exact match, else highest compatible) instead of
first-registered-wins; Path.Join throughout.

(cherry picked from commit ceae5b4)
GetBestKnownPath now takes the already-validated simpleName (self-contained
lookup and identity comparison instead of relying on a guard in its caller),
and the highest-compatible-version fallback gets dedicated coverage — in a
fresh context, since a context that already loaded the simple name answers
later requests from its own by-name cache without calling Load() again.

(cherry picked from commit 781487c)
The shadow cache root moves from the shared temp directory to per-user
LocalApplicationData (user-only mode on Unix): this closes the shared-root
pre-plant/swap surface and retires, by namespace, anything a pre-atomic-
publish version of the cache may have left truncated at still-reachable
keys. The key now folds in the file size, staging files are never leaked
(cleanup on every failure path plus an age-gated startup sweep), the
identity check applies to every registered candidate (single-candidate
fast path removed), an optional IReporter traces candidate selection and
compiler-context fallbacks, and simple names carrying invalid file-name
characters are rejected before any probing.

(cherry picked from commit f011378)
@kazo0

kazo0 commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@unodevops

Copy link
Copy Markdown
Contributor

@kazo0
kazo0 merged commit d266b81 into release/stable/6.7 Aug 11, 2026
64 of 65 checks passed
@kazo0
kazo0 deleted the mergify/bp/release/stable/6.7/pr-23947 branch August 11, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants