llvmbot wrote:

<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Charles Zablit (charles-zablit)

<details>
<summary>Changes</summary>

This patch fixes cross platform Makefile.rules macros and adds the 
`ECHO_TO_EXISTING_FILE` macros.

Using `echo` in a macro to write to a file had quoting issues.

---
Full diff: https://github.com/llvm/llvm-project/pull/183090.diff


1 Files Affected:

- (modified) lldb/packages/Python/lldbsuite/test/make/Makefile.rules (+6-4) 


``````````diff
diff --git a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules 
b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
index eeaf651792fee..821558fbf8588 100644
--- a/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
+++ b/lldb/packages/Python/lldbsuite/test/make/Makefile.rules
@@ -46,8 +46,9 @@ ifeq "$(OS)" "Windows_NT"
        RM_F = del /f /q $(subst /,\,$(1))
        RM_RF = rd /s /q $(subst /,\,$(1))
        LN_SF = mklink /D "$(subst /,\,$(2))" "$(subst /,\,$(1))"
-       ECHO = echo $(1)
-       ECHO_TO_FILE = echo $(1) > $(subst /,\,$(2))
+       ECHO = echo $(1);
+       ECHO_TO_FILE = printf "%s\n" $(1) > "$(subst /,\,$(2))"
+       ECHO_TO_EXISTING_FILE = printf "%s\n" $(1) >> "$(subst /,\,$(2))"
 else
        MKDIR_P = mkdir -p $(1)
        CP = cp $(1) $(2)
@@ -56,8 +57,9 @@ else
        RM_F = rm -f $(1)
        RM_RF = rm -rf $(1)
        LN_SF = ln -sf $(1) $(2)
-       ECHO = echo "$(1)"
-       ECHO_TO_FILE = echo $(1) > $(2)
+       ECHO = echo $(1);
+       ECHO_TO_FILE = printf '%s\n' $(1) > "$(2)"
+       ECHO_TO_EXISTING_FILE = printf '%s\n' $(1) >> "$(2)"
 endif
 
 # Suppress built-in suffix rules. We explicitly define rules for %.o.

``````````

</details>


https://github.com/llvm/llvm-project/pull/183090
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to