[Lldb-commits] [lldb] [lldb][test] Fix TestUseSourceCache for readonly source trees (PR #113251)

via lldb-commits lldb-commits at lists.llvm.org
Mon Oct 21 19:33:34 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-lldb

Author: Jordan Rupprecht (rupprecht)

<details>
<summary>Changes</summary>

TestUseSourceCache attempts to write to a build artifact copied from the source tree, and asserts the write succeeded. If the source tree is read only, the copy will also be read only, causing it to fail. When producing the build artifact, ensure that it is writable.

I use `chmod` as a build step to do this, but I believe that is linuxish-only thing, so I excluded this extra command for Windows.

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


1 Files Affected:

- (modified) lldb/test/API/commands/settings/use_source_cache/Makefile (+3) 


``````````diff
diff --git a/lldb/test/API/commands/settings/use_source_cache/Makefile b/lldb/test/API/commands/settings/use_source_cache/Makefile
index 791cb7d868d87e..0090acf5591daa 100644
--- a/lldb/test/API/commands/settings/use_source_cache/Makefile
+++ b/lldb/test/API/commands/settings/use_source_cache/Makefile
@@ -6,3 +6,6 @@ include Makefile.rules
 # Copy file into the build folder to enable the test to modify it.
 main-copy.cpp: main.cpp
 	cp -f $< $@
+ifneq "$(OS)" "Windows_NT"  # chmod is not available on Windows
+	chmod u+w $@
+endif

``````````

</details>


https://github.com/llvm/llvm-project/pull/113251


More information about the lldb-commits mailing list