Fix packaging of design-time providers referenced via ProjectReference#19979
Fix packaging of design-time providers referenced via ProjectReference#19979T-Gro wants to merge 2 commits into
Conversation
✅ No release notes required |
df6cb94 to
9e93c70
Compare
This comment has been minimized.
This comment has been minimized.
4b67d9b to
d3c65ef
Compare
39c6ea9 to
88f0d53
Compare
|
🔍 Tooling Safety Check — Affects-Build-Infra, Affects-Design-Time, Affects-Test-Tooling
|
T-Gro
left a comment
There was a problem hiding this comment.
🤖 This review was generated by AI (@expert-reviewer agent). Findings may contain inaccuracies — please verify independently.
Nice, well-documented fix — the move to eval-time registration plus GetTargetFrameworks/GetReferenceNearestTargetFrameworkTask/GetTargetPath correctly avoids forcing ResolveReferences and keeps pack --no-build working, and the two fail-loud <Error> guards are a real improvement over the previous silent drop. Two robustness observations on the framework-folder derivation and the flattening glob; both are non-blocking.
98fb64a to
4b87c9a
Compare
4b0785f to
2b2f731
Compare
Packing an F# library that activates a design-time type provider via a `ProjectReference` marked `IsFSharpDesignTimeProvider="true"` stopped including the provider assembly in the package (regressed by dotnet#18929). PackageFSharpDesignTimeTools now registers at evaluation time and resolves each provider through the SDK's own nearest-target-framework negotiation (GetTargetFrameworks -> GetReferenceNearestTargetFrameworkTask -> GetTargetPath), so no reference build is triggered (pack --no-build works, ResolveReferences is not forced) and the whole provider output is packaged under the provider's resolved target-framework folder with its subfolder layout preserved. The existing EndToEndBuildTests Host->Provider case (previously a no-op placeholder) now asserts the referenced provider is actually packaged under tools/fsharp41/: red before this fix (provider silently dropped), green after. Co-authored-by: Copilot App <[email protected]>
fsprojects/FSharp.Data.GraphQL pinned to d8aba70 (pre-workaround base of FSharp.Data.GraphQL#583, bare IsFSharpDesignTimeProvider gesture): packs its client and greps the produced package for the provider dll under typeproviders/. Red without this fix (provider silently dropped from the package), green with it. Co-authored-by: Copilot App <[email protected]>
Packing an F# library that activates a design-time type provider via a
ProjectReferencemarkedIsFSharpDesignTimeProvider="true"stopped including the provider assembly in the package (regressed by #18929).dotnet packcollects per-framework content in an inner build withBuildProjectReferences=false, where@(_ResolvedProjectReferencePaths)is empty, so the oldAfterTargets="ResolveReferences"form ofPackageFSharpDesignTimeToolsproduced nothing. Registration of the content target moves back to evaluation time, and the target now resolves each provider through the SDK's own nearest-target-framework negotiation (GetTargetFrameworks->GetReferenceNearestTargetFrameworkTask->GetTargetPath). No reference build is triggered, sopack --no-buildworks (#12320) andResolveReferencesis not forced (#18924 stays fixed).The provider is packaged under its own resolved target-framework folder — the moniker the compiler's design-time load actually probes for (
src/Compiler/Facilities/CompilerLocation.fs), which is not necessarily the consumer'sTargetFramework. The whole provider output travels with its subfolder layout preserved (culture satellites under<culture>/, native underruntimes/<rid>/...), so nothing is lost or collides on a shared file name; the consumer's ownFSharp.Core/System.ValueTuple(andFSharp.Core's satellites) are excluded. A gesture that resolves to nothing, or to an output that was not built, fails loud instead of silently dropping.The standard gesture now packages the provider on its own, so consumers no longer need a hand-written
TargetsForTfmSpecificContentInPackageworkaround.