bazelbuild/bazel

Fail to apply patch that adds a new line to the end of the file ("\ No newline at end of file")

Open

#17.376 geöffnet am 1. Feb. 2023

Auf GitHub ansehen
 (9 Kommentare) (7 Reaktionen) (0 zugewiesene Personen)Java (4.465 Forks)batch import
P2help wantedteam-OSStype: bug

Repository-Metriken

Stars
 (25.384 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 22T 20h) (77 gemergte PRs in 30 T)

Beschreibung

Hi, I have tried to add a patch to TensorFlow build at https://github.com/tensorflow/tensorflow/blob/master/third_party/llvm/workspace.bzl that contains

--- llvm-project/clang/lib/Format/FormatTokenSource.h
+++ llvm-project/clang/lib/Format/FormatTokenSource.h
@@ -52,7 +52,7 @@
   virtual FormatToken *setPosition(unsigned Position) = 0;
 };
 
-class IndexedTokenSource : public FormatTokenSource {
+class LLVM_GSL_POINTER IndexedTokenSource : public FormatTokenSource {
 public:
   IndexedTokenSource(ArrayRef<FormatToken *> Tokens)
       : Tokens(Tokens), Position(-1) {}
@@ -198,4 +198,4 @@
 
 #undef DEBUG_TYPE
 
-#endif
\ No newline at end of file
+#endif

bazel build fails with

# Error in patch: Error applying patch tf/tensorflow/third_party/llvm/generated.patch: Expecting more chunk line at line 19
# ERROR: tf/tensorflow/WORKSPACE:11]([REDACTED]):14: fetching _tf_http_archive rule //external:llvm-raw: Traceback (most recent call last):
# 	File "/tf/tensorflow/third_party/repo.bzl", line 83, column 30, in _tf_http_archive_impl
# 		ctx.patch(patch_file, strip = 1)
# Error in patch: Error applying patch /tf/tensorflow/third_party/llvm/generated.patch: Expecting more chunk line at line 19
# ERROR: no such package '@llvm-raw//utils/bazel': Error applying patch /tf/tensorflow/third_party/llvm/generated.patch: Expecting more chunk line at line 19

Line 19 is \ No newline at end of file.

removing @@ -198,4 +198,4 @@ fragment that adds a new line from patch fixes the issue.

Will be happy with workarounds too.

Contributor Guide