Reformat d2go_dataset_mapper to break circular dependency
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/225 *This diff is part of a stack which has the goal of "buckifying" D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)Go core and enabling autodeps and other tooling. The last diff in the stack introduces the TARGETS. The diffs earlier in the stack are resolving circular dependencies and other issues which prevent the buckification from occurring.* The overriding pattern applied in d2go_dataset_mapper, with the d2go_dataset_mapper_impl and d2go_dataset_mapper_impl_fb makes it possible that internal users get the _fb behaviour and external users the regular one, with the same import. But, this makes it necessary to put both files in the same dependency. This causes a circular dependency. In general, one reasonable assumption is that fb-only dependencies can import oss dependencies but not vice versa. In the current setup, grouping both _impl files in a buck target makes that buck target contain both fb and oss code, and depend on both. This is causing circular buck dependency issues. To fix this, while keeping the transparent import behavior, the following changes are done: 1. The implementation file is moved to a directory under .fb. It will have it's own target. 2. The non-fb version is renamed to DualInputDatasetMapper, as per Yanghan's suggestion. This simplifies the change, since it seems the fb version's behavior is not used atm. 3. d2go_dataset_mapper is moved to have the implementation itself Reviewed By: tglik Differential Revision: D35930993 fbshipit-source-id: ac57337d221df24f53e360d5dcb38ffa4164fef5
Showing
Please register or sign in to comment