зеркало из
1
0
Форкнуть 0
Contains the DotNet.ReproducibleBuilds package
Перейти к файлу
Chet Husk d88e004545 include release notes 2024-03-12 13:53:24 -05:00
.config move nbgv into tool restore 2021-05-14 11:57:41 -07:00
Documentation Merge branch 'main' into jorichar/readmepatch 2022-09-08 10:21:21 -05:00
config Add files for build/sign 2021-04-28 15:35:00 -04:00
src include release notes 2024-03-12 13:53:24 -05:00
.editorconfig Add files for build/sign 2021-04-28 15:35:00 -04:00
.gitattributes Initial commit 2021-04-28 14:50:57 -04:00
.gitignore use a nuspec 2021-04-29 17:41:15 -04:00
CHECKLIST.md Initial commit 2021-04-28 14:50:57 -04:00
CODE-OF-CONDUCT.md Initial commit 2021-04-28 14:50:57 -04:00
CONTRIBUTING.md Initial commit 2021-04-28 14:50:57 -04:00
Directory.Build.props include release notes 2024-03-12 13:53:24 -05:00
DotNet.ReproducibleBuilds.sln Add to solution 2021-05-13 14:22:13 -07:00
LICENSE Initial commit 2021-04-28 14:50:57 -04:00
README.md Add version to `DotNet.ReproducibleBuilds.Isolated` in README 2022-09-07 22:47:21 -07:00
azure-pipelines.yml remove nuget tool that is no longer required 2024-03-12 13:37:58 -05:00
dirs.proj build all projects using dirs.proj 2021-05-14 12:50:19 -07:00
global.json replace packaging of Dotnet.ReproducibleBuilds via nuget in favor of dotnet pack 2024-03-12 13:04:18 -05:00
version.json update to match latest sourcelink 2021-11-10 16:48:29 -05:00

README.md

DotNet.ReproducibleBuilds

This repo generates a package that enables reproducible builds in a single step, and documents MSBuild settings useful for enabling reproducibility through isolation.

This repo documents various MSBuild settings for reproducibilty, and providing two nuget packages for enabling some of these setting.

The packages are:

  • DotNet.ReproducibleBuilds
  • DotNet.ReproducibleBuilds.Isolated

DotNet.ReproducibleBuilds nuget package

It's highly recommended that all projects enable these settings, either via adding this package or manually as described here: https://devblogs.microsoft.com/dotnet/producing-packages-with-source-link/

This package sets the following properties:

  • PublishRepositoryUrl = true
  • EmbedUntrackedSources = true
  • DebugType = embedded. You can specify portable in your project if you prefer, but you'll need to upload that .snupkg file too.
  • IncludePackageReferencesDuringMarkupCompilation = true (enables a fix for WPF)
  • ContinuousIntegrationBuild = true on CI systems

It also adds SourceLink dependencies for all repo types (the right one will be used automatically).

For more information on debugging with Source Link is here.

Usage

Add the following to your Directory.Build.props file so all projects in your solution have the package added -- use the latest package version.

<ItemGroup>
  <PackageReference Include="DotNet.ReproducibleBuilds" Version="1.1.1" PrivateAssets="All"/>
</ItemGroup>

MSBuild 16.10 is required to generate binaries that can be fully reproduced. You'll need Visual Studio 2019 16.10 and/or .NET 5.0.300 SDK. You'll get a warning if you're using a lower version.

Prerelease packages are available on the following NuGet feed: https://pkgs.dev.azure.com/dotnet/Projects/_packaging/ReproducibleBuilds/nuget/v3/index.json

DotNet.ReproducibleBuilds.Isolated Documentation and nuget package

It's highly recommended that all projects enable these settings, either via adding this package or manually, as described in Documentation/Reproducible-MSBuild.

This package configures a variety of properties and item groups to prevent your build from unintentionally depending on other installed software that's not described by your repo. All build dependencies should come from either the MSBuild SDK you've chosen, or from nuget packages restored from your package feed.

If you check out the same commit with the same SDK version and same nuget feed, you should get the same build result.

Usage

Add the following to the top of your projects or to Directory.Build.props:

<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.1.1" />

Tested on MSBuild 16.7 (Latest LTS at time of writing).

Contributing

See CONTRIBUTING.md for information on contributing to this project.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community. For more information, see the .NET Foundation Code of Conduct.

License

This project is licensed with the MIT license.

.NET Foundation

DotNet.ReproducibleBuilds is a .NET Foundation project.

You should take a look at these related projects: