dotnet / dotnet/arcade

Unnecessary rebuilds caused because`GenerateNuSpec` writes out the file even if the contents are same

Open
#7,550 1 comment 0 reactions 0 assignees View on GitHub
help wanted
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

I tried this with a local build of `dotnet/runtime` on macOS, with:

`$ ./build.sh mono+libs -os Browser -c Release`

In the beginning of the build you will see a line:

`Microsoft.NET.Runtime.wasm.Sample.Mono -> /Users/radical/dev/r3/artifacts/packages/Release/Shipping/Microsoft.NET.Runtime.wasm.Sample.Mono.6.0.0-dev.nupkg`

The nuspec this used: `artifacts/packages/Release/specs/Microsoft.NET.Runtime.wasm.Sample.Mono.nuspec`

Then if I build again, then this file gets generated again, and written out, thus updating the timestamp.

The files are identical, AFAICS:

```
$ shasum /tmp/sample.nuspec
d353e675930dac28fa0d52637593e1adf066c325 /tmp/sample.nuspec

$ shasum /Users/radical/dev/r3/artifacts/packages/Release/specs/Microsoft.NET.Runtime.wasm.Sample.Mono.nuspec
d353e675930dac28fa0d52637593e1adf066c325 /Users/radical/dev/r3/artifacts/packages/Release/specs/Microsoft.NET.Runtime.wasm.Sample.Mono.nuspec
```

This causes the nupkg to get rebuilt every time, which can cascade into other things getting rebuilt.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.