Skip to content

Conversation

@nasadigital
Copy link
Contributor

@nasadigital nasadigital commented Apr 8, 2020

Addresses #4316.
Adds a parameter --direct-debugging to the CLI which enables direct debugging by default.
When the parameter is parsed it supplies the property UseDirectDebugging=true to msbuild.
The property defines the USE_DIRECT_DEBUGGING macro for C++ or constant for C#.

Microsoft Reviewers: Open in CodeFlow

@nasadigital nasadigital requested a review from a team as a code owner April 8, 2020 16:33
@acoates-ms
Copy link
Contributor

The code that uses USE_DIRECT_DEBUGGING is app specific. While it is part of the current default template there is no guarantee that the apps code will include that code, or use it in the same way.

I worry that adding an option like this would be confusing as there are plenty of cases where it wouldn't work. I also worry some about what it does to build caching. How will we know we need to rebuild the binaries.

This isn't an option that is provided to the CLI for android or iOS either.

Copy link
Member

@asklar asklar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls move into the instance settings instead if this is something that can be always enabled in debug builds

@ghost ghost added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Apr 9, 2020
@nasadigital
Copy link
Contributor Author

Thank you for your feedback @acoates-ms!

The code that uses USE_DIRECT_DEBUGGING is app specific. While it is part of the current default template there is no guarantee that the apps code will include that code, or use it in the same way.
I worry that adding an option like this would be confusing as there are plenty of cases where it wouldn't work.

That is correct. Is there a way to set InstanceSettings outside of the app?

I also worry some about what it does to build caching. How will we know we need to rebuild the binaries.

As you mention, my understanding is that you would need to rebuild if you want to toggle the defaults. I was think of maybe using environment variables to switch this without needing to rebuild. What do you think? Are there any more fitting approaches?

This isn't an option that is provided to the CLI for android or iOS either.

Thanks for clarifying. Are you familiar with how would one go about using direct debugging in android or iOS?

@ghost ghost removed the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Apr 9, 2020
@acoates-ms
Copy link
Contributor

The story for direct debugging in Android / iOS is still being worked out. (Its not easy right now).

But for now its similar to enabling various other dev features and involves a code change
https://github.com/react-native-community/rn-diff-purge/blob/b7d5b8decbe2dc4a5159c01b423e2cf0c9f922f9/RnDiffApp/android/app/src/main/java/com/rndiffapp/MainApplication.java#L19

@ghost ghost added the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Apr 16, 2020
@ghost ghost removed the Needs: Author Feedback The issue/PR needs activity from its author (label drives bot activity) label Apr 16, 2020
@asklar
Copy link
Member

asklar commented Apr 17, 2020

  default: 'x86',

just realized that we don't mention ARM64 but I believe Jon added support for ARM64, consider adding that :)


Refers to: vnext/local-cli/runWindows/runWindows.js:147 in f48cb5b. [](commit_id = f48cb5b, deletion_comment = False)

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

ghost commented Apr 17, 2020

Hello @nasadigital!

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.

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.

@ghost ghost merged commit c1a2140 into microsoft:master Apr 17, 2020
asklar pushed a commit to asklar/react-native-windows that referenced this pull request Apr 19, 2020
* Allow enabling of direct debugging through the CLI.

* Use more accurate declartions.

* Enable direct debugging through command line arguments instead of defines.

* Addres PR feedback.

* Use same delimiter as when running through the react native CLI.

* Change delimiter back to whitespace.

* Address PR feedback.
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.

4 participants