Commit Graph

13 Commits

Author SHA1 Message Date
Joshua Gross d291a7efdd Allow disabling RTTI/exceptions for android builds; disable by default on Android
Summary:
For fbandroid builds only, disable RTTI and exceptions by default.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D31632757

fbshipit-source-id: cfe0e43486df19fcaacc2b5b818b9d00ec2d427f
2021-10-19 17:17:30 -07:00
Joshua Gross b60e229d7f Remove compiler_flags from BUCK modules
Summary:
Nearly all of these are identical and these compiler_flags are now centralized in rn_defs.bzl. This should have NO CHANGE on build configuration, the flags have just moved for now.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D31631766

fbshipit-source-id: be40ebeb70ae52b7ded07ca08c4a29f10a0ed925
2021-10-14 15:34:29 -07:00
Andrew Coates 4d87d8c6b2 Fix various c++ warnings (#31399)
Summary:
react-native-windows runs with a more strict set of warnings as errors.  This fixes a bunch of warnings being hit while compiling core react-native code as part of react-native-windows.  In particular warnings about mismatched signed/unsigned comparisons, lossy conversions, and variable names that conflict with names in outer scopes (yoga has a global for `leading` and `trailing` that conflicts with some local variable names)

## Changelog

[Internal] [Fixed] - Fix various C++ warnings

Pull Request resolved: https://github.com/facebook/react-native/pull/31399

Test Plan: I've run these changes in react-native-windows. -- Shouldn't have any functionality difference.

Reviewed By: sammy-SC

Differential Revision: D28290188

Pulled By: rozele

fbshipit-source-id: 2f7cf87f58d73a3f43510ac888dbcb9ab177d134
2021-05-12 12:35:33 -07:00
Samuel Susla 9ef995a14a Enable C++ 17 in React Native
Summary:
Changelog: [Internal] enable support for C++ 17.

C++ 17 in React Native targets.

Short and comprehensive list of C++ features:
https://github.com/AnthonyCalandra/modern-cpp-features#c17-language-features

Reviewed By: JoshuaGross

Differential Revision: D27431145

fbshipit-source-id: e8da6fe9d70e9b7343a8caec21cdbeb043478575
2021-04-01 04:50:59 -07:00
Joshua Gross 2d51f4b499 Define RN_SHADOW_TREE_INTROSPECT and enable shadow tree assertions on Android
Summary:
These assertions will already run by default on iOS, macOS, Windows, etc, all OSes except Android because of a longstanding Buck+Android NDEBUG issue.

Align platforms by using REACT_NATIVE_DEBUG flag.

Only impacts debug/dev builds.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D26561977

fbshipit-source-id: 324875c48b2a138e8ab55630c3e2ec43c2f768c3
2021-02-19 20:52:51 -08:00
Joshua Gross 16cf45ac3d Migrate Differentiator and RawPropsParser to rn_assert
Summary:
This will allow these asserts to crash on Android debug builds.

We will migrate more sites as we confirm this is stable through testing.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26409354

fbshipit-source-id: fb35cd8de29890f7c2b761435eaa02de377bdd1e
2021-02-17 18:00:47 -08:00
Joshua Gross ec4833f06d Introduce RN_DEBUG flag and rn_assert for Cxx
Summary:
BUCK always defines NDEBUG on Android builds. This is a longstanding issue and it's tricky to work around.

Previous attempts to fix this within React Native were difficult because disabling NDEBUG caused lots of issues that were difficult to track down.

Instead, I am (1) introducing a new RN_DEBUG flag that can be used cross-platform, (2) whenever NDEBUG is *not* enabled, RN_DEBUG will automatically be defined, (3) enables debug-only code to be compiled on Android, (4) enables us to selectively, slowly migrate `assert` to `rn_assert` in a way that doesn't impact non-Android platforms, but allows us to maintain stability of Android debug builds.

Actually enabling the RN_DEBUG flag in debug builds is done in FB-internal code. I assume the NDEBUG issue is not a problem when compiling in open-source without BUCK.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26409355

fbshipit-source-id: 285b8073bba3756834925727bfa28d3c6bc06335
2021-02-17 18:00:47 -08:00
Joshua Gross fb1833eede Consolidate various debug-only flags into flags.h (#30988)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30988

We have a bunch of flags scattered throughout the codebase with poor hygiene and commenting. Consolidate.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26392518

fbshipit-source-id: 2823de123a5009d6b8c358e8a3f451b9fa0e05b7
2021-02-17 18:00:47 -08:00
Ramanpreet Nara ab21226457 Migrate away from "@fbsource//tools/build_defs/apple:flag_defs.bzl"
Summary:
We still have usages of "fbsource//tools/build_defs/apple:flag_defs.bzl" in react-native-github. But this should get us closer towards not using the fbsource cell. Hopefully, this is enough to unbreak the  test_docker CircleCI build.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D26289304

fbshipit-source-id: 1c6464bb84df4f82f8a797321a73a1ed324e319a
2021-02-08 16:04:51 -08:00
Andres Suarez 0f4f917663 Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861683

fbshipit-source-id: 616afca13ae64c76421053ce49286035e0687e36
2021-01-09 22:11:00 -08:00
Joshua Gross dd05ec3801 StubViewTree: add additional verbose logging, make slightly more resilient
Summary:
1. When testing major changes to the differ, it can be useful to have more verbose logging.
2. On Android, since asserts don't fire yet, I log which asserts are failing.

Should have no impact on any builds unless you manually set the macro here, and it will have no impact on production builds regardless.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23257859

fbshipit-source-id: 94a8e74ece8023064de0f2203db6074975f8f1f0
2020-08-24 13:09:12 -07:00
David Vacca 8e996487e1 Create Android MK file for debug module
Summary:
This diff creates the Android.mk file for the fabric debug module

This is necessary to enable fabric in RN OSS

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D22908220

fbshipit-source-id: f970fa1d8534a6043f60f362740bfc3e5199b511
2020-08-06 00:09:11 -07:00
David Vacca 3093010ea5 move fabric to ReactCommon/react/renderer
Summary:
This diff moves fabric C++ code from ReactCommon/fabric to ReactCommon/react/renderer
As part of this diff I also refactored components, codegen and callsites on CatalystApp, FB4A and venice

Script: P137350694

changelog: [internal] internal refactor

Reviewed By: fkgozali

Differential Revision: D22852139

fbshipit-source-id: f85310ba858b6afd81abfd9cbe6d70b28eca7415
2020-07-31 13:34:29 -07:00