Open hzeller opened 4 years ago
So I implemented this now in the project in question by installing shell-scripts that call the original binary.
It might still be worthwhile exploring if the semantic of an 'alias' would be something good to implement, or if this is too specific. So I am fine either way.
An alias rule https://docs.bazel.build/versions/3.2.0/be/general.html#alias gives a different name to an existing thing.
I'd like to use this in verible to phase out legacy binary names and move them to new names (to implement https://github.com/google/verible/issues/169 ).
But simply declaring this in bazel:
and then using the
old_binary_name
alias name in anbazel_rules_install
installer()
target will not install anything (but will also not complain); I suppose because the alias is actually just an internal name withinbazel
, but actually never shows up as tangible object.For installation: My proposal would be to interpret the
alias
information and create either a symbolic link or a copy, depending on the installation platform.(Of course, I could implement the legacy-names with a little shell-script which then exec's the new location etc., but it would be less platform agnostic. Using 'alias' is the exact abstraction that conveys the intent much better and the install target can use the additional context to do the right thing on the target platform - symbolic link or copy)