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

Add sourcelink support to SDK projects #1800

Closed
wants to merge 8 commits into from
Closed

Add sourcelink support to SDK projects #1800

wants to merge 8 commits into from

Conversation

eddynaka
Copy link
Contributor

Fix Issue #1760 .

Changes

Adding common properties to _nupkg.props;
Adding package reference to Microsoft.SourceLink.GitHub

Checklist

  • I ran Unit Tests locally.
  • CHANGELOG.md updated with one line description of the fix, and a link to the original issue if available.

For significant contributions please make sure you have completed the following items:

  • Design discussion issue #
  • Changes in public surface reviewed

The PR will trigger build, unit tests, and functional tests automatically. Please follow these instructions to build and test locally.

Notes for authors:

  • FxCop and other analyzers will fail the build. To see these errors yourself, compile localy using the Release configuration.

Notes for reviewers:

  • We support comment build triggers
    • /AzurePipelines run will queue all builds
    • /AzurePipelines run <pipeline-name> will queue a specific build

@TimothyMothra
Copy link
Member

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

linux builds are failing. 
my bust guess is that the new package isn't netstandard compatible. 
we only need this for signed builds, so I'm testing a Windows condition.
@TimothyMothra
Copy link
Member

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@TimothyMothra TimothyMothra left a comment

Choose a reason for hiding this comment

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

Hey @eddynaka,
All of this is good but I need you to make one additional change.

The Sourcelink package isn't compatible with our Linux builds.
I need you ta change the <ItemGroup> to <ItemGroup Condition=" $(OS) == 'Windows_NT'">.

This will unblock Linux builds but will allow our signing to incorporate the SourceLink.
I verified this change already on the Microsoft.ApplicationInsights.csproj. Can you please make this same change on the other csproj?

@eddynaka
Copy link
Contributor Author

eddynaka commented Apr 21, 2020 via email

@TimothyMothra
Copy link
Member

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

Copy link
Member

@TimothyMothra TimothyMothra left a comment

Choose a reason for hiding this comment

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

Hey @eddynaka
the build nupkgs do not have the Source Link.
I built locally and my local builds don't have it either.

Please investigate when you get a chance. Thanks

image

@TimothyMothra
Copy link
Member

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@TimothyMothra
Copy link
Member

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@clairernovotny
Copy link

clairernovotny commented Apr 23, 2020

I would not recommend adding SourceLink to each project individually. It's a pain to then update. Put the reference into a Directory.Build.props file. It works on all OS's.

<!-- indicate that the build executes on a build/CI server -->
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
<!-- mapping all source paths included in the project outputs to deterministic values -->
<DeterministicSourcePaths>true</DeterministicSourcePaths>

Choose a reason for hiding this comment

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

No need to set this manually, this should be set by the targets

<!--Build Infrastructure-->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">

Choose a reason for hiding this comment

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

The SourceLink reference should be added on all OS's

<!--Build Infrastructure-->
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0">

Choose a reason for hiding this comment

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

The SourceLink reference should be added on all OS's

<EmbedUntrackedSources>true</EmbedUntrackedSources>
</PropertyGroup>

<PropertyGroup Condition="'$(BuildServer)' == 'true'">

Choose a reason for hiding this comment

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

This should be at Directory.Build.props

@clairernovotny
Copy link

A few things should be added to a Directory.Build.targets as well:

https://github.com/clairernovotny/DeterministicBuilds

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants