This is because $ModuleOnly$ categories are still in the module's public namespace and public cache directory. Instead, there should be a private namespace for public $ModuleOnly$ headers. The current solution for visibility is to filter out categories from .0rp sources with $ModuleOnly$ from deps, which fails to control visibility in C++ sources.
One complication is that in testing mode (-t) the module being tested is loaded and the tests have access to $ModuleOnly$. This means that there needs to be a record of the extra namespace in compile-metadata. One solution is to split subdirs into public_subdirs and private_subdirs.
Note that the test added by 041495431b6d53d7241307c1b753c3382068dd9f still needs to be executed by cli-tests.sh, but only after the visibility it tests is fixed.
This is because
$ModuleOnly$
categories are still in the module's public namespace and public cache directory. Instead, there should be a private namespace for public$ModuleOnly$
headers. The current solution for visibility is to filter out categories from.0rp
sources with$ModuleOnly$
from deps, which fails to control visibility in C++ sources.One complication is that in testing mode (
-t
) the module being tested is loaded and the tests have access to$ModuleOnly$
. This means that there needs to be a record of the extra namespace incompile-metadata
. One solution is to splitsubdirs
intopublic_subdirs
andprivate_subdirs
.