Skip to content
This repository has been archived by the owner on Apr 16, 2020. It is now read-only.

help enable source link for Rx.NET #167

Closed
ctaggart opened this issue Mar 12, 2017 · 11 comments
Closed

help enable source link for Rx.NET #167

ctaggart opened this issue Mar 12, 2017 · 11 comments

Comments

@ctaggart
Copy link
Owner

@onovotny reported a couple of days ago that SourceLink 2.0.2 did not work for him on the AppVeyor builds. It resulted in embedding all of the files. I guessed that it was a conflict with what GitVersion was doing to the git repository, but was wrong. Will need to dig deeper to see what is going on and if this is a SourceLink bug.

@clairernovotny
Copy link

If it helps, we do build PR's so easy to test by starting a PR and updating that branch. happy to accept anything that works :)

@ctaggart
Copy link
Owner Author

@onovotny I am unable to reproduce the issue from my ctaggart/rx-net AppVeyor. Only on dotnetfoundation/rx-net-la3iv AppVeyor does the C# compiler set the directory name to source in the debug documents. dotnetfoundation/rx-net-la3iv is not using the appveyor.yml. Any change you could make it use the appveyor.yml again? Are there cache settings being used in the config? Are you using the Visual Studio 2017 image? Does a paid AppVeyor account do cloning differently than a non paid one?

https://ci.appveyor.com/project/ctaggart/rx-net/build/4.0.0-sourcelink2.107.build.7

dotnet sourcelink print-documents "C:\Users\camer\Downloads\System.Reactive.4.0.0sourcelink2.107\lib\net46\System.React
ive.dll"

2dce25745d3bf724e498ec9f0e2795a1c778e9c4 sha1 csharp C:\projects\rx-net\Rx.NET\Source\src\System.Reactive\Observable.Extensions.cs
059d8221fd2f1dda5261a633fe4eb2ab1891c76f sha1 csharp C:\projects\rx-net\Rx.NET\Source\src\System.Reactive\AnonymousObservable.cs

I don't understand why this isn't the case on

https://ci.appveyor.com/project/dotnetfoundation/rx-net-la3iv/build/4.0.0-PullReq00337.103.build.153

dotnet sourcelink print-documents "C:\Users\camer\Downloads\System.Reactive.4.0.0-PullReq00337.99\lib\net45\System.Reactive.dll"

2dce25745d3bf724e498ec9f0e2795a1c778e9c4 sha1 csharp C:\projects\rx-net-la3iv\Rx.NET\source\src\System.Reactive\Observable.Extensions.cs
059d8221fd2f1dda5261a633fe4eb2ab1891c76f sha1 csharp C:\projects\rx-net-la3iv\Rx.NET\source\src\System.Reactive\AnonymousObservable.cs

@clairernovotny
Copy link

@ctaggart That build uses the following AppVeyor file:
https://github.com/Reactive-Extensions/Rx.NET/blob/develop/appveyor.rx.yml

We split it to improve CI build times since check-ins to Rx rarely had an impact on Ix and vice-versa.

We're not doing any special caching or anything else special....

@ctaggart
Copy link
Owner Author

dotnet/reactive#338 is building. Root cause fix is:
image

@clairernovotny
Copy link

clairernovotny commented Mar 14, 2017

@ctaggart that seems really fragile...how does the case in the powershell path to invoke the build script affect this at all?

@ctaggart
Copy link
Owner Author

@onovotny I agree, but it works. I'm sure this will become more robust as more people adopt it. I'll open up a new issue to track this. For this issue, we'd have to look at how the powershell path affects the C# compiler call. Hopefully, there is an msbuild property that can we can override with Path.GetFullPath to make this more robust.

@clairernovotny
Copy link

Indeed, a very strange interaction!

@ctaggart
Copy link
Owner Author

Thanks for merging it! Please do report back when source link enabled binaries make it to NuGet Gallery. And please help spread the word that enabling source link will help the whole .NET community. It would be great to see more adoption from additional .NET Foundation projects.

Created #172 to track down that strange interaction.

@clairernovotny
Copy link

It's not on NuGet but it is on MyGet -- https://twitter.com/ReactiveX/status/842474985348304898

@ctaggart
Copy link
Owner Author

bug #197

@ctaggart
Copy link
Owner Author

The current SourceLink solution for Rx.NET is now using SourceLink.Create.GitHub in Directory.Build.props files. This is for 4.0.0 that is currently in beta.

Here are the related changes. SourceLink is enabled when it is not a test project.

<Project>
  <PropertyGroup>
    <IsTestProject>$(MSBuildProjectName.Contains('Test'))</IsTestProject>
  </PropertyGroup>
  <ItemGroup Condition="'$(IsTestProject)' != 'true' and '$(SourceLinkEnabled)' != 'false'">
    <PackageReference Include="SourceLink.Create.CommandLine" Version="2.1.0" PrivateAssets="All" /> 
  </ItemGroup>
</Project>

The appveyor.yml files have been updated

init:
  - git config --global core.autocrlf input

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

No branches or pull requests

2 participants