bazelbuild / rules_pkg

Bazel rules for creating packages of many types (zip, tar, deb, rpm, ...)
Apache License 2.0
221 stars 174 forks source link

fix: use appropriate entry type for runfiles that are directories #830

Open dieortin opened 6 months ago

dieortin commented 6 months ago

This fixes a regression at some point from 0.9.1 to 0.10.1, which caused pkg_tar to fail when include_runfiles was true and some of the sources had data dependencies that were directories.

The code that handles the include_runfiles attribute was always assigning ENTRY_IS_FILE as entry type of runfiles. This caused an error in the python code when packaging, as it encountered a directory in an unexpected place.

The fix is just considering ENTRY_IS_TREE types, in the same way as it is done in _process_pkg_files.

helly25 commented 2 months ago

As a side note: While this is better, it does not fully solve the problem. When the directory is linked, then is_directory will be false since links are files.