Commit 4baf463
src: add JS APIs for compile cache and NODE_DISABLE_COMPILE_CACHE
This patch adds the following API for tools to enable compile
cache dynamically and query its status.
- module.enableCompileCache(cacheDir)
- module.getCompileCacheDir()
In addition this adds a NODE_DISABLE_COMPILE_CACHE environment
variable to disable the code cache enabled by the APIs as
an escape hatch to avoid unexpected/undesired effects of
the compile cache (e.g. less precise test coverage).
When the module.enableCompileCache() method is invoked without
a specified directory, Node.js will use the value of
the NODE_COMPILE_CACHE environment variable if it's set, or
defaults to `path.join(os.tmpdir(), 'node-compile-cache')`
otherwise. Therefore it's recommended for tools to call this
method without specifying the directory to allow overrides.
PR-URL: #54501
Fixes: #53639
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>1 parent 4a664b5 commit 4baf463Copy full SHA for 4baf463
File tree
Expand file treeCollapse file tree
14 files changed
+665
-31
lines changedOpen diff view settings
Filter options
- doc/api
- lib
- internal/modules
- src
- test
- fixtures
- parallel
Expand file treeCollapse file tree
14 files changed
+665
-31
lines changedOpen diff view settings
Collapse file
+14-20Lines changed: 14 additions & 20 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2868 | 2868 | |
2869 | 2869 | |
2870 | 2870 | |
2871 | | - |
2872 | | - |
2873 | | - |
2874 | | - |
2875 | | - |
2876 | | - |
2877 | | - |
2878 | | - |
2879 | | - |
2880 | | - |
2881 | | - |
2882 | | - |
2883 | | - |
2884 | | - |
2885 | | - |
2886 | | - |
2887 | | - |
2888 | | - |
2889 | | - |
| 2871 | + |
| 2872 | + |
2890 | 2873 | |
2891 | 2874 | |
2892 | 2875 | |
| ||
2908 | 2891 | |
2909 | 2892 | |
2910 | 2893 | |
| 2894 | + |
| 2895 | + |
| 2896 | + |
| 2897 | + |
| 2898 | + |
| 2899 | + |
| 2900 | + |
| 2901 | + |
| 2902 | + |
| 2903 | + |
| 2904 | + |
2911 | 2905 | |
2912 | 2906 | |
2913 | 2907 | |
| ||
3559 | 3553 | |
3560 | 3554 | |
3561 | 3555 | |
3562 | | - |
3563 | 3556 | |
3564 | 3557 | |
3565 | 3558 | |
| ||
3616 | 3609 | |
3617 | 3610 | |
3618 | 3611 | |
| 3612 | + |
3619 | 3613 | |
3620 | 3614 | |
3621 | 3615 | |
|
Collapse file
+156-1Lines changed: 156 additions & 1 deletion
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
64 | 64 | |
65 | 65 | |
66 | 66 | |
| 67 | + |
| 68 | + |
| 69 | + |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | + |
| 76 | + |
| 77 | + |
| 78 | + |
| 79 | + |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | + |
| 86 | + |
| 87 | + |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
| 112 | + |
| 113 | + |
| 114 | + |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
| 121 | + |
| 122 | + |
| 123 | + |
| 124 | + |
| 125 | + |
| 126 | + |
| 127 | + |
| 128 | + |
| 129 | + |
| 130 | + |
| 131 | + |
| 132 | + |
| 133 | + |
| 134 | + |
| 135 | + |
| 136 | + |
| 137 | + |
| 138 | + |
| 139 | + |
| 140 | + |
| 141 | + |
| 142 | + |
| 143 | + |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
| 151 | + |
| 152 | + |
| 153 | + |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
| 159 | + |
| 160 | + |
| 161 | + |
| 162 | + |
| 163 | + |
| 164 | + |
| 165 | + |
| 166 | + |
| 167 | + |
| 168 | + |
| 169 | + |
| 170 | + |
| 171 | + |
| 172 | + |
| 173 | + |
| 174 | + |
| 175 | + |
| 176 | + |
| 177 | + |
| 178 | + |
| 179 | + |
| 180 | + |
| 181 | + |
| 182 | + |
| 183 | + |
| 184 | + |
| 185 | + |
| 186 | + |
| 187 | + |
| 188 | + |
| 189 | + |
| 190 | + |
| 191 | + |
| 192 | + |
| 193 | + |
| 194 | + |
| 195 | + |
| 196 | + |
| 197 | + |
| 198 | + |
| 199 | + |
| 200 | + |
| 201 | + |
| 202 | + |
| 203 | + |
| 204 | + |
| 205 | + |
| 206 | + |
| 207 | + |
| 208 | + |
| 209 | + |
| 210 | + |
| 211 | + |
| 212 | + |
67 | 213 | |
68 | 214 | |
69 | 215 | |
| ||
1055 | 1201 | |
1056 | 1202 | |
1057 | 1203 | |
| 1204 | + |
| 1205 | + |
1058 | 1206 | |
1059 | 1207 | |
1060 | 1208 | |
| 1209 | + |
| 1210 | + |
1061 | 1211 | |
1062 | 1212 | |
1063 | 1213 | |
1064 | 1214 | |
1065 | 1215 | |
1066 | 1216 | |
1067 | | - |
| 1217 | + |
| 1218 | + |
| 1219 | + |
| 1220 | + |
| 1221 | + |
1068 | 1222 | |
1069 | 1223 | |
1070 | 1224 | |
1071 | 1225 | |
1072 | 1226 | |
1073 | 1227 | |
| 1228 | + |
1074 | 1229 | |
1075 | 1230 | |
1076 | 1231 | |
|
Collapse file
lib/internal/modules/helpers.js
Copy file name to clipboardExpand all lines: lib/internal/modules/helpers.js+53-1Lines changed: 53 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
| 7 | + |
7 | 8 | |
8 | 9 | |
9 | 10 | |
| ||
27 | 28 | |
28 | 29 | |
29 | 30 | |
30 | | - |
| 31 | + |
31 | 32 | |
32 | 33 | |
| 34 | + |
| 35 | + |
| 36 | + |
33 | 37 | |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
34 | 43 | |
35 | 44 | |
36 | 45 | |
| ||
380 | 389 | |
381 | 390 | |
382 | 391 | |
| 392 | + |
| 393 | + |
| 394 | + |
| 395 | + |
| 396 | + |
| 397 | + |
| 398 | + |
| 399 | + |
| 400 | + |
| 401 | + |
| 402 | + |
| 403 | + |
| 404 | + |
| 405 | + |
| 406 | + |
| 407 | + |
| 408 | + |
| 409 | + |
| 410 | + |
| 411 | + |
| 412 | + |
| 413 | + |
| 414 | + |
| 415 | + |
| 416 | + |
| 417 | + |
| 418 | + |
| 419 | + |
| 420 | + |
| 421 | + |
| 422 | + |
| 423 | + |
| 424 | + |
| 425 | + |
| 426 | + |
| 427 | + |
| 428 | + |
| 429 | + |
| 430 | + |
| 431 | + |
383 | 432 | |
384 | 433 | |
| 434 | + |
| 435 | + |
385 | 436 | |
386 | 437 | |
| 438 | + |
387 | 439 | |
388 | 440 | |
389 | 441 | |
|
Collapse file
+8Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
7 | 12 | |
8 | 13 | |
9 | 14 | |
10 | 15 | |
| 16 | + |
| 17 | + |
| 18 | + |
11 | 19 | |
Collapse file
+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
381 | 381 | |
382 | 382 | |
383 | 383 | |
384 | | - |
| 384 | + |
385 | 385 | |
386 | 386 | |
387 | 387 | |
| ||
391 | 391 | |
392 | 392 | |
393 | 393 | |
394 | | - |
| 394 | + |
395 | 395 | |
396 | 396 | |
397 | 397 | |
| ||
406 | 406 | |
407 | 407 | |
408 | 408 | |
409 | | - |
| 409 | + |
410 | 410 | |
411 | 411 | |
412 | 412 | |
413 | 413 | |
414 | 414 | |
415 | 415 | |
416 | | - |
| 416 | + |
417 | 417 | |
418 | 418 | |
419 | 419 | |
|
Collapse file
+4-3Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
36 | 36 | |
37 | 37 | |
38 | 38 | |
39 | | - |
40 | | - |
41 | | - |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
42 | 43 | |
43 | 44 | |
44 | 45 | |
|
0 commit comments