diff options
author | Fabian Meumertzheim <meumertzheim@code-intelligence.com> | 2021-05-25 11:00:15 +0200 |
---|---|---|
committer | Fabian Meumertzheim <fabian@meumertzhe.im> | 2021-05-25 11:10:37 +0200 |
commit | 1a823f1367a97d950afbff766f5c54e6c33f36c4 (patch) | |
tree | 49e61ffff1ac283ea6a8216cd8c1942c89d4677a /bazel | |
parent | 8dda22e97a320ff9767cde0e8c6f3318127ae237 (diff) | |
download | jazzer-api-1a823f1367a97d950afbff766f5c54e6c33f36c4.tar.gz |
Fix //:jazzer not finding the agent
The cc_17_binary rule should not remove all runfiles from the original
target, but only the executable for the original target.
Diffstat (limited to 'bazel')
-rw-r--r-- | bazel/cc.bzl | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/bazel/cc.bzl b/bazel/cc.bzl index 202dbfcb..9cb465ed 100644 --- a/bazel/cc.bzl +++ b/bazel/cc.bzl @@ -29,12 +29,21 @@ _add_cxxopt_std_17 = transition( def _cc_17_binary_impl(ctx): output_file = ctx.actions.declare_file(ctx.label.name) + + # Do not include the original target in the runfiles of the target built with the transition. + all_runfiles = ctx.attr.binary[0][DefaultInfo].default_runfiles.files.to_list() + filtered_runfiles = ctx.runfiles([runfile for runfile in all_runfiles if runfile != ctx.executable.binary]) ctx.actions.symlink( output = output_file, target_file = ctx.executable.binary, is_executable = True, ) - return [DefaultInfo(executable = output_file)] + return [ + DefaultInfo( + executable = output_file, + runfiles = filtered_runfiles, + ), + ] _cc_17_binary = rule( implementation = _cc_17_binary_impl, |