Commit Graph

11 Commits

Author SHA1 Message Date
Michael Achenbach
6ea78398aa [infra] Change all Python shebangs to Python3
The infrastructure runs everything already in Python3, so this is
mostly a clean-up.

For MB, a python2 holdover was removed and new lint errors were
fixed.

The renames were automated with:
git grep -e "/usr/bin/python$" |
  cut -d':' -f1 |
  xargs
  sed -i 's/#!\/usr\/bin\/python$/#!\/usr\/bin\/python3/1'

and
git grep -e "/usr/bin/env python$" |
  cut -d':' -f1 |
  xargs
  sed -i 's/#!\/usr\/bin\/env python$/#!\/usr\/bin\/env python3/1'

Bug: v8:13148
Change-Id: If4f3c7635e72fa134798d55314ac1aa92ddd01bf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3811499
Reviewed-by: Liviu Rau <liviurau@google.com>
Commit-Queue: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/main@{#82231}
2022-08-05 14:55:00 +00:00
Sigurd Schneider
f086b072e7 [tools] Use ThreadPoolExecutor with reasonable job count default
Change-Id: I90be28728842a1ab5a4d4d674298e71f70043e80
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1549163
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60677}
2019-04-08 10:41:46 +00:00
Sigurd Schneider
40fe78e67a [tools] Parse ninja deps to obtain header information
Change-Id: I51e32bc344c80d67a23d33039fda49bb9620a78f
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1549165
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60676}
2019-04-08 10:35:07 +00:00
Vadim Gorbachev
16b6266649 Python2 compatibility: fix flake8 report F632 F821
use '!=' instead of 'is not' with str
FileNotFoundError isn't exist in python2.7, use IOError instead.


Bug: chromium:948812
Change-Id: I241ff8a9321d612f2371a2a2e2deae948fa180e5
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1549168
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60661}
2019-04-05 16:24:19 +00:00
Sigurd Schneider
db94d2aa9a [tools] Improve locs.py to include target name in json
Change-Id: I71a97bf686e9d821b607504c4211b21a4fe8234b
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1545906
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60539}
2019-04-01 08:24:03 +00:00
Vadim Gorbachev (bmsdave)
d077f9b5ad fix syntax error in python2 code
we can't use {**dict1, **dict2} in python2 code.
see report https://travis-ci.com/bmsdave/v8/jobs/180113432

Bug: v8:935200
Change-Id: I2f2a1283583432d6d0167436dd7d4205455049cb
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1484303
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60039}
2019-03-05 20:07:08 +00:00
Vadim Gorbachev (bmsdave)
7315d7b3d7 Preparing v8 to use with python3 /tools
There are now less that 400 days until the end of life
of Python 2(aka _legacy_ Python) https://pythonclock.org/ .
The code compatibility check for python2 and python3
used the following tools: futurize, flake8
You can see the reports here: https://travis-ci.com/bmsdave/v8/builds

This CL was uploaded by git cl split.

Bug: v8:8594
Change-Id: I661c52a70527e8ddde841fee6d4dcba282b4a938
Reviewed-on: https://chromium-review.googlesource.com/c/1470123
Commit-Queue: Sergiy Belozorov <sergiyb@chromium.org>
Reviewed-by: Sergiy Belozorov <sergiyb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59675}
2019-02-19 09:12:07 +00:00
Sigurd Schneider
40633b4f48 [tools] Also count input bytes in tools/locs.py
As Marja suggested, this CL changes tools/locs.py in such a way that
it also counts the bytes in the input file and the output file.

Example output now looks similar to this:

Processed 1,526 files in 24.58 sec.
gen         (   31 files):    94,507 LoC (  4,972 kB) to    2,839,311 LoC (183,777 kB) (   30x)
src         (  630 files):   371,499 LoC ( 14,743 kB) to   53,707,841 LoC (  3,155 MB) (  145x)
test        (  381 files):   492,861 LoC ( 25,372 kB) to   36,885,988 LoC (  2,194 MB) (   75x)
third_party (  433 files):   239,155 LoC (  8,683 kB) to    9,713,872 LoC (412,829 kB) (   41x)
total       ( 1526 files): 1,212,675 LoC ( 54,242 kB) to  104,133,982 LoC (  5,973 MB) (   86x)


Change-Id: I1ff5e752ee3a96d388a4393c2592aec68f834000
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/1450113
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59322}
2019-02-04 09:34:28 +00:00
Sigurd Schneider
9b42c4c132 [tools] Improve locs.py
- Detect errors during generation of compile_commands.json
  and building the target 'v8_generated_cc_files'.

- Change format of JSON output to have files as keys, which makes
  programmatic lookup by filename easier on the consumer side.

Change-Id: Ibc3d9cff64f82df7a3dbb76cb8d914b29460a48c
Notry: true
Reviewed-on: https://chromium-review.googlesource.com/c/1362041
Reviewed-by: Maya Lekova <mslekova@chromium.org>
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58263}
2018-12-17 08:53:42 +00:00
Sigurd Schneider
22f9a8e158 [tools] Improve locs.py
This CL fixes some style issues and improves json output for the LoC
counting script tools/locs.py.

Notry: true
Change-Id: I0805904e44ab240945ef88dd8214abb8ae02cf7d
Reviewed-on: https://chromium-review.googlesource.com/c/1352271
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Michael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57873}
2018-11-27 13:42:54 +00:00
Sigurd Schneider
53dcadfeae [tools] Add script to count lines of code
This script counts lines of code before and after preprocessor expansion.
When running:
  tools/locs.py --build-dir out.gn/repro --smallest --largest --worst
in the v8 directory, it reports:

Processed 1,520 files in 24.62 sec.
src         (  625 files):   365,679 to   53,468,383 ( 146.22x)
third_party (  432 files):   239,081 to    9,502,094 (  39.74x)
gen         (   19 files):    64,040 to    1,415,287 (  22.10x)
total       ( 1520 files): 1,173,349 to  102,831,949 (  87.64x)
test        (  392 files):   489,865 to   37,476,036 (  76.50x)
Largest 3 files after expansion:
   33,495 to      140,401 (   4.19x) gen/torque-generated/builtins-array-from-dsl-gen.cc
  100,014 to      140,111 (   1.40x) ../../test/cctest/gay-precision.cc
  100,014 to      140,110 (   1.40x) ../../test/cctest/gay-shortest.cc
Worst expansion (3 files):
        6 to      100,826 (14403.71x) ../../test/fuzzer/wasm-data-section.cc
        6 to      100,826 (14403.71x) ../../test/fuzzer/wasm-function-sigs-section.cc
        6 to      100,826 (14403.71x) ../../test/fuzzer/wasm-globals-section.cc
Smallest 3 input files:
        0 to            0 (   0.00x) ../../testing/gtest/empty.cc
        1 to            0 (   0.00x) ../../src/x64/simulator-x64.cc
        4 to        4,423 ( 884.60x) ../../buildtools/third_party/libc++/trunk/src/utility.cpp

Notry: true
Change-Id: Ie1da942463d9e6a84338a9bd57d9ddc46d2856dc
Reviewed-on: https://chromium-review.googlesource.com/c/1349571
Commit-Queue: Sigurd Schneider <sigurds@chromium.org>
Reviewed-by: Marja Hölttä <marja@chromium.org>
Cr-Commit-Position: refs/heads/master@{#57822}
2018-11-26 13:57:39 +00:00