Skip to content

Conversation

@carlossanlop
Copy link
Contributor

@carlossanlop carlossanlop commented Mar 6, 2025

Fixes #208

Follow up of #207 (comment)

Similar to what we have in runtime, we want to throw an error whenever we need to update a package because one of its dependencies is getting updated.

Opened as draft because I added a temporary commit that enables building some packages that are dependencies of others, and disabled building packages that consume those dependencies, to prove the change works. The output in my local machine is:

Build FAILED.

~\maintenance-packages\eng\servicingValidation.targets(34,5): error : 'System.Threading.Tasks.Extensions' did not set 'IsPackable' to 'true', but one or more of its dependencies did: 'System.Runtime.CompilerServices.Unsafe'. Please ship 'System.Threading.Tasks.Extensions' by setting 'IsPackable' to 'true' and incrementing its servicing version(s). [~\maintenance-packages\src\System.Threading.Tasks.Extensions\src\System.Threading.Tasks.Extensions.csproj]
~\maintenance-packages\eng\servicingValidation.targets(34,5): error : 'System.Memory' did not set 'IsPackable' to 'true', but one or more of its dependencies did: 'System.Buffers;System.Numerics.Vectors;System.Runtime.CompilerServices.Unsafe'. Please ship 'System.Memory' by setting 'IsPackable' to 'true' and incrementing its servicing version(s). [~\maintenance-packages\src\System.Memory\src\System.Memory.csproj]
~\maintenance-packages\eng\servicingValidation.targets(34,5): error : 'Microsoft.IO.Redist' did not set 'IsPackable' to 'true', but one or more of its dependencies did: 'System.Buffers;System.Numerics.Vectors;System.Runtime.CompilerServices.Unsafe'. Please ship 'Microsoft.IO.Redist' by setting 'IsPackable' to 'true' and incrementing its servicing version(s). [~\maintenance-packages\src\Microsoft.IO.Redist\src\Microsoft.IO.Redist.csproj]
~\maintenance-packages\eng\servicingValidation.targets(34,5): error : 'System.Net.WebSockets.WebSocketProtocol' did not set 'IsPackable' to 'true', but one or more of its dependencies did: 'System.Buffers;System.Numerics.Vectors;System.Runtime.CompilerServices.Unsafe'. Please ship 'System.Net.WebSockets.WebSocketProtocol' by setting 'IsPackable' to 'true' and incrementing its servicing version(s). [~\maintenance-packages\src\System.Net.WebSockets.WebSocketProtocol\src\System.Net.WebSockets.WebSocketProtocol.csproj]

    0 Warning(s)
    4 Error(s)

…itive service packages and then another target that consumes those transitive service packages and print an error if the current project is not set to ship but its dependencies are.
…jects that have IsPackable set to FALSE and are source projects only.
…odified TargetPathWithTargetPlatformMoniker so that that the IsPackable property is appended, as it is needed in the newly added targets.
…others, and disable building the packages that depend on them.
@carlossanlop carlossanlop marked this pull request as ready for review March 6, 2025 18:17
@carlossanlop carlossanlop self-assigned this Mar 6, 2025
@carlossanlop carlossanlop enabled auto-merge (squash) March 6, 2025 18:45
@carlossanlop carlossanlop merged commit db45a45 into dotnet:main Mar 6, 2025
5 checks passed
@carlossanlop carlossanlop deleted the BuildTarget branch March 6, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create a build target that enforces the update of assemblies that depend on others that are getting updated

3 participants