Skip to content

Fix Windows PowerShell private dependency loading - #617

Merged
PrzemyslawKlys merged 1 commit into
mainfrom
codex/desktop-module-resolver
Jul 23, 2026
Merged

Fix Windows PowerShell private dependency loading#617
PrzemyslawKlys merged 1 commit into
mainfrom
codex/desktop-module-resolver

Conversation

@PrzemyslawKlys

Copy link
Copy Markdown
Member

Summary

  • preload Desktop dependencies in metadata-derived dependency order before importing exported binary modules
  • scope Windows PowerShell AssemblyResolve handling to the module's private Lib tree, with a bounded bootstrap window for CLR requests that omit the requesting assembly
  • unregister the resolver on module removal and on terminal import failures
  • keep PowerShell Core on the existing isolated AssemblyLoadContext path

Why this matters

Windows PowerShell 5.1 can request a compatible private dependency without identifying the requesting assembly while a netstandard dependency graph is loading. A global resolver is unsafe, while refusing every ownerless request prevents otherwise valid packaged modules from importing. This change supports only the short preload/import phase, validates canonical candidate paths, and then returns to requester-owned resolution.

Validation

  • ModuleBootstrapperGeneratorTests: 23/23 on net10.0
  • PowerForge, PowerForge.PowerShell, and PSPublishModule: Release/net472 builds with zero warnings and errors
  • PSPublishModule self-build imported from the installed artifact in PowerShell 7 and Windows PowerShell 5.1
  • the resulting installed builder packaged ComputerX and TestimoX; both packages imported in PowerShell 7 and Windows PowerShell 5.1

@PrzemyslawKlys
PrzemyslawKlys merged commit ae3869f into main Jul 23, 2026
6 checks passed
@PrzemyslawKlys
PrzemyslawKlys deleted the codex/desktop-module-resolver branch July 23, 2026 09:35
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.

1 participant