diff options
-rw-r--r-- | build_extra/rust/BUILD.gn | 2 | ||||
m--------- | third_party | 0 | ||||
-rwxr-xr-x | tools/format.py | 8 | ||||
-rwxr-xr-x | tools/http_benchmark.py | 7 | ||||
-rw-r--r-- | tools/util.py | 4 |
5 files changed, 12 insertions, 9 deletions
diff --git a/build_extra/rust/BUILD.gn b/build_extra/rust/BUILD.gn index 15948b3c8..1197de4f7 100644 --- a/build_extra/rust/BUILD.gn +++ b/build_extra/rust/BUILD.gn @@ -465,7 +465,7 @@ rust_crate("futures_cpupool") { ":futures", ":num_cpus", ] - args = [ "-Adeprecated" ] # futures::Run + args = [ "-Adeprecated" ] # futures::Run } rust_crate("indexmap") { diff --git a/third_party b/third_party -Subproject bfdd8a7ce2d82a958b0672eed222c1e5f8f34aa +Subproject 71587318f7faf4ac4df78b355f5aec579e0de6f diff --git a/tools/format.py b/tools/format.py index cf03ccca3..0dc100b9f 100755 --- a/tools/format.py +++ b/tools/format.py @@ -3,7 +3,7 @@ from glob import glob import os from third_party import third_party_path, fix_symlinks, google_env, clang_format_path -from util import root_path, run, find_exts +from util import root_path, run, find_exts, platform fix_symlinks() @@ -39,5 +39,7 @@ run(["node", prettier, "--write"] + find_exts("website/", ".js", ".ts", ".md")) # yapf: enable -# Requires rustfmt 0.8.2 (flags were different in previous versions) -run(["rustfmt", "--config-path", rustfmt_config] + find_exts("src/", ".rs")) +run([ + "third_party/rustfmt/" + platform() + + "/rustfmt", "--config-path", rustfmt_config +] + find_exts("src/", ".rs")) diff --git a/tools/http_benchmark.py b/tools/http_benchmark.py index 58e9c279e..1fc78d31b 100755 --- a/tools/http_benchmark.py +++ b/tools/http_benchmark.py @@ -33,12 +33,9 @@ def run(server_cmd): # Run deno echo server in the background. server = subprocess.Popen(server_cmd) time.sleep(5) # wait for server to wake up. TODO racy. - wrk_platform = { - "linux2": "linux", - "darwin": "mac", - }[sys.platform] try: - cmd = "third_party/wrk/" + wrk_platform + "/wrk -d " + DURATION + " http://" + ADDR + "/" + cmd = "third_party/wrk/%s/wrk -d %s http://%s/" % (util.platform(), + DURATION, ADDR) print cmd output = subprocess.check_output(cmd, shell=True) req_per_sec = util.parse_wrk_output(output) diff --git a/tools/util.py b/tools/util.py index 10b6b9c6f..7b8b6f6e3 100644 --- a/tools/util.py +++ b/tools/util.py @@ -332,3 +332,7 @@ def parse_wrk_output(output): if req_per_sec is None: req_per_sec = extract_number(r'Requests/sec:\s+(\d+)', line) return req_per_sec + + +def platform(): + return {"linux2": "linux", "darwin": "mac", "win32": "win"}[sys.platform] |