-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix duplicate runtime pack crash in dotnet test device deployment
#55502
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -40,7 +40,8 @@ | |||||||||||||
| </ItemGroup> | ||||||||||||||
| </Target> | ||||||||||||||
|
|
||||||||||||||
| <Target Name="DeployToDevice"> | ||||||||||||||
| <!-- ResolveFrameworkReferences mimics Android --> | ||||||||||||||
| <Target Name="DeployToDevice" DependsOnTargets="ResolveFrameworkReferences"> | ||||||||||||||
| <Message Text="DeployToDevice: Deployed $(TargetFramework) to device $(Device) with RuntimeIdentifier $(RuntimeIdentifier)" /> | ||||||||||||||
| <Message Text="DeployToDevice: RuntimeEnvironmentVariable=@(RuntimeEnvironmentVariable->'%(Identity)=%(Value)', ', ')" /> | ||||||||||||||
| <Error Condition="'$(FailDeployToDevice)' == 'true'" Text="DeployToDevice failed as requested." /> | ||||||||||||||
|
|
@@ -72,5 +73,10 @@ | |||||||||||||
| Condition="'@(RuntimeEnvironmentVariable)' != ''"> | ||||||||||||||
| <Message Text="ComputeRunArguments: RuntimeEnvironmentVariable=@(RuntimeEnvironmentVariable->'%(Identity)=%(Value)', ', ')" /> | ||||||||||||||
| </Target> | ||||||||||||||
| <!-- Unlike dotnet run, dotnet test builds DeployToDevice first and ComputeRunArguments second, | ||||||||||||||
| so ResolveFrameworkReferences has to run in the second build too to mimic Android. --> | ||||||||||||||
| <Target Name="_ComputeRunArgumentsDependsOnResolveFrameworkReferences" | ||||||||||||||
| BeforeTargets="ComputeRunArguments" | ||||||||||||||
| DependsOnTargets="ResolveFrameworkReferences" /> | ||||||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This hook is what carries the whole regression guard, and nothing asserts that it exists. If someone later tidies up this empty target,
AssertTargetInBinlog(binlogPath, "ResolveFrameworkReferences", targets =>
targets.Should().HaveCount(2, "ResolveFrameworkReferences must run in both the DeployToDevice build and the ComputeRunArguments build"));To be precise about what that buys, since it's easy to overclaim: it guards the asset (deleting this hook takes the count 2 → 1). It does not discriminate fixed CLI from unfixed — before the fix the count is also 2, the second one just fails. Reverting
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
So, if someone deleted this target, tests would start failing. I think that is good, and the comment should help someone understand why it exists.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked this and I think it's the other way around: deleting that target makes the tests pass, not fail. The PR description already measured exactly that configuration:
Row 1 is the "someone deleted the target" state, and it's green even against the unfixed CLI. It's green against the fixed CLI too, so the deletion is invisible in both directions. That follows from the mechanism described in the PR body: the SDK's And nothing else pins it: So the comment does its job of explaining why the target is there, but there's no failing signal if it goes away — which is why I'd still like a cheap assertion on the target count. |
||||||||||||||
|
|
||||||||||||||
| </Project> | ||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.