[PATCH] D82767: clang-format: Explicitly use python3

2020-07-15 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment.



>> 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.
>>  At the end-of-year, we should be able to harmonize shebangs to 
>> #!/usr/bin/env python3 or #!/usr/bin/env python
> 
> Fixing this to be consistent would be an improvement

Change proposed in https://reviews.llvm.org/D83857


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-07-09 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment.

In D82767#2141962 , @serge-sans-paille 
wrote:

> In D82767#2132903 , @MyDeveloperDay 
> wrote:
>
> > 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
> >
>
>
> 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.
>  At the end-of-year, we should be able to harmonize shebangs to 
> #!/usr/bin/env python3 or #!/usr/bin/env python


Fixing this to be consistent would be an improvement


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-07-09 Thread serge via Phabricator via cfe-commits
serge-sans-paille added a comment.

In D82767#2132903 , @MyDeveloperDay 
wrote:

> 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
>


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.
At the end-of-year, we should be able to harmonize shebangs to #!/usr/bin/env 
python3 or #!/usr/bin/env python


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-07-06 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a subscriber: arsen.
compnerd added a comment.

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?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-07-06 Thread MyDeveloperDay via Phabricator via cfe-commits
MyDeveloperDay added a comment.

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


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-07-02 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment.

The thread that I was basing the timeline from is 
http://lists.llvm.org/pipermail/llvm-dev/2020-January/138730.html.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-06-30 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm added a comment.

In D82767#2123024 , @compnerd wrote:

> 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 :-(.


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


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-06-30 Thread Saleem Abdulrasool via Phabricator via cfe-commits
compnerd added a comment.

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 :-(.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82767/new/

https://reviews.llvm.org/D82767



___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[PATCH] D82767: clang-format: Explicitly use python3

2020-06-29 Thread Matt Arsenault via Phabricator via cfe-commits
arsenm created this revision.
arsenm added reviewers: djasper, compnerd.
Herald added a subscriber: wdng.

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.


https://reviews.llvm.org/D82767

Files:
  clang/tools/clang-format/clang-format-diff.py
  clang/tools/clang-format/git-clang-format


Index: clang/tools/clang-format/git-clang-format
===
--- clang/tools/clang-format/git-clang-format
+++ clang/tools/clang-format/git-clang-format
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 #===- git-clang-format - ClangFormat Git Integration -*- python 
-*--===#
 #
@@ -19,7 +19,7 @@
 For further details, run:
 git clang-format -h
 
-Requires Python 2.7 or Python 3
+Requires Python 3
 """
 
 from __future__ import absolute_import, division, print_function
Index: clang/tools/clang-format/clang-format-diff.py
===
--- clang/tools/clang-format/clang-format-diff.py
+++ clang/tools/clang-format/clang-format-diff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 #===- clang-format-diff.py - ClangFormat Diff Reformatter *- python 
-*--===#
 #


Index: clang/tools/clang-format/git-clang-format
===
--- clang/tools/clang-format/git-clang-format
+++ clang/tools/clang-format/git-clang-format
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 #===- git-clang-format - ClangFormat Git Integration -*- python -*--===#
 #
@@ -19,7 +19,7 @@
 For further details, run:
 git clang-format -h
 
-Requires Python 2.7 or Python 3
+Requires Python 3
 """
 
 from __future__ import absolute_import, division, print_function
Index: clang/tools/clang-format/clang-format-diff.py
===
--- clang/tools/clang-format/clang-format-diff.py
+++ clang/tools/clang-format/clang-format-diff.py
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/env python3
 #
 #===- clang-format-diff.py - ClangFormat Diff Reformatter *- python -*--===#
 #
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits