diff options
-rw-r--r-- | third_party/gpus/cuda_configure.bzl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/gpus/cuda_configure.bzl b/third_party/gpus/cuda_configure.bzl index 0fef94cf9c..6994db0a04 100644 --- a/third_party/gpus/cuda_configure.bzl +++ b/third_party/gpus/cuda_configure.bzl @@ -785,8 +785,10 @@ def _symlink_genrule_for_dir(repository_ctx, src_dir, dest_dir, genrule_name, outs = [] for i in range(len(dest_files)): if dest_files[i] != "": - command.append('ln -s ' + src_files[i] + ' $(@D)/' + - dest_dir + dest_files[i]) + # If we have only one file to link we do not want to use the dest_dir, as + # $(@D) will include the full path to the file. + dest = ' $(@D)/' + dest_dir + dest_files[i] if len(dest_files) != 1 else ' $(@D)' + dest_files[i] + command.append('ln -s ' + src_files[i] + dest) outs.append(' "' + dest_dir + dest_files[i] + '",') genrule = _genrule(src_dir, genrule_name, " && ".join(command), "\n".join(outs)) |