-
Notifications
You must be signed in to change notification settings - Fork 612
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disallow python patch of unsafe patch
Summary: In ICSP, unsafe patch is still used in IDL: https://fburl.com/code/29nc4mqx Currently in order to use python patch, we will need to enable python patch for those unsafe patch thrift files as well. .e.g, ``` include "path/to/gen_patch_foo.thrift" struct Bar { 1: gen_patch_foo fooPatch; 2: string msg; } ``` In order to enable python patch on Bar, we need to enable it on "path/to/gen_patch_foo.thrift" as well. ``` thrift_patch_library( gen_patch_python_api_experimental = True, ... ) ``` This has two problems 1. Users are able to create patch of unsafe patch, which is a confusion concept. 2. It makes python patch harder to enable, since we need to enable it for all dependents unsafe patch as well. To fix the two issues above, this diff will skip generating python field patch for fields that contain unsafe patch. e.g., after this diff, we will skip `fooPatch` field (as if it doesn't exist) when generating `BarPatch`. Differential Revision: D67880408 fbshipit-source-id: de047e18d4caa164ae3a4e24e1b3baa25fbc3284
- Loading branch information
1 parent
f318d46
commit f3e92c9
Showing
4 changed files
with
44 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters