<div dir="ltr">Another approach for 'env' would be to handle it internally in lit like we do for 'cd'. It is already in the business of setting up then environment before running any command.</div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 15, 2015 at 1:48 PM, Yaron Keren <span dir="ltr"><<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="rtl"><div dir="ltr">OK, done finally in r242329.</div><div dir="ltr">With MSYS bash, one test still fails due to the / expansion and two other tests fail because MSYS env does not pass TZ= to the executed program, see discussion at  </div><div dir="ltr"><br></div><div dir="ltr">  <a href="https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_Alexpux_MSYS2-2Dpackages_issues_294&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=CnzuN65ENJ1H9py9XLiRvC_UQz6u3oG6GUNn7_wosSM&m=aSpx4eYq7sGsBD2juowNH_bIbxYdU8Eh___HIrMyPg0&s=-rJ8kw3HafgfsOa_15CLAlYWJoHbggiF7OOqnipmB9o&e=" target="_blank">https://github.com/Alexpux/MSYS2-packages/issues/294</a>.</div><div dir="ltr"><br></div><div dir="ltr">Hopefully MSYS developers will provide a workaorund this or we'll disable the tests for MSYS.</div><div dir="ltr"><br></div><div dir="ltr">Yet another option for LLVM development with MSYS2 is to use a bare-bones env.cpp I wrote, good enough to pass LLVM tests but of course not a real replacement for env:</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font face="monospace, monospace">#include <process.h></font></div><div dir="ltr"><font face="monospace, monospace">#include <stdlib.h></font></div><div dir="ltr"><font face="monospace, monospace">#include <string.h></font></div><div dir="ltr"><font face="monospace, monospace"><br></font></div><div dir="ltr"><font face="monospace, monospace">int main(int argc, char *argv[]) {</font></div><div dir="ltr"><font face="monospace, monospace">  for (unsigned i = 1; i < argc; ++i) {</font></div><div dir="ltr"><font face="monospace, monospace">    if (!strchr(argv[i], '='))</font></div><div dir="ltr"><font face="monospace, monospace">      _execvp(argv[i], argv + i);</font></div><div dir="ltr"><font face="monospace, monospace">    _putenv(argv[i]);</font></div><div dir="ltr"><font face="monospace, monospace">  }</font></div><div dir="ltr"><font face="monospace, monospace">}</font></div><div><br></div></div><div dir="ltr"><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><div dir="ltr"><br><div class="gmail_quote">2015-07-15 18:13 GMT+03:00 NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 .8ex;border-left:1px #ccc solid;border-right:1px #ccc solid;padding-left:1ex;padding-right:1ex">It has been not maintained since <span style="font-size:13.1999998092651px;line-height:19.7999992370605px">r179283. and I haven't build mingw tree with autoconf. I don't object to drop shell-preservers-root. </span></blockquote></div><div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jul 15, 2015 at 11:20 PM Yaron Keren <<a href="mailto:yaron.keren@gmail.com" target="_blank">yaron.keren@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="rtl"><div dir="ltr">Since r179283, internal shell is default on windows (*unless use_lit_shell = 0), so execute_external = not windows and</div><div dir="ltr"><br></div><div dir="ltr"><div dir="ltr"><font face="monospace, monospace"># Exclude MSYS due to transforming '/' to 'X:/mingwroot/'.</font></div><div dir="ltr"><font face="monospace, monospace">if not platform.system() in ['Windows'] or not execute_external:</font></div><div dir="ltr"><font face="monospace, monospace">    config.available_features.add('shell-preserves-root')</font></div><div><br></div><div>is really "if not windows or (not not windows)" = "if true" making <span style="font-family:monospace,monospace">shell-preserves-root</span> always true on Windows (unless use_lit_shell = 0).</div><div><br></div><div>No tests that require shell-preserves-root are actually disabled now on WIndows + MSYS2. In this configuration, just one test fails (which really require shell-preserves-root): darwin-sdkroot.c. This test has no purpose on windows anyhow and may be disabled. All other tests with shell-preserves-root do pass on MSYS2 bash.</div><div><br></div><div>Does shell-preserves-root serves any purpose now?</div><div>Any reason to keep it alive?</div><div><br></div></div></div>
</blockquote></div>
</div></div></div></div>
</div></div></blockquote></div><br></div>