<div dir="ltr">Any objections? I've sent the patch for review and will land next week if it's accepted and there isn't any other discussion.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 9, 2021 at 5:46 PM Mehdi AMINI <<a href="mailto:joker.eph@gmail.com" target="_blank">joker.eph@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 9, 2021 at 5:42 PM Geoffrey Martin-Noble via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I noticed that the lit `--path` argument currently accepts relative paths, but the way it operates with them is pretty broken. It differs between external shell and internal shell because the path resolution is done with a different working directory. With the internal shell, it's resolved relative to the directory from which lit is executed, whereas with the external shell it's resolved relative to where the test case is executed. To make matters worse, using the internal shell the file path<br>to binaries looked up with the `which` method is returned relative to the directory from which lit is executed, but then executed from the test execution directory. That means that relative --path arguments when using the internal shell result in a `[Errno 2] No such file or directory` error instead of the expected `command not found`.<div><br></div><div>I propose that `--path` arguments be resolved as absolute paths as part of command line argument parsing. So relative paths passed to `--path` would be consistently interpreted as relative to the directory from which lit was invoked, which seems the least surprising behavior. To address other potential edge cases from the `which` method returning relative paths, I also propose modifying it to return absolute paths, which matches the behavior of the unix function from which it gets its name.<br></div></div></blockquote><div><br></div><div><br></div><div>FWIW that makes sense to me!</div><div><br></div><div>Thanks for the clear explanation :)</div><div><br></div><div><br></div><div>-- </div><div>Mehdi</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div><div><br></div><div><a href="https://reviews.llvm.org/D115486" target="_blank">https://reviews.llvm.org/D115486</a> is a patch making this change.<br></div><div><br></div><div>Thanks,</div><div>Geoffrey<br></div></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div>
</blockquote></div>