bazel-differ
bazel-differ copied to clipboard
`Error: : read <path>: is a directory` on directories
The use of diff_test (and presumably other rules that accept a directory as an input) trigger an error in generate-hashes.
Here is a minimal repro: https://github.com/jfirebaugh/bazel-differ-test
Running bazel run @multitool//tools/bazel-differ -- generate-hashes --workspacePath=$PWD hashes.json in that repository produces:
bazel run @multitool//tools/bazel-differ -- generate-hashes --workspacePath=$PWD hashes.json
INFO: Analyzed target @@rules_multitool++multitool+multitool//tools/bazel-differ:bazel-differ (0 packages loaded, 0 targets configured).
INFO: Found 1 target...
Target @@rules_multitool++multitool+multitool//tools/bazel-differ:bazel-differ up-to-date:
bazel-bin/external/rules_multitool++multitool+multitool/tools/bazel-differ/bazel-differ
INFO: Elapsed time: 0.071s, Critical Path: 0.00s
INFO: 1 process: 1 internal.
INFO: Build completed successfully, 1 total action
INFO: Running command line: bazel-bin/external/rules_multitool++multitool+multitool/tools/bazel-differ/bazel-differ <args omitted>
Error: : read /Users/john/figma/bazel-differ-test/a: is a directory
This does not happen with bazel-diff. I think it ignores such inputs. target-determinator also has logic to ignore them, with a comment that looks helpful: https://github.com/bazel-contrib/target-determinator/blob/d9f17b3433292e2470beb11b7b98d829402debaf/pkg/hash_cache.go#L470-L477