Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change execution order conditions for intellisense swapping and copying msbuild targets. #83117

Merged
merged 2 commits into from
Mar 16, 2023

Conversation

carlossanlop
Copy link
Member

@carlossanlop carlossanlop commented Mar 8, 2023

Fixes #82214

The current conditions used to decide when to execute the intellisense related targets need to be changed to ensure OOB packages get their correct intellisense files included in their packages.

@dotnet-issue-labeler
Copy link

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@ghost
Copy link

ghost commented Mar 8, 2023

Tagging subscribers to this area: @dotnet/area-infrastructure-libraries
See info in area-owners.md if you want to be subscribed.

Issue Details

Fixes Issue #82191

The current conditions used to decide when to execute the intellisense related targets need to be changed to avoid overbuilding.

Author: carlossanlop
Assignees: carlossanlop
Labels:

area-Infrastructure-libraries

Milestone: -

@carlossanlop carlossanlop added the documentation Documentation bug or enhancement, does not impact product or test code label Mar 8, 2023
@ViktorHofer
Copy link
Member

These changes look good. @carlossanlop this doesn't fix #82191 as we still depend on TargetFramework agnostic builds, even if there's a closer OS specific target framework. This change fixes #79030 or #82214 (whichever of these two issues apply to main).

@carlossanlop
Copy link
Member Author

I updated the description.

@carlossanlop carlossanlop marked this pull request as ready for review March 8, 2023 15:39
@carlossanlop
Copy link
Member Author

Just to clarify:

this doesn't fix #82191 as we still depend on TargetFramework agnostic builds

Is it your preference that we get that issue fixed in this PR?

@ViktorHofer
Copy link
Member

Fixing that isn't a priority right now and it's yet unclear how to best approach that issue. Let's keep this scoped on fixing the sequencing points.

@ViktorHofer
Copy link
Member

@carlossanlop I think we want to get this in before Preview 3 snap (which I believe is next Friday?). Were you able to test the changes and see if our packages now contain the expected intellisense file?

@carlossanlop
Copy link
Member Author

The AllConfigurations build is failing:

D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\Microsoft.XmlSerializer.Generator\Debug\netstandard2.0\dotnet-Microsoft.XmlSerializer.Generator.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\Microsoft.XmlSerializer.Generator\src\Microsoft.XmlSerializer.Generator.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\System.Runtime.Serialization.Schema\Debug\net7.0\System.Runtime.Serialization.Schema.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\System.Runtime.Serialization.Schema\src\System.Runtime.Serialization.Schema.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\Microsoft.Bcl.AsyncInterfaces\Debug\net462\Microsoft.Bcl.AsyncInterfaces.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\Microsoft.Bcl.AsyncInterfaces\src\Microsoft.Bcl.AsyncInterfaces.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\Microsoft.Bcl.Cryptography\Debug\net462\Microsoft.Bcl.Cryptography.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\Microsoft.Bcl.Cryptography\src\Microsoft.Bcl.Cryptography.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\System.Numerics.Tensors\Debug\net462\System.Numerics.Tensors.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\System.Numerics.Tensors\src\System.Numerics.Tensors.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\System.Threading.RateLimiting\Debug\net462\System.Threading.RateLimiting.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\System.Threading.RateLimiting\src\System.Threading.RateLimiting.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\System.Speech\Debug\net6.0\System.Speech.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\System.Speech\src\System.Speech.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\Microsoft.Extensions.DependencyInjection.Specification.Tests\Debug\net462\Microsoft.Extensions.DependencyInjection.Specification.Tests.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\Microsoft.Extensions.DependencyInjection.Specification.Tests\src\Microsoft.Extensions.DependencyInjection.Specification.Tests.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\Microsoft.Extensions.Hosting.Systemd\Debug\net6.0\Microsoft.Extensions.Hosting.Systemd.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\Microsoft.Extensions.Hosting.Systemd\src\Microsoft.Extensions.Hosting.Systemd.csproj]
D:\a\_work\1\s\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\a\_work\1\s\artifacts\bin\Microsoft.Extensions.Hosting.WindowsServices\Debug\net462\Microsoft.Extensions.Hosting.WindowsServices.xml' to be packed was not found on disk. [D:\a\_work\1\s\src\libraries\Microsoft.Extensions.Hosting.WindowsServices\src\Microsoft.Extensions.Hosting.WindowsServices.csproj]

I was able to repro after rebasing my branch to the latest bits. Not sure why I didn't see it before rebasing:

