-
Notifications
You must be signed in to change notification settings - Fork 329
Migrated nuspec to csproj and improved packaging #54
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
Conversation
- Migrate from nuspec to csproj - Fixed targets location - Fixed package dependencies - Fixed package to be recognised as netstandard2.0 - Moved debug symbols to symbols package - Added Sourcelink - Fixed package dependencies
examples/Microsoft.Spark.FSharp.Examples/Microsoft.Spark.FSharp.Examples.fsproj
Outdated
Show resolved
Hide resolved
|
||
<PublishRepositoryUrl>true</PublishRepositoryUrl> | ||
<IncludeSymbols>true</IncludeSymbols> | ||
<SymbolPackageFormat>snupkg</SymbolPackageFormat> |
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.
Now we are creating .snupkg
packages, but we aren't doing anything with them in the build. Can we publish them somewhere? Like in a "BuildArtifact"?
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.
Ideally we would publish them to the Microsoft symbol server, but that is probably outside of the scope of this PR. We can do that in the future.
In reply to: 278755885 [](ancestors = 278755885)
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.
I added a step to publish them as artifacts. Does it help?
<Pack>true</Pack> | ||
<PackagePath>jars\%(Filename)%(Extension)</PackagePath> | ||
</Content> | ||
<Content Include="..\build\**" Link="build\%(Filename)%(Extension)"> |
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.
What do you feel about moving this file into a src/csharp/Microsoft.Spark/build/netstandard2.0
folder?
I have 2 concerns:
- If we add other nupkgs that need build scripts, they can't go into this root
build
directory, or else they would start being packed here. - The .csproj shouldn't be deciding where this file goes. Instead the file system should. If you put a file in
build/foo/bar/myFile.targets
, it should be in the same folder in the package.
So instead of the above, you could have:
<Content Include="build\**\*" Pack="true" PackagePath="build" />
And it would pick up any file/folder structure under the build
folder.
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.
I was trying to not move things around :) but agree it is better with this approach. Done!
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.
This is great @alefranz! Thanks for helping out here.
<Pack>true</Pack> | ||
<PackagePath>jars\%(Filename)%(Extension)</PackagePath> | ||
</Content> | ||
<Content Include="..\build\**" Link="build\%(Filename)%(Extension)"> |
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.
I think we should also include the License and Third-Parties files that we define on the root of the repo. This is a convention we've followed in other repos. https://github.com/dotnet/iot/blob/master/Directory.Build.props#L21
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.
I've added that as well as moved the Licence expression and some other generic bits to the props file.
Please note this means the third party notices file will show up in the Solution Explorer for each project
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.
How about Visible="false"
?
<Content Include="$(MSBuildThisFileDirectory)..\..\THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="\" Visible="false"/>
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.
Yes, let's fix this on a follow up PR 😄
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.
Thanks @alefranz 😄
@eerhardt - I thought this was needed to install the |
I don't believe this is needed for the MicroBuildSigningPlugin. We are using an older version of that plugin on ML.NET https://github.com/dotnet/machinelearning/blob/master/build/vsts-ci.yml#L134, and it doesn't require the |
|
||
<ItemGroup> | ||
<Content Include="..\..\scala\microsoft-spark-*\target\microsoft-spark-*.jar" Link="jars\%(Filename)%(Extension)" | ||
Pack="true" PackagePath="jars\%(Filename)%(Extension)" /> |
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.
(nit) A more readable multi-line format here would be:
<Content Include="..\..\scala\microsoft-spark-*\target\microsoft-spark-*.jar"
Link="jars\%(Filename)%(Extension)"
Pack="true"
PackagePath="jars\%(Filename)%(Extension)" />
It's easier to see each attribute. You don't have to parse the string, or miss something way off to the right.
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.
done
I removed the NugetInstall step. I'm still not able to test on my Azure DevOps account as I don't know how to get the Signing plugin. If you could please try to manually run a build of this PR so the
I haven't moved the jars, as they are installed by maven. Not sure if needed and in scope. |
You didn't move the jars, but you did move the |
I've kicked off a test of the official build using your changes @alefranz. I'll let you know how it goes. |
Ah sorry, I didn't realize you were referring to the targets file. Fixed it. |
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.
|
||
<ItemGroup> | ||
<Content Include="..\..\scala\microsoft-spark-*\target\microsoft-spark-*.jar" | ||
Link="jars\%(Filename)%(Extension)" |
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.
(nit) I wasn't clear about the formatting, but we typically align the attributes underneath the attribute on the first line. This isn't 100% necessary to fix, but if you are changing something else, consider this.
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.
no worries, fixed
Updated top of description to correctly specify the issues it fixes, also added #40 |
@@ -36,7 +36,7 @@ | |||
</ItemGroup> | |||
|
|||
<ItemGroup Condition="'$(SignNugetPackages)' == 'true'"> | |||
<FilesToSign Include="$(OutDir)*.nupkg" Exclude="$(OutDir)*.symbols.nupkg"> | |||
<FilesToSign Include="$(OutDir)*.nupkg"> |
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.
I think we should also sign snupkg, right? Since the plan is for it to go into nuget? @eerhardt what do you think?
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.
Opps we merged right at the same moment I commented on this, but @imback82 I think we want to solve this.
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.
I guess it depends on what we plan on doing with them... if we just use it to publish the symbols to the Microsoft Symbol Server during the build, they probably don't need to be signed.
But if we do plan on uploading them to nuget.org, then maybe they need to be signed?
@dagood @mikem8361 - for thoughts/recommendations on what should be done with .snupkg
files.
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.
@tmat knows the most about snupkg
s, I think.
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.
snupkgs should be published to NuGet.org and the PDBs to Microsoft Symbol servers.
Have you considered using Arcade SDK? It's kind of sad to see folks spending a time on their infrastructure reinventing the wheel for the hundredth time when the same work has already been done and it's easy to use. |
This fixes #36, fixes #37, fixes #38, fixes #40
Before / After

Symbols package

Package size is actually bigger now

For the Azure Pipelines I'm flying blind, but hopefully should work correctly and not break the signature.
I don't think the symbol package needs to be signed.
Fixes #nnnn
in your description to cause GitHub to automatically close the issue(s) when your PR is merged.