Fix error handling in repo patching mechanism
Fix error handling in repo patching mechanism

If a patch fails to apply, we attempt to print a nice error message with
the patch command line. But some arguments to the command line may be
Bazel `path` structs rather than literal strings, which causes our error
handling to choke.

Tested:
Modify `third_party/protobuf/protobuf.patch` to make the patch invalid,
then run `bazel build @com_google_protobuf//:protobuf_headers`. This
should fail, but should print a nice failure message, including the
proper command line. Prior to this commit, it printed an internal error
about ?sequence element must be a string (got 'path')?. See:
<https://github.com/tensorflow/tensorboard/issues/2709>
PiperOrigin-RevId: 272314706

freedomtan/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,DavidNorman/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,DavidNorman/tensorflow,xzturn/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,gautam1858/tensorflow,petewarden/tensorflow,freedomtan/tensorflow,xzturn/tensorflow,gunan/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_saved_model,DavidNorman/tensorflow,ppwwyyxx/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,xzturn/tensorflow,freedomtan/tensorflow,jhseu/tensorflow,arborh/tensorflow,adit-chandra/tensorflow,DavidNorman/tensorflow,annarev/tensorflow,gautam1858/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,adit-chandra/tensorflow,frreiss/tensorflow-fred,davidzchen/tensorflow,yongtang/tensorflow,arborh/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,sarvex/tensorflow,gautam1858/tensorflow,sarvex/tensorflow,renyi533/tensorflow,aldian/tensorflow,davidzchen/tensorflow,xzturn/tensorflow,cxxgtxy/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,davidzchen/tensorflow,gunan/tensorflow,karllessard/tensorflow,ppwwyyxx/tensorflow,arborh/tensorflow,karllessard/tensorflow,davidzchen/tensorflow,yongtang/tensorflow,ppwwyyxx/tensorflow,renyi533/tensorflow,renyi533/tensorflow,petewarden/tensorflow,paolodedios/tensorflow,aldian/tensorflow,adit-chandra/tensorflow,gautam1858/tensorflow,DavidNorman/tensorflow,arborh/tensorflow,gunan/tensorflow,petewarden/tensorflow,aam-at/tensorflow,arborh/tensorflow,Intel-tensorflow/tensorflow,ppwwyyxx/tensorflow,petewarden/tensorflow,aldian/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,adit-chandra/tensorflow,annarev/tensorflow,renyi533/tensorflow,gunan/tensorflow,cxxgtxy/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,gautam1858/tensorflow,jhseu/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,sarvex/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,DavidNorman/tensorflow,renyi533/tensorflow,arborh/tensorflow,jhseu/tensorflow,adit-chandra/tensorflow,ppwwyyxx/tensorflow,DavidNorman/tensorflow,renyi533/tensorflow,adit-chandra/tensorflow,karllessard/tensorflow,karllessard/tensorflow,freedomtan/tensorflow,jhseu/tensorflow,jhseu/tensorflow,Intel-Corporation/tensorflow,frreiss/tensorflow-fred,frreiss/tensorflow-fred,petewarden/tensorflow,xzturn/tensorflow,davidzchen/tensorflow,aldian/tensorflow,xzturn/tensorflow,arborh/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,aldian/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,ppwwyyxx/tensorflow,sarvex/tensorflow,paolodedios/tensorflow,annarev/tensorflow,arborh/tensorflow,annarev/tensorflow,gunan/tensorflow,renyi533/tensorflow,xzturn/tensorflow,karllessard/tensorflow,Intel-tensorflow/tensorflow,aldian/tensorflow,Intel-Corporation/tensorflow,yongtang/tensorflow,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,annarev/tensorflow,freedomtan/tensorflow,paolodedios/tensorflow,sarvex/tensorflow,ppwwyyxx/tensorflow,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,xzturn/tensorflow,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,aam-at/tensorflow,gunan/tensorflow,adit-chandra/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,DavidNorman/tensorflow,petewarden/tensorflow,xzturn/tensorflow,tensorflow/tensorflow,renyi533/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,freedomtan/tensorflow,aldian/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,petewarden/tensorflow,freedomtan/tensorflow,adit-chandra/tensorflow,xzturn/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,cxxgtxy/tensorflow,Intel-Corporation/tensorflow,Intel-Corporation/tensorflow,arborh/tensorflow,aam-at/tensorflow,petewarden/tensorflow,Intel-tensorflow/tensorflow,freedomtan/tensorflow,aldian/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,jhseu/tensorflow,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_saved_model,arborh/tensorflow,karllessard/tensorflow,frreiss/tensorflow-fred,freedomtan/tensorflow,petewarden/tensorflow,jhseu/tensorflow,jhseu/tensorflow,frreiss/tensorflow-fred,gunan/tensorflow,annarev/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,gunan/tensorflow,gautam1858/tensorflow,paolodedios/tensorflow,gautam1858/tensorflow,arborh/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,frreiss/tensorflow-fred,yongtang/tensorflow,Intel-tensorflow/tensorflow,cxxgtxy/tensorflow,Intel-tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow,davidzchen/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,karllessard/tensorflow,DavidNorman/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,annarev/tensorflow,gautam1858/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,renyi533/tensorflow,tensorflow/tensorflow-pywrap_saved_model,ppwwyyxx/tensorflow,frreiss/tensorflow-fred,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_saved_model,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,Intel-Corporation/tensorflow,cxxgtxy/tensorflow,gunan/tensorflow,paolodedios/tensorflow,DavidNorman/tensorflow,jhseu/tensorflow,aam-at/tensorflow,aam-at/tensorflow,xzturn/tensorflow,sarvex/tensorflow,tensorflow/tensorflow,gunan/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,davidzchen/tensorflow,Intel-tensorflow/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow-pywrap_saved_model,xzturn/tensorflow,arborh/tensorflow,aam-at/tensorflow,karllessard/tensorflow,paolodedios/tensorflow,ppwwyyxx/tensorflow,aam-at/tensorflow,DavidNorman/tensorflow,gautam1858/tensorflow,aam-at/tensorflow,ppwwyyxx/tensorflow,Intel-tensorflow/tensorflow,cxxgtxy/tensorflow,karllessard/tensorflow,ppwwyyxx/tensorflow,annarev/tensorflow,tensorflow/tensorflow,aam-at/tensorflow,Intel-tensorflow/tensorflow,jhseu/tensorflow,davidzchen/tensorflow,annarev/tensorflow,yongtang/tensorflow,freedomtan/tensorflow,petewarden/tensorflow,gautam1858/tensorflow,freedomtan/tensorflow,yongtang/tensorflow,cxxgtxy/tensorflow,jhseu/tensorflow,paolodedios/tensorflow,aam-at/tensorflow,freedomtan/tensorflow,adit-chandra/tensorflow,gautam1858/tensorflow,jhseu/tensorflow,petewarden/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-pywrap_saved_model,frreiss/tensorflow-fred,sarvex/tensorflow,frreiss/tensorflow-fred,renyi533/tensorflow,gunan/tensorflow,petewarden/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,sarvex/tensorflow,davidzchen/tensorflow