bazel-skylib
                                
                                 bazel-skylib copied to clipboard
                                
                                    bazel-skylib copied to clipboard
                            
                            
                            
                        run_binary rule should support $(execpath ...) etc.
Right now run_binary only supports $(location …), cf. https://github.com/bazelbuild/bazel-skylib/blob/5bfcb1a684550626ce138fe0fe8f5f702b3764c3/rules/run_binary.bzl#L37.  It should also support $(execpath …) and possible (if it makes sense) $(rootpath …) and $(rlocationpath …). (Same with the pluralized forms, of course.)
I've run into the same, workaround is crude - either use env/args or defines in my cc_binary tool to get the rlocationpath and the tool is no longer generic (e.g. it's tied to specific file). As if run_binary needs support for data (maybe)?
Also just ran into this myself.
AFAICT, we could simply call ctx.expand_location unconditionally, and get support for all the location callbacks it supports (the ones listed in https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/analysis/LocationExpander.java#L383)