dotnet / dotnet/arcade

GenerateSourcePackageSourceLinkTargetsFile writes OutputPath even on failure

Open
#5,652 2 comments 0 reactions 1 assignee Claimed by @tmat View on GitHub
help wanted
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

When investigating https://github.com/dotnet/runtime/issues/37921 I noticed that I could hit any of the errors in GenerateSourcePackageSourceLinkTargetsFile, for example: https://github.com/dotnet/arcade/blob/dcc5ca2cf397c53575d376e80ecd30f63160037f/src/Microsoft.DotNet.Arcade.Sdk/src/GenerateSourcePackageSourceLinkTargetsFile.cs#L74-L77

This would still write the outputpath file, so on a subsequent build inputs/outputs of the target would be up-to-date and the target would be skipped.

https://github.com/dotnet/arcade/blob/dcc5ca2cf397c53575d376e80ecd30f63160037f/src/Microsoft.DotNet.Arcade.Sdk/src/GenerateSourcePackageSourceLinkTargetsFile.cs#L39 should be changed to only write the file if `GetOutputFileContent` doesn't return null.

/cc @tmat

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.