|
11 | 11 | import json
|
12 | 12 | import time
|
13 | 13 | import shutil
|
14 |
| -from util import root_path, run, run_output, build_path, executable_suffix |
| 14 | +from util import find_exts, root_path, run, run_output, build_path, executable_suffix |
15 | 15 | import tempfile
|
16 | 16 | import http_server
|
17 | 17 | import throughput_benchmark
|
@@ -59,22 +59,26 @@ def import_data_from_gh_pages():
|
59 | 59 |
|
60 | 60 |
|
61 | 61 | def get_binary_sizes(build_dir):
|
| 62 | + # Because cargo's OUT_DIR is not predictable, we have to search the build |
| 63 | + # tree for these files... |
| 64 | + files = find_exts([build_dir], ["js", "map", "bin"]) |
62 | 65 | path_dict = {
|
63 |
| - "deno": |
64 |
| - os.path.join(build_dir, "deno" + executable_suffix), |
65 |
| - "main.js": |
66 |
| - os.path.join(build_dir, "gen/cli/bundle/main.js"), |
67 |
| - "main.js.map": |
68 |
| - os.path.join(build_dir, "gen/cli/bundle/main.js.map"), |
69 |
| - "compiler.js": |
70 |
| - os.path.join(build_dir, "gen/cli/bundle/compiler.js"), |
71 |
| - "compiler.js.map": |
72 |
| - os.path.join(build_dir, "gen/cli/bundle/compiler.js.map"), |
73 |
| - "snapshot_deno.bin": |
74 |
| - os.path.join(build_dir, "gen/cli/snapshot_deno.bin"), |
75 |
| - "snapshot_compiler.bin": |
76 |
| - os.path.join(build_dir, "gen/cli/snapshot_compiler.bin") |
| 66 | + "deno": os.path.join(build_dir, "deno" + executable_suffix), |
77 | 67 | }
|
| 68 | + for f in files: |
| 69 | + if f.endswith("CLI_SNAPSHOT.js"): |
| 70 | + path_dict["CLI_SNAPSHOT.js"] = f |
| 71 | + elif f.endswith("CLI_SNAPSHOT.js.map"): |
| 72 | + path_dict["CLI_SNAPSHOT.js.map"] = f |
| 73 | + elif f.endswith("CLI_SNAPSHOT.bin"): |
| 74 | + path_dict["CLI_SNAPSHOT.bin"] = f |
| 75 | + elif f.endswith("COMPILER_SNAPSHOT.js"): |
| 76 | + path_dict["COMPILER_SNAPSHOT.js"] = f |
| 77 | + elif f.endswith("COMPILER_SNAPSHOT.js.map"): |
| 78 | + path_dict["COMPILER_SNAPSHOT.js.map"] = f |
| 79 | + elif f.endswith("COMPILER_SNAPSHOT.bin"): |
| 80 | + path_dict["COMPILER_SNAPSHOT.bin"] = f |
| 81 | + |
78 | 82 | sizes = {}
|
79 | 83 | for name, path in path_dict.items():
|
80 | 84 | assert os.path.exists(path)
|
|
0 commit comments