D:\runtime\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\build\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\runtime\artifacts\bin\Microsoft.XmlSerializer.Generator\Release\netstandard2.0\dotnet-Microsoft.XmlSerializer.Generator.xml' to be packed was not found on disk. [D:\runtime\src\libraries\Microsoft.XmlSerializer.Generator\src\Microsoft.XmlSerializer.Generator.csproj]
D:\runtime\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\runtime\artifacts\bin\Microsoft.Bcl.AsyncInterfaces\Release\net462\Microsoft.Bcl.AsyncInterfaces.xml' to be packed was not found on disk. [D:\runtime\src\libraries\Microsoft.Bcl.AsyncInterfaces\src\Microsoft.Bcl.AsyncInterfaces.csproj]
D:\runtime\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\runtime\artifacts\bin\System.Runtime.Serialization.Schema\Release\net7.0\System.Runtime.Serialization.Schema.xml' to be packed was not found on disk. [D:\runtime\src\libraries\System.Runtime.Serialization.Schema\src\System.Runtime.Serialization.Schema.csproj]
D:\runtime\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\runtime\artifacts\bin\System.Threading.RateLimiting\Release\net462\System.Threading.RateLimiting.xml' to be packed was not found on disk. [D:\runtime\src\libraries\System.Threading.RateLimiting\src\System.Threading.RateLimiting.csproj]
D:\runtime\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\runtime\artifacts\bin\Microsoft.Bcl.Cryptography\Release\net462\Microsoft.Bcl.Cryptography.xml' to be packed was not found on disk. [D:\runtime\src\libraries\Microsoft.Bcl.Cryptography\src\Microsoft.Bcl.Cryptography.csproj]
D:\runtime\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\runtime\artifacts\bin\System.Numerics.Tensors\Release\net462\System.Numerics.Tensors.xml' to be packed was not found on disk. [D:\runtime\src\libraries\System.Numerics.Tensors\src\System.Numerics.Tensors.csproj]
D:\runtime\.dotnet\sdk\8.0.100-preview.1.23115.2\Sdks\NuGet.Build.Tasks.Pack\buildCrossTargeting\NuGet.Build.Tasks.Pack.targets(221,5): error NU5026: The file 'D:\runtime\artifacts\bin\System.Speech\Release\net6.0\System.Speech.xml' to be packed was not found on disk. [D:\runtime\src\libraries\System.Speech\src\System.Speech.csproj]

@ViktorHofer
Copy link
Member

ViktorHofer commented Mar 15, 2023

@carlossanlop I pushed to your branch, hope that's OK. The problem was that the ChangeDocumentationFileForPackaging target ran even when IntellisensePackageXmlFilePath was empty (because there is no correspndong intellisense doc file in the intellisense package).

While at it, I also cleaned-up code in the file.

<PropertyGroup>
<NoWarn Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true'">$(NoWarn);1591</NoWarn>
<PropertyGroup Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true'">
<NoWarn>$(NoWarn);1591</NoWarn>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need 1591 here?

<IntellisensePackageXmlRootFolder>$([MSBuild]::NormalizeDirectory('$(NuGetPackageRoot)', 'microsoft.private.intellisense', '$(MicrosoftPrivateIntellisenseVersion)', 'IntellisenseFiles'))</IntellisensePackageXmlRootFolder>
<IntellisensePackageXmlFilePathFromNetFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'net', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromNetFolder>
<IntellisensePackageXmlFilePathFromDotNetPlatExtFolder>$([MSBuild]::NormalizePath('$(IntellisensePackageXmlRootFolder)', 'dotnet-plat-ext', '1033', '$(AssemblyName).xml'))</IntellisensePackageXmlFilePathFromDotNetPlatExtFolder>
<IntellisensePackageXmlFilePath Condition="'$(UseIntellisensePackageDocXmlFile)' == 'true' and Exists($(IntellisensePackageXmlFilePathFromNetFolder))">$(IntellisensePackageXmlFilePathFromNetFolder)</IntellisensePackageXmlFilePath>
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and '$(UseIntellisensePackageDocXmlFile)' == 'true' and Exists($(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder))">$(IntellisensePackageXmlFilePathFromDotNetPlatExtFolder)</IntellisensePackageXmlFilePath>
<IntellisensePackageXmlFilePath Condition="'$(IntellisensePackageXmlFilePath)' == '' and Exists($(IntellisensePackageXmlFilePathFromNetFolder))">$(IntellisensePackageXmlFilePathFromNetFolder)</IntellisensePackageXmlFilePath>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK cool. I see it makes more sense to check its own value.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI is green now, nice!

