<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="">Any idea where this hack lives? Would be nice to check if it's updated.</div></div></blockquote>It’s not a hack in the LLVM codebase (that would be easier). What I remember from previous discussions about Python, is that it finds #!/usr/bin/env python and uses installed Python2 interpreter or something, but doesn’t have the same trick for python3 or smth.<div class="">But again, I can be very wrong here.</div><div class=""><br class=""></div><div class="">-Valeriy<br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On 22 Apr 2021, at 13:16, Sam McCall <<a href="mailto:sammccall@google.com" class="">sammccall@google.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">This is coming up now in part because debian testing has removed /usr/bin/python, so #!/usr/bin/env python no longer works on such systems.<div class=""><br class=""></div><div class="">Relevant is <a href="https://www.python.org/dev/peps/pep-0394/" class="">https://www.python.org/dev/peps/pep-0394/</a>, which I think basically says if we want to maintain scripts that work both on py2-only systems and py3-only systems there's no real answer other than adding an installer that rewrites the shebang lines :-(</div><div class=""><br class=""></div><div class="">Agree that for tools used by LLVM devs #!/usr/bin/env python3 seems like a good change.</div><div class="">For user-facing tools it seems we have 3 "easy" options for the checked-in scripts:</div><div class="">A) use python2 and break on some new systems</div><div class="">B) use python3 and break on some old systems</div><div class="">C) use python and break on systems that don't provide the alias</div><div class="">None of these seem nice.</div><div class=""><br class=""></div><div class="">> As far as I remember, it’s trickier on Windows where there is a special hack for shebang to python specifically.</div><br class=""><div class="">Any idea where this hack lives? Would be nice to check if it's updated.</div></div><br class=""><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Apr 22, 2021 at 11:30 AM Haojian Wu <<a href="mailto:hokein@google.com" class="">hokein@google.com</a>> wrote:<br class=""></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" class="">Hello folks,<div class=""><br class=""></div><div class="">We have a mixture of python(2) vs python3 shebang usage in llvm codebase.</div><div class=""><br class=""></div><div class="">As python2 upstream support has ended, what's the LLVM policy here? Shall we change the shebang to python3 for all scripts? </div><div class=""><br class=""></div><div class="">- For llvm-developer-only python scripts (e.g. clang-tidy/add_new_check.py), it is safe to do this change, as <a href="https://llvm.org/docs/GettingStarted.html#software" target="_blank" class="">LLVM development</a> requires python >= 3.6 </div><div class="">- For python scripts being interacted with people's workflow (e.g. clang-format-diff.py), it seems unclear to me, changing the shebang would break people's workflow on python2 machines.</div><div class=""><br class=""></div><div class="">I have some patches (<a href="https://reviews.llvm.org/D101038" target="_blank" class="">https://reviews.llvm.org/D101038</a>, <a href="https://reviews.llvm.org/D101037" target="_blank" class="">https://reviews.llvm.org/D101037</a>). What do people think?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Haojian</div></div>
</blockquote></div>
</div></blockquote></div><br class=""></div></body></html>