-
Notifications
You must be signed in to change notification settings - Fork 789
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
Don't ship the FSharp.Core XmlDocs as Content in the nuget package. #13838
Conversation
@teo-tsirpanis --- This was added so that when developers reference the FSharp.Core nuget package they get the .xml in the output file, without having to add the file to the project and copying it. Are you sure that is not necessary ? |
I don't understand why they would want this, and why they would want it only for
No idea, I opened it because I saw the issue. 😅 I was also seeing two |
This issue here wasn't for ionide - it was for any consumer that tries to use the FSharp.Core shipped in the .NET SDK as the source of truth (so anyone wanting to do analysis/editor services for That being said, I completely agree that content files aren't needed in the main, NuGet.org-ified version of this package. We should be able to do things in the SDK's layout project to retrieve the content files and put them in the correct position. |
I agree these shouldn't be content files. I can see the need to get them into the SDK in the right spot but yes, can we solve that another way please?
Should we maybe have a separate package with the FSharp.Core.xml as content? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, looked at it with Kevin, and it turns out, that we already do not publish it for the implicit FSharp.Core
:
fsharp/src/FSharp.Build/Microsoft.FSharp.NetSdk.props
Lines 84 to 94 in e2782fd
<PackageReference | |
Include="FSharp.Core" Version="$(FSharpCoreImplicitPackageVersion)" | |
Condition="'$(DisableImplicitFSharpCoreReference)' != 'true' and '$(FSharpCoreImplicitPackageVersion)' != ''"> | |
<ExcludeAssets Condition="'$(FSharpCoreIncludeDocFileInOutput)' != 'true'">contentFiles</ExcludeAssets> | |
</PackageReference> | |
<PackageReference | |
Include="FSharp.Core" Version="$(FSCorePackageVersion)" | |
Condition="'$(DisableImplicitFSharpCoreReference)' != 'true' and '$(FSharpCoreImplicitPackageVersion)' == ''"> | |
<ExcludeAssets Condition="'$(FSharpCoreIncludeDocFileInOutput)' != 'true'">contentFiles</ExcludeAssets> | |
</PackageReference> |
To enable the publishing, the following property has to be set:
<FSharpCoreIncludeDocFileInOutput>true</FSharpCoreIncludeDocFileInOutput>
and MSBuild will take care of it.
If the project is using explicit FSharp.Core for some reason, contentFiles
need to be excluded explicitly:
<PackageReference Include="FSharp.Core" Version="7.0.0">
<ExcludeAssets>contentFiles</ExcludeAssets>
</PackageReference>
Given that, I don't think we should explicitly exclude it from the nupkg, since some tooling may need it for displaying tooltips and docs.
@baronfel @teo-tsirpanis am I missing something, and some other scenarios are broken?
I wouldn't call that 'not published', it's there in the package after all. I just fail to see why this needs to be in this particular place in the package. It's tooling data, not something for end user projects. |
I meant that if the end-user does
What do you think, would be a good alternative of distributing xml docs?
But if the end-user project is F#-related tooling package, with this change, what would be the way of acquiring xmldoc? |
Just package it in the lib directory like you would PDBs. The SDK team is working on implementing a new flag for .NET 7 in the SDK that will let users include PDB and XML outputs of references on their built/published outputs as well, so users that need the FSharp.Core Xml can use that mechanism. |
I am not at all sure what the problem here is:
It looks to me like developers have all of the tools they need to deal with this. I haven't really heard any SDK developer ask about this. The issues have tended to come from paket users, but I would have thought that with the PR in #4. paket users should be able to handle this easily too. |
@baronfel , when can we expect this new feature, and is there a link? |
Oh, I see, do you know where I can read about differences having it in lib and in contentFiles? |
It's just another workaround that adds more nonsense. Especially if you want to use NuGet central package management. A package has a free form folder structure so I really still don't get the issue, there are like tens of tooling packages to thousands of non tooling packages. Worst case these packages need to re-export a content file by referencing the xmldocs at the custom path by using https://docs.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#generatepathproperty, I don't think we have to wait for an easy sdk feature to do this (as I understand it) |
@KevinRansom The issue is here (one of our oldest, most desired requests) and the PR for it is here. For the 7.0.100 release we won't default it to on, but users can explicitly request it with |
@baronfel, okay we will remove these to align with 7.0.100 then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will rely on the new (Not yet merged - but approved and implemented) sdk feature, to enable developers to ship an FSharp.Core.xml with their apps. Merging now because time is growing short.
Fixes #12706.