@carlossanlop
Copy link
Member Author

Testing locally now...

@carlossanlop
Copy link
Member Author

CI is green and tests below look good.

The only results that always failed were the xml files generated under the \obj\ folders, but from the previous PR's test results, this seems to be expected (I wasn't told it wasn't).

The files that matter are the ones under artifacts\bin\docs, \bin\, and the ones inside the nupkgs.

I think this is good to merge, @ViktorHofer. I'll hit the button.


TSASOT = Triple slash as source of truth.
MS Docs = dotnet-api-docs private intellisense package as source of truth.
PNSE = Throws PlatformNotSupportedException.

Tests

Individual commands

System.Formats.Cbor - TSASOT, OOB.

  • Pass: dotnet pack - artifacts\packages\Release\Shipping\System.Formats.Cbor.8.0.0-dev.nupkg created, and \lib\net8.0\System.Formats.Cbor.xml internal file contains triple slash full docs.
  • dotnet build
    • Pass: artifacts\obj\System.Formats.Cbor\Release\net8.0\System.Formats.Cbor.xml contains triple slash full docs.
    • Pass: artifacts\bin\System.Formats.Cbor\Release\net8.0\System.Formats.Cbor.xml contains triple slash full docs.
  • Skip: artifacts\bin\docs\ - No file copied (expected).

System.Numerics.Vectors - TSASOT, partial source facade.

  • Skip: dotnet pack - Not an OOB.
  • dotnet build
    • Fail: artifacts\obj\System.Numerics.Vectors\Release\net8.0\System.Numerics.Vectors.xml contains the xml structure but no API docs.
    • Pass: artifacts\bin\System.Numerics.Vectors\Release\net8.0\System.Numerics.Vectors.xml contains triple slash full docs.
  • Pass: artifacts\bin\docs\System.Numerics.Vectors.xml contains triple slash full docs.

System.Formats.Tar - MS Docs.

  • Skip: dotnet pack - Not an OOB.
  • dotnet build
    • Fail: artifacts\obj\System.Formats.Tar\Release\net8.0\System.Formats.Tar.xml contains only SR strings.
    • Pass: artifacts\bin\System.Formats.Tar\Release\net8.0\System.Formats.Tar.xml contains dotnet-api-docs full docs.
  • Pass: artifacts\bin\docs\System.Formats.Tar.xml contains dotnet-api-docs full docs.

System.IO.Compression.Brotli - MS Docs, PNSE.

  • Skip: dotnet pack - Not an OOB.
  • dotnet build
    • Fail: artifacts\obj\System.IO.Compression.Brotli\Release\net8.0\System.IO.Compression.Brotli.xml contains only SR strings.
    • Pass: artifacts\bin\System.IO.Compression.Brotli\Release\net8.0\System.IO.Compression.Brotli.xml contains dotnet-api-docs full docs.
  • Pass: artifacts\bin\docs\System.IO.Compression.Brotli.xml contains dotnet-api-docs full docs.

System.IO.Ports - OOB, PNSE, partial source facade, MS Docs.

  • Pass: artifacts\packages\Release\Shipping\System.IO.Ports.8.0.0-dev.nupkg created, and \lib\net8.0\System.IO.Ports.xml internal file contains dotnet-api-docs full docs.
  • dotnet build
    • Fail: artifacts\obj\System.IO.Ports\Release\net8.0\System.IO.Ports.xml contains only SR strings.
    • Pass: artifacts\bin\System.IO.Ports\Release\net8.0\System.IO.Ports.xml contains dotnet-api-docs full docs.
  • Skip: artifacts\bin\docs - No file copied (expected).

Full build

Passed: build.cmd -c Release -allconfigurations finished without errors, and all the tests from above got the exact same results (made sure to git clean -fdx first).

@carlossanlop
Copy link
Member Author

Ah, @ViktorHofer, I don't yet have a sign-off. Please do the honors and merge this PR.

@ViktorHofer ViktorHofer merged commit 571fbb8 into dotnet:main Mar 16, 2023
@carlossanlop carlossanlop deleted the IntellisenseTarget branch March 16, 2023 15:31
@ghost ghost locked as resolved and limited conversation to collaborators Apr 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-libraries documentation Documentation bug or enhancement, does not impact product or test code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some OOB assemblies are not copying intellisense extracted from docs package
2 participants