Bazel genrule Check if location expression expands to no files

666 views Asked by At

I am writing a genrule in Bazel. I have a file withing a folder that may or may not exist. I want to reference it if it does but ignore it if it does not. How do i do an conditional check in the cmd part of the genrule before doing $(location my_file_that_may_or_may_not_exist)?

When the file does not exist I get $(location) expression expands to no files error. This is expected so I want to avoid it

0

There are 0 answers