Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions CHECKLIST.md

This file was deleted.

2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Contributing

See [Contributing](https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/contributing.md) for general information about coding styles, source structure, making pull requests, and more.
See [Contributing](https://github.com/dotnet/runtime/blob/main/CONTRIBUTING.md) for general information about coding styles, source structure, making pull requests, and more.
8 changes: 1 addition & 7 deletions Documentation/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
# Documents Index

## Reproducible-Dotnetsdk

This folder documents various settings in MSBuild necessary for configuring repeatible builds through isolation.
This folder documents various settings in MSBuild necessary for configuring repeatable builds through isolation.

- [Reproducible MSBuild](./Reproducible-MSBuild/README.md)
- [Organization](./Reproducible-MSBuild/Organization.md)
- [Techniques](./Reproducible-MSBuild/Techniques/toc.md)
- [References](./Reproducible-MSBuild/References.md)




4 changes: 2 additions & 2 deletions Documentation/Reproducible-MSBuild/Organization.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ Each technique is categorized by two qualitative dimensions - Recommendation, an

- Always: a technique that affects some build behavior that most users will utilize. For instance, resolution of C# framework assemblies.
- Sometimes: a technique that affects only some infrequently used feature. This technique can generally be skipped if difficult to adopt and your team doesn't use that feature
- Rarely: a technique that generally doesn't affect users of the msbuild feature it's improving. This technique should generally be skipped unless you face the specific symptoms described in the technique.
- Rarely: a technique that generally doesn't affect users of the MSBuild feature it's improving. This technique should generally be skipped unless you face the specific symptoms described in the technique.

## Impact
'Impact' characterizes how much a technique may interfere with your dev team's workflow.

- Low: a technique that is generally set once and forget. Developers might not realize it's even there.
- Medium: developers working on the repo are likely to notice this technique in use, but find it generally easy to learn.
- High: a technique that negatively impacts developers often enough that many may consider it too much of a hastle to adopt.
- High: a technique that negatively impacts developers often enough that many may consider it too much of a hassle to adopt.
15 changes: 5 additions & 10 deletions Documentation/Reproducible-MSBuild/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Reproducible MSBuild

If you're landing here, you're probably interested in making your builds more repeatable or improve build reliability in some way. This wiki records a number of techniques and tricks for making MSBuild based builds repeatable through isolation from other installed software on your build machines.
If you're landing here, you're probably interested in making your builds more repeatable or improve build reliability in some way. This project describes a number of techniques and tricks for making MSBuild based builds repeatable through isolation from other installed software on your build machines.

This follows a few principles:

Expand All @@ -22,19 +22,14 @@ Anything "installed" during your build should be removable by `git clean` on the

If your repo has prerequisites, it's often polite to create an init.cmd that locally installs these prerequisites. If not, your README.md should indicate what prerequisites the user must install.

Additionally, it's best to strongly prefer prerequisites that can be installed side-by-side. For instance, the dotnetsdk can be "installed" by adding it to the path and disabling multi-level-lookup.
Additionally, it's best to strongly prefer prerequisites that can be installed side-by-side. For instance, the .NET SDK can be "installed" by adding it to the path and disabling multi-level-lookup.

> E.g. my README.md instructs users that they need to only install dotnetsdk according to the version in global.json, and the repo takes care of everything else. The user can either install it normally, or install it 'standalone'. The build lab always installs it 'standalone' to validate that we can always build with just one version installed.
> E.g. my README.md instructs users that they need to only install .NET SDK according to the version in global.json, and the repo takes care of everything else. The user can either install it normally, or install it 'standalone'. The build lab always installs it 'standalone' to validate that we can always build with just one version installed.

## Tool versions matter

Every tool used in the build should be pre-configured to support locking to an older version, in case of regression in the build tooling. Regressions include user "bugs" that the build tooling used to accept in a previous release.

This guide generally prefers using dotnetsdk over Visual Studio as dotnetsdk's install script supports a `-Version` argument to easily lock a repo to an earlier sdk version until a regression can be addressed.

> E.g. my global.json is currently configured for 3.1.407 and latestPatch. However, if a new version regresses something, I know I can easily edit global.json to lock it back to 3.1.407 precisely. This unblocks my main branch builds, and gives me time to file a bug against the dotnetsdk for the regression and seek a workaround.




This guide generally prefers using .NET SDK over Visual Studio as .NET SDK's install script supports a `-Version` argument to easily lock a repo to an earlier sdk version until a regression can be addressed.

> E.g. my global.json is currently configured for 8.0.400 and latestPatch. However, if a new version regresses something, I know I can easily edit global.json to lock it back to 8.0.300 precisely. This unblocks my main branch builds, and gives me time to file a bug against the .NET SDK for the regression and seek a workaround.
2 changes: 1 addition & 1 deletion Documentation/Reproducible-MSBuild/References.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Useful references
# MSBuild

- [MSBuild](https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild?view=vs-2019) on msdn
- [Customize all .NET builds](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#customize-all-net-builds) lists a number of extensibility points of the default targets that ship with MSBuild.
- [Customize all .NET builds](https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2019#customize-all-net-builds) lists a number of extensibility points of the default targets that ship with MSBuild.
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ export DOTNET_MULTILEVEL_LOOKUP=0
## References

- [Dotnet command / Environment Variables](https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet#environment-variables)
- [Multi-level SharedFX Lookup](https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/multilevel-sharedfx-lookup.md)
- [Multi-level SharedFX Lookup](https://github.com/dotnet/core-setup/blob/master/Documentation/design-docs/multilevel-sharedfx-lookup.md)
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ In Directory.Build.props

## References
- [Microsoft.NET.NuGetOfflineCache.targets](https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.NuGetOfflineCache.targets)
- Official documentation: none?
- Official documentation: none?
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ In Directory.Build.props

## References
- [Microsoft.NET.NuGetOfflineCache.targets](https://github.com/dotnet/sdk/blob/main/src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.NuGetOfflineCache.targets)
- Official documentation: none?
- Official documentation: none?
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ variables:
NUGET_XMLDOC_MODE: ''
```

Unfortunatelyly there is no way known at this time to override this setting via MSBuild properties. Each developer will need to check if any installed program has overriden this setting.
Unfortunately there is no way known at this time to override this setting via MSBuild properties. Each developer will need to check if any installed program has changed this setting.

## Remarks

The dotnet sdk docker image sets NUGET_XMLDOC_MODE=skip ([issue 2790](https://github.com/dotnet/dotnet-docker/issues/2790)), which causes builds run under this docker image to produce results different from a typical developer workstation. Thousands of developers are using this build image for their lab builds in the Azure organization.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# NetCoreTargetingPackRoot

Similar to [`TargetFrameworkRootPath`](./TargetFrameworkRootPath.md), the msbuild property `NetCoreTargetingPackRoot`
Similar to [`TargetFrameworkRootPath`](./TargetFrameworkRootPath.md), the MSBuild property `NetCoreTargetingPackRoot`
controls where dotnet sdk builds "sniff out" installed reference assemblies for dotnet runtimes. The target
`ResolveTargetingPackAssets` will try seeing if there are any such reference assemblies installed into the
`dotnet/packs/` folder. If not found, then MSBuild's built in targets will attempt to resolve the appropriate
Microsoft.NETCore.App.Ref nuget package instead.

This can be problematic for reproducibility, as upgrading your dotnetsdk can result in a different set of packs available, and possible build failures if that nuget package isn't available on your nuget feed.
This can be problematic for reproducibility, as upgrading your .NET SDK can result in a different set of packs available, and possible build failures if that nuget package isn't available on your nuget feed.

- Recommendation: Always
- Impact: Low
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ Using the nuget package will produce consistent results regardless of installed

## References
- [GetReferenceAssemblyPaths task](https://docs.microsoft.com/en-us/visualstudio/msbuild/getreferenceassemblypaths-task?view=vs-2019)
- Github issue, closed: [TargetFrameworkRootPath not respected](https://github.com/dotnet/msbuild/issues/598)
- Github issue, closed: [TargetFrameworkRootPath not respected](https://github.com/dotnet/msbuild/issues/598)
16 changes: 3 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Add the following to your `Directory.Build.props` file so all projects in your s

```xml
<ItemGroup>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.4" PrivateAssets="All"/>
<PackageReference Include="DotNet.ReproducibleBuilds" Version="1.2.25" 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
MSBuild 17.8 is required to generate binaries that can be fully reproduced. You'll need Visual Studio 2022 17.8 and/or .NET 8.0.100 SDK. You'll get a warning
if you're using a lower version.

Prerelease packages are available on the following [NuGet feed](https://dev.azure.com/dotnet/Projects/_packaging?_a=feed&feed=ReproducibleBuilds):
Expand All @@ -58,11 +58,9 @@ If you check out the same commit with the same SDK version and same nuget feed,
Add the following to the top of your projects or to `Directory.Build.props`:

```xml
<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.2.4" />
<Sdk Name="DotNet.ReproducibleBuilds.Isolated" Version="1.2.25" />
```

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

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) for information on contributing to this project.
Expand All @@ -77,11 +75,3 @@ This project is licensed with the [MIT license](LICENSE).
## .NET Foundation

DotNet.ReproducibleBuilds is a [.NET Foundation project](https://dotnetfoundation.org/projects).

## Related Projects

You should take a look at these related projects:

- [.NET Core](https://github.com/dotnet/core)
- [ASP.NET](https://github.com/aspnet)
- [Mono](https://github.com/mono)
23 changes: 22 additions & 1 deletion src/DotNet.ReproducibleBuilds/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,26 @@
# Changelog

## [1.2.25]

### Added

- [Align RepositoryBranch logic with .NET 9](https://github.com/dotnet/reproducible-builds/pull/50) - thanks @MattKotsenas!

### Removed

- [Bump required SDK to 8+ and remove fixed issues](https://github.com/dotnet/reproducible-builds/pull/52) - thanks @MattKotsenas!

## [1.2.4]

### Added

- [Set the `DisableImplicitLibraryPacks` property to `true` to prevent using packages from the .NET SDK's built-in package sources.](https://github.com/dotnet/reproducible-builds/pull/21) - thanks @cmeeren!
- [Populate the `RepositoryBranch` property if other Repository Metadata has been requested to be made public.](https://github.com/dotnet/reproducible-builds/pull/27) - thanks @kzu!

### Removed

- [No longer include the .NET Framework reference assembly packages, because the .NET SDK does this now.](https://github.com/dotnet/reproducible-builds/pull/33) - thanks @MattKotsenas!

## [1.2.0]

### Added
Expand All @@ -9,4 +30,4 @@

### Removed

- [Remove the automatically provided .NET Framework reference assembly PackageReference, since the SDK provides this already](https://github.com/dotnet/reproducible-builds/pull/33) - thanks @MattKotsenas!
- [Remove the automatically provided .NET Framework reference assembly PackageReference, since the SDK provides this already](https://github.com/dotnet/reproducible-builds/pull/33) - thanks @MattKotsenas!