-
-
Notifications
You must be signed in to change notification settings - Fork 379
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 support for deterministic builds #883
Changes from 2 commits
591fb21
c0dceda
03a1507
9c7152f
14c1b0c
0323ecc
e0050a5
30d9dee
70252b1
7774682
f2ac390
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,11 +23,11 @@ | |
<ItemGroup> | ||
<PackageReference Include="EmptyFiles" Version="4.1.0" PrivateAssets="None" /> | ||
<PackageReference Include="DiffEngine" Version="11.0.0" /> | ||
<Content Include="build.props" PackagePath="build\Shouldly.props" /> | ||
<Content Include="buildMultiTargeting.props" PackagePath="buildMultiTargeting\Shouldly.props" /> | ||
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" /> | ||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" Condition="$(Configuration) == 'Release'" /> | ||
<None Include="..\..\assets\logo_128x128.png" Pack="true" PackagePath="assets" /> | ||
</ItemGroup> | ||
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' " > | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an unrelated change to this PR, but it was a blocker to using Rider, so have bundled up this fix. |
||
<PackageReference Include="TunnelVisionLabs.ReferenceAssemblyAnnotator" Version="1.0.0-alpha.160" PrivateAssets="all" /> | ||
<PackageDownload Include="Microsoft.NETCore.App.Ref" Version="[5.0.0]" /> | ||
</ItemGroup> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,4 +49,10 @@ public void Dispose() | |
|
||
public static double DefaultFloatingPointTolerance = 0.0d; | ||
public static TimeSpan DefaultTaskTimeout = TimeSpan.FromSeconds(10); | ||
|
||
/// <summary> | ||
/// Shouldly can enhance assertion failure messages if it can find the source code at the call site. | ||
/// When using deterministic builds, set this property to explicitly tell Shouldly the root path which symbol paths will be relative to. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The wording here is pretty awkward, suggestions welcome! |
||
/// </summary> | ||
public static string? SourceRoot { get; set; } = null; | ||
} |
This file was deleted.
This file was deleted.
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.
Maybe searching for the SLN could be an alternative to the directory
.git
. It would remove the dependency to Git if you start a project and add Git afterwards.Further checks could be implemented as needed. I think the best solution would be to look for the CSPROJ of the test projects and parse for the referenced projects to test. But there could be multiple. It would add some complexity.
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'd get too many false positives, I just checked a handful of open source .NET projects and about half had the
.sln
file one level in (Newtonsoft.Json
,Spectre.Console
etc...).The git approach is quite crude, but might cover 90% of scenarios, for everything else we can tell users to pass a
SourceRoot
.For deterministic builds, there an MSBuild
ItemGroup
item namedSourceRoot
which ideally we'd want to reuse, but the only way to get it would be some sort of source code generation.