title: How to write a genrule to apply a patch
body: <p>I'm trying to write a genrule in bazel BUILD for one of the packages. The purpose is that rule must apply one patch on the package source. I've written it as below -</p>
  
  <pre><code>genrule(
      name = "patching_rule",
      srcs = ["Package"],
      outs = ["test_output.txt"],
      cmd = "cd $(location Package); patch -p0 &lt; /tmp/mypatch.patch",
  )
  </code></pre>
  
  <p>Reading the bazel BUILD document, I came to know that "outs" is a required field. However, my patch is surely going to generate nothing. It's just 2-3 lines of code change that it will make in Package source code. I can't keep "outs" empty, also unable to add a dummy file there. Could anyone please help me how to fix this problem?</p>
  
  <p>Thanks in advance,
  Nishidha</p>