-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Clean Up Directory Logic to Fix Publish #4496
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
Conversation
microsoft#4469 reordered build logic to define ReactNativeWindowsDir before it was seemingly used. This actually made it so we no longer correctly put patched react native sources in the right intermediate build output directory, since we don't define IntDir before including directory logic. Seemingly the previous documented assumption was that we should define ReactNativeWindowsDir before including ReactPackageDirectories.props. This is oddd/error prone. This change combines logic so we can correctly interleave dependencies. It has the side effect of forcing anything including ReactPackageDirectories to include out intermediate output dir. This should only affect ReactUwp projects, which we will no longer be supporting for 0.62. We can't actually test that this fixes publish because of microsoft#3889, but this should theoretically fix the issue. Tested locally that we can build Playground.
| $(FollyDir); | ||
| $(ReactNativeWindowsDir)\ReactWindowsCore\pch; | ||
| $(ReactNativeWindowsDir)\ReactWindowsCore\tracing; | ||
| $(ProjectDir); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not directly related to the PR, but these shouldn't be here. ProjectDir will already be included, and the latter two allow consuming from build output while building which is dangerous and not really that useful.
| <ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir> | ||
| </PropertyGroup> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactPackageDirectories.props" /> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactDirectories.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already included in vnext\Directory.Build.props?
I see this project lives outside vnext. Can you confirm it's explicitly included because of this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Playground (non-win32) was able to correctly build locally, meaning it was able to pick up the properties. It it wasn't included, it would fail pretty hard.
| <ReactNativeWindowsDir Condition="'$(ReactNativeWindowsDir)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'node_modules\react-native-windows\package.json'))\node_modules\react-native-windows\</ReactNativeWindowsDir> | ||
| </PropertyGroup> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactPackageDirectories.props" /> | ||
| <Import Project="$(ReactNativeWindowsDir)\PropertySheets\ReactDirectories.props" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm assuming this is the same as Playground-win32.vcxproj.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep. Once these are converted from ReactUwp to Microsoft.ReactNative we can keep everything tucked into vnext as well.
|
@msftbot merge if vmoroz or acoates-ms sign off |
|
Hello @NickGerleman! Because this pull request has the Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 60 minutes, a condition that will be fulfilled in about 11 minutes. No worries though, I will be back when the time is right! 😉 p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
@msftbot require vmoroz or acoates-ms to sign off |
|
Hello @NickGerleman! I think you told me that you expect a certain minimum number of approvals before I perform the merge, but I am not confident that I have understood you correctly. Please try rephrasing your instruction to me. |
|
@msftbot require sign off from vmoroz or acoates-ms before merging |
|
Hello @NickGerleman! I think you told me that you expect a certain minimum number of approvals before I perform the merge, but I am not confident that I have understood you correctly. Please try rephrasing your instruction to me. |
|
@msftbot require two sign offs |
|
Hello @NickGerleman! Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:
If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you". |
This reverts commit 561a815.
#4469 reordered build logic to define ReactNativeWindowsDir before it was seemingly used. This actually made it so we no longer correctly put patched react native sources in the right intermediate build output directory, since we don't define IntDir before including directory logic.
Seemingly the previous documented assumption was that we should define ReactNativeWindowsDir before including ReactPackageDirectories.props. This is oddd/error prone. This change combines logic so we can correctly interleave dependencies. It has the side effect of forcing anything including ReactPackageDirectories to include out intermediate output dir. This should only affect ReactUwp projects, which we will no longer be supporting for 0.62.
We can't actually test that this fixes publish because of #3889, but this should theoretically fix the issue.
Microsoft Reviewers: Open in CodeFlow