When building debuginfo packages, find-debuginfo is called by rpmbuild. To include the relevant source files, they will need to be accessible to find-debuginfo via rpmbuild.
There are a number of other pieces required for an end-to-end solution with debuginfo, but they're outside the scope of rules_pkg, e.g.
- customized find-debuginfo that can run inside bazel
- special _find_debuginfo_opts used to locate source files
- figuring out which source files to pass to pkg_rpm() in the first place.
The key, though, is that pkg_rpm() accepts extra data in the first place.