Correct $(IntermediateDepsFilePath) logic#11527
Conversation
- restore previous behaviour of this target in the non-single-file case - ensure `$(PublishDepsFilePath)` exists after `GeneratePublishDependencyFile` target runs
| <PublishDepsFilePath Condition=" '$(PublishDepsFilePath)' == '' And '$(PublishSingleFile)' != 'true'">$(PublishDir)$(ProjectDepsFileName)</PublishDepsFilePath> | ||
| <IntermediateDepsFilePath Condition=" '$(PublishDepsFilePath)' == '' And '$(PublishSingleFile)' != 'true'">$(PublishDir)$(ProjectDepsFileName)</IntermediateDepsFilePath> | ||
| <IntermediateDepsFilePath Condition=" '$(IntermediateDepsFilePath)' == ''">$(IntermediateOutputPath)$(ProjectDepsFileName)</IntermediateDepsFilePath > | ||
| <PublishDepsFilePath Condition=" '$(PublishDepsFilePath)' == '' And '$(PublishSingleFile)' != 'true'">$(IntermediateDepsFilePath)</PublishDepsFilePath> |
There was a problem hiding this comment.
If the deps.json file is directly written to the publish directory, it should be removed from ResolvedFileToPublish here in the non-single-file case.
There was a problem hiding this comment.
However, I'm not sure its a good idea to write to the publish directory -- before CopyFilesToPublishDirectory has run -- because something may be introduced into ResolvedFileToPublish that overwrites this file. Isn't it?
CC: @dsplaisted
swaroop-sridhar
left a comment
There was a problem hiding this comment.
@dougbu, in this case, I think it is better for InjectRequestHandlerOnPublish to run after CopyFilesToPublishDirectory which will copy the deps file from IntermediateDepsFilePath to PublishDepsFilePath.
If this cannot change due to legacy reasons, then please apply the change I've suggested here.
Won't external developers get tripped up by this breaking change too? For the non-single-file case, running after |
|
Oops, whoever I accidentally tagged instead of @dsplaisted, my apologies. |
- not needed when value is the same as `$(PublishDepsFilePath)`
|
Hmm, what's up w/ the pipeline failure? Did a credential just expire? |
|
/azp run dotnet-sdk-public-ci |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Oh good, credential problem went away. |
|
🆙📅 to take @swaroop-sridhar's suggestion in case we decide to fix the latest break. Otherwise I'll use |
|
@swaroop-sridhar should I merge this change after PR validation completes or wait for word from @dsplaisted on his preferences? |
|
So we're now hitting a different break than we fixed in #11462, right? The ASP.NET targets:
I think that means to minimize breakage, we would have to:
It's not feasible for us to make that true for single-file apps, so existing targets could still get broken in that case. Is that all correct? Is that what these changes are trying to achieve? Is it possible to update the ASP.NET targets to work with the current logic? |
| @@ -987,10 +987,11 @@ Copyright (c) .NET Foundation. All rights reserved. | |||
| <PropertyGroup> | |||
| <!-- IntermediateDepsFilePath is the location where the deps.json file is originally created | |||
| PublishDepsFilePath is the location where the deps.json resides when published | |||
There was a problem hiding this comment.
Can you please update the comments here to say:
In the single-file case, we write deps file to intermediate dir, and it is bundled into the single-file app.
In the non-single-file case, we write deps file directly in the publish directory due to legacy reasons.
Yes this is accurate. As @dougbu has mentioned, it is possible to fix asp.net targets by using This change is trying to preserve legacy behavior for asp.net and other customers who may use these targets/properties not publishing for non-single-file. |
I'll do this if we decide to take this fix. It sounds like @dsplaisted is unconvinced😸 |
|
I'm unconvinced in the sense that I'm not really sure what we should do. I think @marcpopMSFT and/or @KathleenDollard were looking at having a process where we at least document breaking changes like this. So, I think we should fix ASP.NET to work with the current logic to unblock ourselves, and have a discussion about what we should do with this break. |
|
🆗 I'll leave this open rather than fixing the comment or the busted tests ( |
|
Shoot. I wasn't thinking things through. Using |
I think leaving behind an "incorrect" .deps file in obj folderis not a major concern. It is actually typical of post-processing tools to modify outputs between obj and bin directories. For example, R2R takes files in |
I understand that reasoning though the breaking change part of it and the utility of the new obj/ file still feels Just Wrong:tm: 😉 |
|
/fyi the |
|
@dsplaisted @swaroop-sridhar @marcpopMSFT @KathleenDollard have you had a chance to discuss whether to revert this breaking change or documented it? |
|
/ping ❔ |
|
I recommend that we close this PR, and document the change in |
|
@swaroop-sridhar nobody goes looking in the regular docs for notifications of breaking changes. Suggest you need an announcement too. |
$(PublishDepsFilePath)exists afterGeneratePublishDependencyFiletarget runs