Repository navigation
Preserve validation metadata in Hybrid lifecycle compilation - #1026
Merged
Merged
Conversation
This was referenced Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hybrid binary-module compilation can turn a function with numeric
ValidateSet(0,1,5)into a hosted lifecycle cmdlet whose generated validation set is empty. The module imports, but command metadata discovery and invocation fail. Other unrepresented attributes can lose validation options during the same promotion.Apply the shared parameter metadata support policy before promoting a hosted lifecycle. Functions with unsupported numeric or mixed validation sets, named validation options, or script validation retain their authored PowerShell binding and validation. Reuse each parsed source document within planning. Add admission and dual-runtime compatibility checks to the existing compiler gate, and update the Strict parameter-set fixture to use supported object pipeline binding; string conversion remains covered by native lifecycle oracles.
The defect was found while qualifying DLL compilation for Locksmith2. Its rebuilt Hybrid artifact matches all 104 source export names and exported parameter-name sets, and
Show-IssueReportruns with a synthetic issue. The separate Locksmith2 tooling upgrade does not enable compilation. Build performance changes are independent. A public PSPublishModule release containing this fix is required for Gallery consumers to receive the corrected compiler behavior.Validation: 15 focused cases pass, including original/generated invocation on PowerShell 7 and Windows PowerShell 5.1. Four metadata admission cases fail against the untouched base and pass with the fix; the supported validation case passes in both. Package/Strict EXEs, Strict Core/Desktop binary modules, a Hybrid module, and a runtime-free CLR library build and execute against public 3.0.153 and local compiler source. A pre-existing broader lifecycle fixture's compiled-method count assertion fails identically on the untouched base; no full unfiltered compiler-suite pass is claimed. Independent read-only review covers metadata admission and its focused follow-ups. No public API or production dependency is added.