<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">This commit (and its brother) has broken the buildbots for a bit.<div><br></div><div>See: <a href="http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/763">http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/763</a></div><div><br></div><div>Reverted in r180066.</div><div><br></div><div>Michael</div><div><br><div><div>On Apr 22, 2013, at 2:59 PM, David Dean <<a href="mailto:david_dean@apple.com">david_dean@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I'm seeing the following build failure on multiple bots:<br><br>/Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.clang-x86_64-darwin10-nobootstrap-RA/llvm/unittests/Support/ProgramTest.cpp:29:17: error: use of undeclared identifier 'environ'<br> char **envp = environ;<br>               ^<br><br><br>On 22 Apr 2013, at 1:23 PM, Reid Kleckner <<a href="mailto:reid@kleckner.net">reid@kleckner.net</a>> wrote:<br><br><blockquote type="cite">Author: rnk<br>Date: Mon Apr 22 15:23:41 2013<br>New Revision: 180041<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=180041&view=rev">http://llvm.org/viewvc/llvm-project?rev=180041&view=rev</a><br>Log:<br>[Support] Propagate the environment into the test child process<br><br>Should fix the dragonegg bootstrap builder, which reasonably needs<br>LD_LIBRARY_PATH to be set.<br><br>Modified:<br>  llvm/trunk/unittests/Support/ProgramTest.cpp<br><br>Modified: llvm/trunk/unittests/Support/ProgramTest.cpp<br>URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ProgramTest.cpp?rev=180041&r1=180040&r2=180041&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/unittests/Support/ProgramTest.cpp?rev=180041&r1=180040&r2=180041&view=diff</a><br>==============================================================================<br>--- llvm/trunk/unittests/Support/ProgramTest.cpp (original)<br>+++ llvm/trunk/unittests/Support/ProgramTest.cpp Mon Apr 22 15:23:41 2013<br>@@ -24,6 +24,15 @@ ProgramTestStringArg1("program-test-stri<br>static cl::opt<std::string><br>ProgramTestStringArg2("program-test-string-arg2");<br><br>+static void CopyEnvironment(std::vector<const char *> out) {<br>+  // environ appears to be pretty portable.<br>+  char **envp = environ;<br>+  while (*envp != 0) {<br>+    out.push_back(*envp);<br>+    ++envp;<br>+  }<br>+}<br>+<br>TEST(ProgramTest, CreateProcessTrailingSlash) {<br> if (getenv("LLVM_PROGRAM_TEST_CHILD")) {<br>   if (ProgramTestStringArg1 == "has\\\\ trailing\\" &&<br>@@ -43,7 +52,13 @@ TEST(ProgramTest, CreateProcessTrailingS<br>   "-program-test-string-arg2", "has\\\\ trailing\\",<br>   0<br> };<br>-  const char *envp[] = { "LLVM_PROGRAM_TEST_CHILD=1", 0 };<br>+<br>+  // Add LLVM_PROGRAM_TEST_CHILD to the environment of the child.<br>+  std::vector<const char *> envp;<br>+  CopyEnvironment(envp);<br>+  envp.push_back("LLVM_PROGRAM_TEST_CHILD=1");<br>+  envp.push_back(0);<br>+<br> std::string error;<br> bool ExecutionFailed;<br> // Redirect stdout and stdin to NUL, but let stderr through.<br>@@ -53,7 +68,7 @@ TEST(ProgramTest, CreateProcessTrailingS<br> Path nul("/dev/null");<br>#endif<br> const Path *redirects[] = { &nul, &nul, 0 };<br>-  int rc = Program::ExecuteAndWait(my_exe, argv, envp, redirects,<br>+  int rc = Program::ExecuteAndWait(my_exe, argv, &envp[0], redirects,<br>                                  /*secondsToWait=*/10, /*memoryLimit=*/0,<br>                                  &error, &ExecutionFailed);<br> EXPECT_FALSE(ExecutionFailed) << error;<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote><br>-David<br><br><br>_______________________________________________<br>llvm-commits mailing list<br><a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a></div></blockquote></div><br></div></body></html>