Exporting directories gives us less control over what is used as an input of a rule and can potentially introduce rule key divergence. The risk of encountering this problem is higher in local development (some editors can leave temporary or backup files next to the original files) and also with some tools that use temporary files (like code generators.)
The general recommendation is to use glob to declare inputs from a directory, zip_file to pack multiple files in one file or genrule without a directory as an output.
3a3f7e0660f70335f08c1e7b9cfe2d546e860a0d introduced an option to disable support. This option can be used to find all violations and refactor them.
We plan to remove this functionality in future versions.
We do this currently in a few places. Thanks for the heads up
e1dd89b810b91a727041a9d32ff9fdae3df59ef9 marked export_file as deprecated. It's recommended to use filegroup instead (added in 984e7903212c23d703f3dd2fa6a0c6f8543304de).
Removed all usages of export_file in our codebase that used dirs. Okbuck never used dirs in the generated buck files.