<div dir="ltr">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><br></div><div>Relevant is <a href="https://www.python.org/dev/peps/pep-0394/">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><br></div><div>Agree that for tools used by LLVM devs #!/usr/bin/env python3 seems like a good change.</div><div>For user-facing tools it seems we have 3 "easy" options for the checked-in scripts:</div><div>A) use python2 and break on some new systems</div><div>B) use python3 and break on some old systems</div><div>C) use python and break on systems that don't provide the alias</div><div>None of these seem nice.</div><div><br></div><div>> As far as I remember, it’s trickier on Windows where there is a special hack for shebang to python specifically.</div><br><div>Any idea where this hack lives? Would be nice to check if it's updated.</div></div><br><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">hokein@google.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">Hello folks,<div><br></div><div>We have a mixture of python(2) vs python3 shebang usage in llvm codebase.</div><div><br></div><div>As python2 upstream support has ended, what's the LLVM policy here? Shall we change the shebang to python3 for all scripts? </div><div><br></div><div>- 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">LLVM development</a> requires python >= 3.6 </div><div>- 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><br></div><div>I have some patches (<a href="https://reviews.llvm.org/D101038" target="_blank">https://reviews.llvm.org/D101038</a>, <a href="https://reviews.llvm.org/D101037" target="_blank">https://reviews.llvm.org/D101037</a>). What do people think?</div><div><br></div><div><br></div><div>Thanks,</div><div>Haojian</div></div>
</blockquote></div>