Skip to content

Conversation

@NickGerleman
Copy link
Contributor

@NickGerleman NickGerleman commented Apr 3, 2020

#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

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.
@NickGerleman NickGerleman requested a review from a team as a code owner April 3, 2020 23:31
$(FollyDir);
$(ReactNativeWindowsDir)\ReactWindowsCore\pch;
$(ReactNativeWindowsDir)\ReactWindowsCore\tracing;
$(ProjectDir);
Copy link
Contributor Author

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" />
Copy link
Contributor

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?

Copy link
Contributor Author

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" />
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@NickGerleman
Copy link
Contributor Author

@msftbot merge if vmoroz or acoates-ms sign off

@NickGerleman NickGerleman added the AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity) label Apr 4, 2020
@ghost
Copy link

ghost commented Apr 4, 2020

Hello @NickGerleman!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

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) and give me an instruction to get started! Learn more here.

@NickGerleman
Copy link
Contributor Author

@msftbot require vmoroz or acoates-ms to sign off

@ghost
Copy link

ghost commented Apr 4, 2020

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.

@NickGerleman
Copy link
Contributor Author

@msftbot require sign off from vmoroz or acoates-ms before merging

@ghost
Copy link

ghost commented Apr 4, 2020

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.

@NickGerleman
Copy link
Contributor Author

@msftbot require two sign offs

@ghost
Copy link

ghost commented Apr 4, 2020

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:

  • I'll only merge this pull request if it has at least 2 approvals

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".

@ghost ghost merged commit 561a815 into microsoft:master Apr 4, 2020
NickGerleman added a commit to NickGerleman/react-native-windows that referenced this pull request Apr 7, 2020
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AutoMerge Causes a PR to be automatically merged once all requirements are passed (label drives bot activity)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants