On Ubuntu 20.04, /usr/bin/env python always fails and requires
explicitly choosing python2 or python3.
Grep shows there are a lot of other places still relying on the old,
sensible behavior but these are the annoying ones I keep running into.
Differential D82767
clang-format: Explicitly use python3 arsenm on Jun 29 2020, 6:51 AM. Authored by
Details
On Ubuntu 20.04, /usr/bin/env python always fails and requires Grep shows there are a lot of other places still relying on the old,
Diff Detail Event TimelineComment Actions While I really like this idea of migrating the scripts to python3, I believe that the current plan is to allow until December for users to migrate, so this might be a bit premature :-(. Comment Actions Is this documented somewhere? I think that every script being broken by default on all new distributions is a big problem. It's been 12 years, and python 2 has been EOL since January. I don't see why downstream projects would still be holding on dropping python 2 Comment Actions The thread that I was basing the timeline from is http://lists.llvm.org/pipermail/llvm-dev/2020-January/138730.html. Comment Actions We may not be consistent across all of LLVM $ find . -name '*.py' -print -exec /usr/bin/head -2 {} \; | grep "#!" | sort | uniq -c 6 #! /usr/bin/env python 2 #! /usr/bin/env python3 2 #! /usr/bin/python 1 #!/bin/env python 133 #!/usr/bin/env python 13 #!/usr/bin/env python3 49 #!/usr/bin/python Comment Actions Thinking a bit more about this, using /usr/bin/env python ensures that we actually honour the python version that the user specifies because that allows the user control over the python symlink pointing to either python2 or python3. @arsen what do you think of just unifying on /usr/bin/env python across all the scripts? Comment Actions My understanding is that explicitly requiring python3 may make sense if the script is not backward-compatible with python2, while requiring python means the version is not important. Comment Actions
Change proposed in https://reviews.llvm.org/D83857 |