mirror of
https://github.com/oven-sh/bun
synced 2026-02-07 17:38:46 +00:00
Compare commits
1041 Commits
dylan/gith
...
jarred/req
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
97e2b133e3 | ||
|
|
149f097ffd | ||
|
|
3e374c0ee4 | ||
|
|
f42663ce9a | ||
|
|
c48f7e2663 | ||
|
|
b957087fe6 | ||
|
|
88d47cceb4 | ||
|
|
6259dfdfd1 | ||
|
|
0846a4fa80 | ||
|
|
2256d43a32 | ||
|
|
947634c9ed | ||
|
|
126885e1fe | ||
|
|
5353d41014 | ||
|
|
460563ee89 | ||
|
|
3c4f0920b9 | ||
|
|
6e16bb67eb | ||
|
|
e9e7645048 | ||
|
|
f2112fc0de | ||
|
|
923ac39c0b | ||
|
|
98209b8e10 | ||
|
|
4b24bb464c | ||
|
|
7d6b5f5358 | ||
|
|
9423693a6e | ||
|
|
8b9462fde5 | ||
|
|
caa90ba98e | ||
|
|
55d50565a5 | ||
|
|
dc55e11714 | ||
|
|
613bb4822e | ||
|
|
a4d0a1961a | ||
|
|
143ccdbeb6 | ||
|
|
b98f90fc6e | ||
|
|
281b810664 | ||
|
|
ffdac249ae | ||
|
|
541d16f8be | ||
|
|
b609f9be28 | ||
|
|
b473a0022d | ||
|
|
94cd68d7a6 | ||
|
|
6d5378566a | ||
|
|
c33df9e99f | ||
|
|
4dc0364201 | ||
|
|
aa4d47fe2d | ||
|
|
3a68ca775f | ||
|
|
d78ecc76c8 | ||
|
|
9e7bfdec8c | ||
|
|
f0dd5b8a43 | ||
|
|
ea47ed0ee5 | ||
|
|
36f9fd607a | ||
|
|
96a2ed1040 | ||
|
|
76deb51c29 | ||
|
|
5712fbd5b9 | ||
|
|
b5b4356d52 | ||
|
|
d1de291b2a | ||
|
|
af96e8fcdd | ||
|
|
9e1745ee1f | ||
|
|
05cb5bb659 | ||
|
|
dec5b07782 | ||
|
|
b758779c49 | ||
|
|
3a63fe457d | ||
|
|
a17624942e | ||
|
|
1ce60275d0 | ||
|
|
93a43c8fc1 | ||
|
|
bffe5e820b | ||
|
|
983d9428a6 | ||
|
|
fc539c278e | ||
|
|
d19005aa76 | ||
|
|
d2c64300f6 | ||
|
|
4cb739a8c5 | ||
|
|
01a03bcce4 | ||
|
|
6b758c809f | ||
|
|
746940d21e | ||
|
|
07b4b4ced0 | ||
|
|
e624dd6d4d | ||
|
|
ed2f24e409 | ||
|
|
c650b0b848 | ||
|
|
0514f59288 | ||
|
|
5a8cfd8390 | ||
|
|
a2d5e7c570 | ||
|
|
af0a4c5638 | ||
|
|
eec1a07907 | ||
|
|
30b0d006fe | ||
|
|
413ce0c7a5 | ||
|
|
c916a55ead | ||
|
|
31319c0177 | ||
|
|
255a805e00 | ||
|
|
eff48cd95c | ||
|
|
338565eea4 | ||
|
|
264f3b91b6 | ||
|
|
06dab241ef | ||
|
|
29cacb7da7 | ||
|
|
e05cc8db90 | ||
|
|
09357f55f9 | ||
|
|
33049fa6fd | ||
|
|
be5d21a4f1 | ||
|
|
2dc3f4e030 | ||
|
|
1a7c3cdf3b | ||
|
|
f1f7369897 | ||
|
|
4b3c483cd4 | ||
|
|
df88b998d6 | ||
|
|
b687c3ab88 | ||
|
|
d4436f278c | ||
|
|
530f5ef82c | ||
|
|
9e5efe61a3 | ||
|
|
82b2c5221b | ||
|
|
e977bfb5a7 | ||
|
|
81e11ae586 | ||
|
|
0d248568f6 | ||
|
|
96d522a7db | ||
|
|
b4989a316b | ||
|
|
8b897e1a6b | ||
|
|
730074b75d | ||
|
|
f6a4516d66 | ||
|
|
6c69c2b364 | ||
|
|
ba057e50c3 | ||
|
|
1e6dcef0c5 | ||
|
|
889462a891 | ||
|
|
3a2fd65f20 | ||
|
|
267a38f6fc | ||
|
|
011e157cac | ||
|
|
0cc56e8efc | ||
|
|
54ef58db48 | ||
|
|
476ab24081 | ||
|
|
8a2545a172 | ||
|
|
e9016415bc | ||
|
|
242aa0be12 | ||
|
|
041231d7ca | ||
|
|
bee743fd61 | ||
|
|
d7a8037899 | ||
|
|
d226a054ae | ||
|
|
aeb3bb949b | ||
|
|
db15a23a63 | ||
|
|
1cc4eb0e3f | ||
|
|
a03ee18262 | ||
|
|
108c54134c | ||
|
|
73216b10ce | ||
|
|
ff5c522712 | ||
|
|
14f87156a2 | ||
|
|
d8d4abb58e | ||
|
|
4b9b648f8a | ||
|
|
519f9aac80 | ||
|
|
a744f5369d | ||
|
|
14c6023e15 | ||
|
|
f91dc8c0d3 | ||
|
|
f4ab79d6bb | ||
|
|
373248ce9c | ||
|
|
5c37d0f2a5 | ||
|
|
7bd6a1f86d | ||
|
|
1e717dd941 | ||
|
|
e9d6a4042f | ||
|
|
c97cb4ec1e | ||
|
|
21acc50d88 | ||
|
|
b34f0da499 | ||
|
|
eb18101d84 | ||
|
|
2117723642 | ||
|
|
461ae27d31 | ||
|
|
ba7a8a9cb5 | ||
|
|
c764543af5 | ||
|
|
60fc80d4c4 | ||
|
|
6362414d65 | ||
|
|
c0c5f07218 | ||
|
|
0a91dd9f71 | ||
|
|
bed56ab406 | ||
|
|
4978a6b74d | ||
|
|
35b279a4bb | ||
|
|
c8e09f563f | ||
|
|
6baedd27bc | ||
|
|
5465a3980a | ||
|
|
b6bd7e24d7 | ||
|
|
e4e81bc49e | ||
|
|
b8aca35b76 | ||
|
|
68670eeb7b | ||
|
|
2b170c9d13 | ||
|
|
1d138057cb | ||
|
|
f788519263 | ||
|
|
8a73c2a453 | ||
|
|
21978dabe5 | ||
|
|
aa4c4a9b22 | ||
|
|
569d4940bb | ||
|
|
4af78c7d5a | ||
|
|
cfb1c661d5 | ||
|
|
864302a634 | ||
|
|
b50f3d3f6f | ||
|
|
65d646bc68 | ||
|
|
d8c467be42 | ||
|
|
fd680d6c1d | ||
|
|
f7d0eee0ac | ||
|
|
ac092a1e04 | ||
|
|
fd5bb6b201 | ||
|
|
d8360ab3cf | ||
|
|
a369fc8c89 | ||
|
|
54d6f95f43 | ||
|
|
76adc5be8a | ||
|
|
f3ab445c3f | ||
|
|
ae849528b8 | ||
|
|
6a66fffd39 | ||
|
|
9b0f12883c | ||
|
|
fcd8b82864 | ||
|
|
63d138b046 | ||
|
|
8904398619 | ||
|
|
685e298146 | ||
|
|
74cacffb0c | ||
|
|
977446ef3c | ||
|
|
1fa7c1f79e | ||
|
|
758daa7367 | ||
|
|
95cb2b2ac2 | ||
|
|
b0e0853360 | ||
|
|
f16995910a | ||
|
|
b2f3dbfd43 | ||
|
|
9f07073074 | ||
|
|
546f78a49e | ||
|
|
767fdfbb97 | ||
|
|
f0def8c770 | ||
|
|
786475ff58 | ||
|
|
b76384351c | ||
|
|
0a91490226 | ||
|
|
93585291f9 | ||
|
|
de46ad23e5 | ||
|
|
f455845a0a | ||
|
|
d5418052b1 | ||
|
|
cfceb26edd | ||
|
|
b2d90f07ba | ||
|
|
319efe9c7b | ||
|
|
52d27659a2 | ||
|
|
732c5e7fa9 | ||
|
|
5fd406ca2f | ||
|
|
31c2fea74a | ||
|
|
a5f92224b5 | ||
|
|
2bdaa81b1c | ||
|
|
8b92469d42 | ||
|
|
5915ab19fe | ||
|
|
58a5c2a3aa | ||
|
|
f3a91339fc | ||
|
|
54b62aad05 | ||
|
|
15f23d70d6 | ||
|
|
42eff1d917 | ||
|
|
02e5c5f795 | ||
|
|
2503b3409e | ||
|
|
6539f66642 | ||
|
|
4dd4bab7b9 | ||
|
|
035183eb12 | ||
|
|
aaef99ab68 | ||
|
|
1a25af5e3d | ||
|
|
343721627e | ||
|
|
6e0e140f2f | ||
|
|
0edd8d262d | ||
|
|
76622e41d6 | ||
|
|
7aa297012b | ||
|
|
9443cca1bb | ||
|
|
a83c5c996f | ||
|
|
b053dffca7 | ||
|
|
cb1b881746 | ||
|
|
9679cdb12c | ||
|
|
9ce18245d1 | ||
|
|
5a23d17620 | ||
|
|
8f02ef8294 | ||
|
|
e41e884747 | ||
|
|
1b7423412a | ||
|
|
41c4a66e4a | ||
|
|
7216bfe016 | ||
|
|
1c85e94977 | ||
|
|
25097cd632 | ||
|
|
d9711c64eb | ||
|
|
96fcecdcc9 | ||
|
|
12c4ed89e3 | ||
|
|
f1cfa5dfeb | ||
|
|
dd9ebe9c50 | ||
|
|
a9c41c67e6 | ||
|
|
1d4cc63154 | ||
|
|
c5f2b42649 | ||
|
|
37293cb26a | ||
|
|
57255ad565 | ||
|
|
2dd99a37fd | ||
|
|
baf8787fa4 | ||
|
|
d5ef247b3b | ||
|
|
b66df90b49 | ||
|
|
0befd9ad85 | ||
|
|
79a05d50ad | ||
|
|
9a5f78fa3b | ||
|
|
47865fe82a | ||
|
|
480567a5af | ||
|
|
976ef92473 | ||
|
|
abd34abf08 | ||
|
|
1f811980c3 | ||
|
|
654ba5b671 | ||
|
|
babbfc6404 | ||
|
|
86891a5d12 | ||
|
|
9b321c3b06 | ||
|
|
cb5b08b22e | ||
|
|
a4741f6fe1 | ||
|
|
ac970146b4 | ||
|
|
acd361855a | ||
|
|
b6ec31ba4b | ||
|
|
62acc096f5 | ||
|
|
7baaf2065a | ||
|
|
0f434f9457 | ||
|
|
d0522bb6a7 | ||
|
|
9b066ac6b1 | ||
|
|
7fcbffa19a | ||
|
|
fc11894235 | ||
|
|
4792abdb7f | ||
|
|
76b875e414 | ||
|
|
eb9e3e9aec | ||
|
|
851fd039da | ||
|
|
e1921ff8c5 | ||
|
|
2b5139aa46 | ||
|
|
d1d2d842d5 | ||
|
|
5d89efedec | ||
|
|
80f3bc64ed | ||
|
|
e613b501e2 | ||
|
|
6d50b90070 | ||
|
|
27f5012f50 | ||
|
|
ba994c52b8 | ||
|
|
4c38798142 | ||
|
|
f63c26208a | ||
|
|
ac9f8c0e93 | ||
|
|
8d320d1373 | ||
|
|
21f9fc828f | ||
|
|
8c91278a00 | ||
|
|
d61e90d558 | ||
|
|
a4fdc1e0d5 | ||
|
|
cc7d2cf343 | ||
|
|
d7e067902f | ||
|
|
c5e76f8bfe | ||
|
|
ebb42bb67b | ||
|
|
42edcaae8c | ||
|
|
ab02ab25b1 | ||
|
|
deb7a2b192 | ||
|
|
0fd9b2421e | ||
|
|
f22336b5b5 | ||
|
|
e16053c39e | ||
|
|
e389b6ef19 | ||
|
|
28346e4a39 | ||
|
|
95b59ea0ef | ||
|
|
24e90726fd | ||
|
|
cac4012a7e | ||
|
|
6505e5c3a4 | ||
|
|
9bf4d9b8a2 | ||
|
|
1d2b0bbc98 | ||
|
|
45ddf321b1 | ||
|
|
e84ff1d8b7 | ||
|
|
f7e4eb8369 | ||
|
|
36275a44ce | ||
|
|
68e58605b6 | ||
|
|
0a9cb0e13a | ||
|
|
b211fb1298 | ||
|
|
7f715e15cc | ||
|
|
a512bdad8d | ||
|
|
3e1d368a27 | ||
|
|
993fed51c1 | ||
|
|
d4bd156d9d | ||
|
|
c7bfb3aa3a | ||
|
|
7273713158 | ||
|
|
67422785cc | ||
|
|
42f6b35a5b | ||
|
|
665486dab8 | ||
|
|
a7cdd49244 | ||
|
|
0b4e7179b5 | ||
|
|
c34b92d16b | ||
|
|
339b811b48 | ||
|
|
adf8bae23c | ||
|
|
03997086ea | ||
|
|
cbfe17d95a | ||
|
|
f915abf3be | ||
|
|
c6b0e45a52 | ||
|
|
571ba8ef3f | ||
|
|
9963e1c3d8 | ||
|
|
9e2f6ef1be | ||
|
|
1843a37ebb | ||
|
|
f333a0c243 | ||
|
|
ffdc8a19d1 | ||
|
|
c1c8d6356f | ||
|
|
7a8a887d4b | ||
|
|
5ca4778746 | ||
|
|
28b80e6433 | ||
|
|
dcc46b2862 | ||
|
|
e4bd4d134d | ||
|
|
cfa21dc9d0 | ||
|
|
7dde3d4974 | ||
|
|
5c6cbb0283 | ||
|
|
6a1667a5f4 | ||
|
|
d77bd35556 | ||
|
|
ddb6624ad1 | ||
|
|
0eeac32ef4 | ||
|
|
31447fdc19 | ||
|
|
8e1d2a5af9 | ||
|
|
3626845051 | ||
|
|
d8d23f2594 | ||
|
|
122e6a8860 | ||
|
|
9f132ea241 | ||
|
|
7c367ff687 | ||
|
|
0f8f484e21 | ||
|
|
7e5dddd2fa | ||
|
|
838b37eed0 | ||
|
|
1f10e25bd9 | ||
|
|
18178b4e48 | ||
|
|
3456831b82 | ||
|
|
6a1701fedd | ||
|
|
3318ccfb4a | ||
|
|
9388b3f825 | ||
|
|
b469e50351 | ||
|
|
27c3579118 | ||
|
|
3852a52601 | ||
|
|
1ba007831d | ||
|
|
c0a49e405e | ||
|
|
78762e8305 | ||
|
|
57fcf8f9ba | ||
|
|
c81043bf5e | ||
|
|
156c1d4bec | ||
|
|
20930849ce | ||
|
|
efdf647460 | ||
|
|
167de9091a | ||
|
|
1be834b073 | ||
|
|
b9137dbdc8 | ||
|
|
706a3e8169 | ||
|
|
7c81d97684 | ||
|
|
6bc075e377 | ||
|
|
ba0706939d | ||
|
|
6e512eda0d | ||
|
|
1227a7b995 | ||
|
|
ef56961007 | ||
|
|
ff51a253e2 | ||
|
|
ee6f54180a | ||
|
|
cf8568ccff | ||
|
|
56ca48ece8 | ||
|
|
530cf4caf8 | ||
|
|
9a7333dd5e | ||
|
|
88b5cda109 | ||
|
|
45704a55dc | ||
|
|
714b8d10e0 | ||
|
|
931f23d360 | ||
|
|
1da8045ce4 | ||
|
|
e512be8c18 | ||
|
|
ec20fae57f | ||
|
|
fd19d01583 | ||
|
|
1826abbc65 | ||
|
|
7b9a17f9d7 | ||
|
|
bd91aa8c25 | ||
|
|
31389b4906 | ||
|
|
d93d1013a6 | ||
|
|
12d6db0cad | ||
|
|
ec7929b251 | ||
|
|
590219966e | ||
|
|
0a340d1920 | ||
|
|
56488d54d0 | ||
|
|
ae35f17a99 | ||
|
|
062b5565a7 | ||
|
|
4b62745754 | ||
|
|
0afb1693d3 | ||
|
|
7a4ac03338 | ||
|
|
630d2314b6 | ||
|
|
18cce50390 | ||
|
|
c8be1e9a5d | ||
|
|
f420e81e85 | ||
|
|
5d296f6228 | ||
|
|
16898a23e6 | ||
|
|
a55ca48797 | ||
|
|
94abc87d6e | ||
|
|
f89c4c3a0d | ||
|
|
451ccfd5ef | ||
|
|
2dd484c180 | ||
|
|
58685638e2 | ||
|
|
693be3d1c2 | ||
|
|
8ba65a4f0b | ||
|
|
4149b95543 | ||
|
|
38314c02f2 | ||
|
|
f58728ccc7 | ||
|
|
eb94e5b990 | ||
|
|
d4dfb79b72 | ||
|
|
45f4353453 | ||
|
|
735d48190d | ||
|
|
a819e3b723 | ||
|
|
8e09b1afff | ||
|
|
cf7a09c0d3 | ||
|
|
0d5d3e5dfc | ||
|
|
a931e21f49 | ||
|
|
8f67cf75ee | ||
|
|
0a7309c8f2 | ||
|
|
e6f33d9a52 | ||
|
|
e38cb9aa6a | ||
|
|
9b66e03a9b | ||
|
|
31627530b9 | ||
|
|
ae62825319 | ||
|
|
1e6faa3815 | ||
|
|
40ebc994f9 | ||
|
|
1e1b45b4d9 | ||
|
|
39fa458895 | ||
|
|
a6a0ccf6f0 | ||
|
|
0ecd773081 | ||
|
|
c72c2c2338 | ||
|
|
1836250542 | ||
|
|
1d85b5efa8 | ||
|
|
7455f385ec | ||
|
|
4c4da4aae2 | ||
|
|
3264ca991e | ||
|
|
599f63c204 | ||
|
|
26df7ca892 | ||
|
|
d33a53deb0 | ||
|
|
6d5f0167c5 | ||
|
|
f290b049e8 | ||
|
|
f0e5d54579 | ||
|
|
1c531472c9 | ||
|
|
dc8e845049 | ||
|
|
08308e2287 | ||
|
|
f366231bff | ||
|
|
e887a064fb | ||
|
|
6e4908e517 | ||
|
|
3f04f8d0a6 | ||
|
|
b5bdde28ed | ||
|
|
f54300578b | ||
|
|
5929daeeae | ||
|
|
4122cb0b19 | ||
|
|
e6e4e6b577 | ||
|
|
dc634d3b30 | ||
|
|
2c795e6a3c | ||
|
|
17f1649c87 | ||
|
|
93778a66d8 | ||
|
|
9024125d41 | ||
|
|
e687a1cf0c | ||
|
|
1d592a9489 | ||
|
|
17efd52ba3 | ||
|
|
0cf08c7e7b | ||
|
|
0143eccb27 | ||
|
|
583b29632c | ||
|
|
16ea1753b4 | ||
|
|
24d624b176 | ||
|
|
9c5f02e120 | ||
|
|
2a1558e4d6 | ||
|
|
0911bd3af2 | ||
|
|
9f53a2210c | ||
|
|
575291a301 | ||
|
|
ac3973016f | ||
|
|
9b5ddef598 | ||
|
|
424045835c | ||
|
|
e8c9c644ca | ||
|
|
629be18867 | ||
|
|
9be68ac235 | ||
|
|
ee60a5c55c | ||
|
|
2dc85c4e45 | ||
|
|
88c238dc5c | ||
|
|
12b2ad7363 | ||
|
|
d786dd6c0b | ||
|
|
e21796acf5 | ||
|
|
f6705a73c7 | ||
|
|
8bcf64c881 | ||
|
|
bcb7be4909 | ||
|
|
c006a7f054 | ||
|
|
8aa6ee5332 | ||
|
|
963bb54e87 | ||
|
|
8ff1ff16a5 | ||
|
|
7285b9cf75 | ||
|
|
7416672e93 | ||
|
|
fa10631c2f | ||
|
|
1106c8e2f2 | ||
|
|
20d9483cd0 | ||
|
|
155e3706b1 | ||
|
|
44cdb1ec8e | ||
|
|
d406ca6328 | ||
|
|
e542d9b4ed | ||
|
|
fb313f210a | ||
|
|
c60d7db178 | ||
|
|
d37daeb76a | ||
|
|
79f7d29d03 | ||
|
|
56b75dbac3 | ||
|
|
5007c6b218 | ||
|
|
d95404fd7a | ||
|
|
7762f3fad7 | ||
|
|
e7cd45d0fa | ||
|
|
0e688d62f9 | ||
|
|
ce01a31e94 | ||
|
|
37fafc208f | ||
|
|
88a8aa4797 | ||
|
|
610eb06ddc | ||
|
|
49cd122bda | ||
|
|
1125728097 | ||
|
|
597053ea91 | ||
|
|
1c221d33b0 | ||
|
|
e67b4e73b5 | ||
|
|
95e727162b | ||
|
|
e860e12be5 | ||
|
|
ad0bee532c | ||
|
|
c7d16d2ed5 | ||
|
|
d150a73b9b | ||
|
|
0d7cea69c2 | ||
|
|
c83eaf09b9 | ||
|
|
4320108add | ||
|
|
d91052516e | ||
|
|
c6ee401bf4 | ||
|
|
f19e3d66cb | ||
|
|
e63e3a0ca7 | ||
|
|
5598ea69f2 | ||
|
|
4dc6bf1b09 | ||
|
|
7597e4ad2a | ||
|
|
a80981c966 | ||
|
|
6e1a52691a | ||
|
|
ef75cd4658 | ||
|
|
af3f42e630 | ||
|
|
37186f4b0a | ||
|
|
f310d7414b | ||
|
|
739de2c9cd | ||
|
|
0db8cdf4e9 | ||
|
|
246db4fed0 | ||
|
|
aa0762e466 | ||
|
|
cdbc620104 | ||
|
|
bb2aaa36fb | ||
|
|
f4f88701c5 | ||
|
|
cc214baacf | ||
|
|
83473c60df | ||
|
|
8b4e58f3d2 | ||
|
|
30e82c5df4 | ||
|
|
9eba1e0e3f | ||
|
|
675529bd0c | ||
|
|
5528c0fa47 | ||
|
|
c208c4e319 | ||
|
|
10650cced2 | ||
|
|
8466e60e3a | ||
|
|
b1aac9ff6d | ||
|
|
ed2e0e1617 | ||
|
|
09585c4b24 | ||
|
|
5181aa54e2 | ||
|
|
995880a7ef | ||
|
|
941c6ed814 | ||
|
|
6052a3edbd | ||
|
|
6fd7c1921e | ||
|
|
119120d21c | ||
|
|
4bedd3833d | ||
|
|
2abfa8abd2 | ||
|
|
ad9d4fb0c4 | ||
|
|
523b112945 | ||
|
|
8aa29040e6 | ||
|
|
a2afb252bf | ||
|
|
abb89f489f | ||
|
|
ddec9e0bf6 | ||
|
|
4962bea4fc | ||
|
|
f31330d3e2 | ||
|
|
ee8ccca605 | ||
|
|
6fdbb25f9a | ||
|
|
b8c0554839 | ||
|
|
18807cef03 | ||
|
|
cbc28afd51 | ||
|
|
7886bce8c8 | ||
|
|
7cd26232b1 | ||
|
|
a0b0cd6844 | ||
|
|
52f9c3d05e | ||
|
|
f947987a2c | ||
|
|
30106c4f54 | ||
|
|
34b2d7fe57 | ||
|
|
153834cf5c | ||
|
|
6aea31f4fc | ||
|
|
0fd144993c | ||
|
|
6699fe14e7 | ||
|
|
add7b1101e | ||
|
|
5a19f8434b | ||
|
|
d5f3bb1c74 | ||
|
|
08e33fbd42 | ||
|
|
7ddbbc53b4 | ||
|
|
85611272c6 | ||
|
|
c40912b8dc | ||
|
|
77974f2a6e | ||
|
|
ed72bee373 | ||
|
|
05f3a22cba | ||
|
|
f5df1044d4 | ||
|
|
4329f6ad16 | ||
|
|
fd4668d97c | ||
|
|
8c4ed963ec | ||
|
|
e7f9ce47f4 | ||
|
|
98022bec1e | ||
|
|
397f559e77 | ||
|
|
ca2e708be1 | ||
|
|
8649136845 | ||
|
|
e8fe6dd2f8 | ||
|
|
df126b2f3b | ||
|
|
7d3a2ca382 | ||
|
|
b7c96bfaae | ||
|
|
a2fd20e5c0 | ||
|
|
de613baf81 | ||
|
|
4590e2b83a | ||
|
|
2758e0cab9 | ||
|
|
7d386bf1f1 | ||
|
|
164cd774f7 | ||
|
|
6469649f64 | ||
|
|
06d073003d | ||
|
|
50f1dd61a6 | ||
|
|
c64d7933a1 | ||
|
|
b289b51894 | ||
|
|
17ad8005c7 | ||
|
|
f572305013 | ||
|
|
17b4e5ce08 | ||
|
|
3933ccab3b | ||
|
|
92255d56c8 | ||
|
|
ba076b0a2b | ||
|
|
10600c4abd | ||
|
|
d16dffa2b4 | ||
|
|
65e0d10ee0 | ||
|
|
742368f03a | ||
|
|
242dcea2fe | ||
|
|
198322073d | ||
|
|
b12762af6c | ||
|
|
440a21eb1d | ||
|
|
2bc4858346 | ||
|
|
26d15cf542 | ||
|
|
8361513acf | ||
|
|
19eca76498 | ||
|
|
3c23f9ad57 | ||
|
|
76f3c9c07b | ||
|
|
3a3bf33335 | ||
|
|
69ee87d8e2 | ||
|
|
6d0fff4fab | ||
|
|
f7a93fe294 | ||
|
|
02fc87ea29 | ||
|
|
7f853af6f0 | ||
|
|
04309431bb | ||
|
|
fc712ead2f | ||
|
|
e7f2d34c44 | ||
|
|
0c3e55132c | ||
|
|
c69bbbd24f | ||
|
|
c0bfdebbd9 | ||
|
|
9c27b5d17f | ||
|
|
9973df028b | ||
|
|
a0be199b4f | ||
|
|
73d6c888b9 | ||
|
|
661fca9cde | ||
|
|
b0803298f9 | ||
|
|
6318017f84 | ||
|
|
696d4b6267 | ||
|
|
cc4326cd82 | ||
|
|
c57b37d29f | ||
|
|
b09896f06e | ||
|
|
b7816f3175 | ||
|
|
0dfde6f8c7 | ||
|
|
0788bc1d94 | ||
|
|
28a7f27633 | ||
|
|
b2daf3c982 | ||
|
|
9598868b57 | ||
|
|
79b32f80fa | ||
|
|
4bfdad2981 | ||
|
|
3ddd8b2fa5 | ||
|
|
da598a3f37 | ||
|
|
ad3295668f | ||
|
|
f9fd7e9d08 | ||
|
|
8b8bd6a405 | ||
|
|
aa10799d8a | ||
|
|
ec2c16fefa | ||
|
|
c11bb93552 | ||
|
|
5c30983d5d | ||
|
|
c9ca729493 | ||
|
|
9cd9df698a | ||
|
|
57edf3d91f | ||
|
|
f9b14dc87b | ||
|
|
a9bdc0fd44 | ||
|
|
703bee976b | ||
|
|
eb5105aa09 | ||
|
|
552a1940eb | ||
|
|
98becc3538 | ||
|
|
49d8316922 | ||
|
|
7a496fa41a | ||
|
|
4211f733d1 | ||
|
|
44eec0c5bb | ||
|
|
ac64d87a1c | ||
|
|
8e52e36846 | ||
|
|
348e72356b | ||
|
|
035d31904a | ||
|
|
192629c8ca | ||
|
|
75181ea1f3 | ||
|
|
d9c1a18776 | ||
|
|
f087388ebc | ||
|
|
48eb0c12ab | ||
|
|
fe389ad5ab | ||
|
|
97b637a0bc | ||
|
|
7e9c88aa41 | ||
|
|
07258bd559 | ||
|
|
0646efbf30 | ||
|
|
517bdbdd0c | ||
|
|
7f8be29f25 | ||
|
|
7db4b90837 | ||
|
|
cd48346ca8 | ||
|
|
1b6a99636d | ||
|
|
188c1f1f75 | ||
|
|
812490e4a4 | ||
|
|
128a293901 | ||
|
|
6557df2912 | ||
|
|
aff91436c0 | ||
|
|
8075158639 | ||
|
|
2757dc5e1b | ||
|
|
cd90342a76 | ||
|
|
8d622ad541 | ||
|
|
ed5bcf17fc | ||
|
|
9e46ca19d8 | ||
|
|
866646a98e | ||
|
|
4118c3d0a6 | ||
|
|
6029a57d0b | ||
|
|
309b741aa1 | ||
|
|
d90a00857b | ||
|
|
5ab2c8e4d6 | ||
|
|
c194f15418 | ||
|
|
3be8a4733a | ||
|
|
3243936d3e | ||
|
|
ec1ba91c38 | ||
|
|
ea55ef504b | ||
|
|
34b643e654 | ||
|
|
2e1c7f5597 | ||
|
|
6cccc0d26c | ||
|
|
0147647e06 | ||
|
|
ec010e4930 | ||
|
|
41af4b43e2 | ||
|
|
c1d05cf623 | ||
|
|
724f23c19f | ||
|
|
ddca89f425 | ||
|
|
805e87eeb6 | ||
|
|
8dc1140f43 | ||
|
|
b136125bb0 | ||
|
|
1da7f5fe5d | ||
|
|
655c19b07c | ||
|
|
ed5bcfc76b | ||
|
|
421588d631 | ||
|
|
915b46768c | ||
|
|
7169bbbb9c | ||
|
|
6d06606135 | ||
|
|
44c6ce11c4 | ||
|
|
b32b0b8736 | ||
|
|
fbe45fcb03 | ||
|
|
2c23d8736f | ||
|
|
f14032e4b4 | ||
|
|
d912214719 | ||
|
|
6c9e7de824 | ||
|
|
f8f989f667 | ||
|
|
781df80a90 | ||
|
|
b26ff0074d | ||
|
|
0a8e42a4ba | ||
|
|
b767f9a99a | ||
|
|
f61ee1ed42 | ||
|
|
a8743f0a34 | ||
|
|
468226fc90 | ||
|
|
9cb1ec2c58 | ||
|
|
0f2c9c9ff3 | ||
|
|
ed2a57fcc9 | ||
|
|
81b6878e1a | ||
|
|
325ffd70e1 | ||
|
|
d4ce045f9e | ||
|
|
7f65875406 | ||
|
|
ce38365106 | ||
|
|
a3cc911e7a | ||
|
|
ac7aff1b47 | ||
|
|
d714df48f9 | ||
|
|
fb1902448e | ||
|
|
f43b675200 | ||
|
|
e47fe2ca00 | ||
|
|
2edbf4d0ec | ||
|
|
645b7271f9 | ||
|
|
77c72b3193 | ||
|
|
34f97be86a | ||
|
|
2ffe77140e | ||
|
|
be79f6e893 | ||
|
|
bb5119f7eb | ||
|
|
6f682c6369 | ||
|
|
05b1ce39d2 | ||
|
|
6cf87d022f | ||
|
|
6c3842f67d | ||
|
|
63403741ff | ||
|
|
66643a5b57 | ||
|
|
e2f709b2a5 | ||
|
|
4ea104f5bd | ||
|
|
0fe7f7b6f0 | ||
|
|
566a2c668b | ||
|
|
ad692495a1 | ||
|
|
2c31beda75 | ||
|
|
cd684fdad0 | ||
|
|
ad40eec079 | ||
|
|
90d62ecc24 | ||
|
|
cab1f860e4 | ||
|
|
7ca867f7c8 | ||
|
|
fe03e90d80 | ||
|
|
f992942391 | ||
|
|
7420cb1d73 | ||
|
|
73961a1494 | ||
|
|
d7b5e4b901 | ||
|
|
efc024cfc4 | ||
|
|
b3533fb3a8 | ||
|
|
79c0b614ee | ||
|
|
f5cda8ff18 | ||
|
|
4570ff7780 | ||
|
|
aa456805dd | ||
|
|
efd33c398f | ||
|
|
9a2b586337 | ||
|
|
df999306c0 | ||
|
|
45296570ce | ||
|
|
f9306ff815 | ||
|
|
c530ead1e0 | ||
|
|
f6227bf6dd | ||
|
|
4f84c6bc34 | ||
|
|
d141783ebd | ||
|
|
d4ef935478 | ||
|
|
bf68df0070 | ||
|
|
407088f6ab | ||
|
|
2cce810190 | ||
|
|
eaea08ea45 | ||
|
|
4dfc09018f | ||
|
|
771db64cbe | ||
|
|
c6b941d803 | ||
|
|
3492248697 | ||
|
|
bc7192dca1 | ||
|
|
188f472ed2 | ||
|
|
befd97a891 | ||
|
|
481dbf7c6e | ||
|
|
8d692f1511 | ||
|
|
c08b546728 | ||
|
|
fefa4a1623 | ||
|
|
043e408b15 | ||
|
|
9f6658b981 | ||
|
|
5ce2b8e604 | ||
|
|
ee9893c4e1 | ||
|
|
8b0e2efd6e | ||
|
|
4d1e977399 | ||
|
|
0ee13892fd | ||
|
|
99d2d6e607 | ||
|
|
a2cfdf0e1c | ||
|
|
29a576a167 | ||
|
|
6424ce6397 | ||
|
|
fdb9472f88 | ||
|
|
17bde9bc86 | ||
|
|
fd29d05c6a | ||
|
|
f475802206 | ||
|
|
f0fa760479 | ||
|
|
24e8aa105f | ||
|
|
ed421855d7 | ||
|
|
627da44527 | ||
|
|
9955b74622 | ||
|
|
d955bfe50f | ||
|
|
b8648adf87 | ||
|
|
ff6fb587f6 | ||
|
|
e361ed4451 | ||
|
|
42e9f6e0b1 | ||
|
|
e3ed905b0a | ||
|
|
224312c014 | ||
|
|
bdf792adbc | ||
|
|
3c6616a23d | ||
|
|
ff7e984f0a | ||
|
|
3a100af876 | ||
|
|
7d7b535014 | ||
|
|
a98b1751a6 | ||
|
|
03ab4be9ee | ||
|
|
f993975ae6 | ||
|
|
53f7bd32d8 | ||
|
|
784496b773 | ||
|
|
4c0b0e2e8e | ||
|
|
bab7e63d7c | ||
|
|
3511a4b5be | ||
|
|
e485f7bb51 | ||
|
|
795cde6d62 | ||
|
|
9dfbf57397 | ||
|
|
e04fe64a82 | ||
|
|
495c70053f | ||
|
|
9bcd4952ce | ||
|
|
8745f10cd3 | ||
|
|
ac0dab3679 | ||
|
|
01c97e4033 | ||
|
|
cd5f2ab11f | ||
|
|
61736966ad | ||
|
|
8bdcded5c1 | ||
|
|
c0ec61cf16 | ||
|
|
d4e323b997 | ||
|
|
58cbd6b211 | ||
|
|
d8d148e3bb | ||
|
|
311185f6d6 | ||
|
|
7012d2fb74 | ||
|
|
2db04ef9d9 | ||
|
|
4cb6a34432 | ||
|
|
2016e8a0af | ||
|
|
0759530118 | ||
|
|
5ed46913c4 | ||
|
|
bd5b90fbf1 | ||
|
|
bba4054da3 | ||
|
|
d16951422b | ||
|
|
e0eeb1c07e | ||
|
|
216e872801 | ||
|
|
6fbf437f50 | ||
|
|
c00fadab9e | ||
|
|
9b260fb18b | ||
|
|
b931c19ba3 | ||
|
|
9e403fc8bf | ||
|
|
fd0edd7aa0 | ||
|
|
848658c533 | ||
|
|
37d2a98331 | ||
|
|
58d1ab02bd | ||
|
|
9f0d402a7d | ||
|
|
f927567b9f | ||
|
|
94ea41a60b | ||
|
|
8235e59a7f | ||
|
|
8924c521ba | ||
|
|
69875d86cd | ||
|
|
5bdc923838 | ||
|
|
25a2962186 | ||
|
|
c943dbadef | ||
|
|
aacaa9b85d | ||
|
|
74992f6f34 | ||
|
|
12b8416b64 | ||
|
|
8a5ff676ea | ||
|
|
f660f8d22f | ||
|
|
38cc947621 | ||
|
|
0546aa4fd5 | ||
|
|
b8b7ad4982 | ||
|
|
d21119b347 | ||
|
|
d3de366c67 | ||
|
|
a1b581621c | ||
|
|
274ae5de1b | ||
|
|
74b0a1939d | ||
|
|
6f432e8b7d | ||
|
|
a5f7a23307 | ||
|
|
88a8614abc | ||
|
|
b23327c283 | ||
|
|
c83d56c75d | ||
|
|
7dd28bbdd9 | ||
|
|
d54e23ca33 | ||
|
|
02f0212cbd | ||
|
|
3484502839 | ||
|
|
a345efd270 | ||
|
|
30bfb31bce | ||
|
|
eef0e8c6bf | ||
|
|
4648131c41 | ||
|
|
b0702ce7b1 | ||
|
|
ff3f5aa154 | ||
|
|
91bcfa9cb4 | ||
|
|
cf5f9df211 | ||
|
|
9eb4a4ff3a | ||
|
|
7932a55870 | ||
|
|
893ec2fb45 | ||
|
|
136014b13a | ||
|
|
d01ec47529 | ||
|
|
7fa023b8b5 | ||
|
|
aa9e56edfe | ||
|
|
88ffdc5fec | ||
|
|
fab42148e4 | ||
|
|
cce380ec37 | ||
|
|
828fd0cfea | ||
|
|
168bb1427f | ||
|
|
996ef44c02 | ||
|
|
734b5b89da | ||
|
|
490814aa35 | ||
|
|
ffa8913e54 | ||
|
|
73e9cd8e06 | ||
|
|
62cab3c719 | ||
|
|
d4f1d29393 | ||
|
|
2eac47a123 |
@@ -1,28 +0,0 @@
|
||||
# Bun's Dev Container
|
||||
|
||||
To get started, login to GitHub and clone bun's GitHub repo into `/build/bun`
|
||||
|
||||
# First time setup
|
||||
|
||||
```bash
|
||||
gh auth login # if it fails to open a browser, use Personal Access Token instead
|
||||
gh repo clone oven-sh/bun . -- --depth=1 --progress -j8
|
||||
```
|
||||
|
||||
# Compile bun dependencies (zig is already compiled)
|
||||
|
||||
```bash
|
||||
make devcontainer
|
||||
```
|
||||
|
||||
# Build bun for development
|
||||
|
||||
```bash
|
||||
make dev
|
||||
```
|
||||
|
||||
# Run bun
|
||||
|
||||
```bash
|
||||
bun-debug help
|
||||
```
|
||||
@@ -1,70 +0,0 @@
|
||||
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
|
||||
// https://github.com/microsoft/vscode-dev-containers/tree/v0.209.6/containers/docker-existing-dockerfile
|
||||
{
|
||||
"name": "bun (Ubuntu)",
|
||||
|
||||
// Sets the run context to one level up instead of the .devcontainer folder.
|
||||
"context": "..",
|
||||
"hostRequirements": { "memory": "16gb" },
|
||||
|
||||
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
|
||||
"dockerFile": "../Dockerfile.devcontainer",
|
||||
|
||||
// Set *default* container specific settings.json values on container create.
|
||||
"settings": {
|
||||
"terminal.integrated.shell.linux": "/bin/zsh",
|
||||
"zigLanguageClient.path": "/home/ubuntu/zls/zig-out/bin/zls",
|
||||
"zig.zigPath": "/build/zig/zig",
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
},
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"AugusteRame.zls-vscode",
|
||||
"ms-vscode.cpptools",
|
||||
"/home/ubuntu/vscode-zig.vsix",
|
||||
"vadimcn.vscode-lldb",
|
||||
"esbenp.prettier-vscode",
|
||||
"xaver.clang-format"
|
||||
],
|
||||
"postCreateCommand": "cd /build/bun; bash /build/getting-started.sh; cat /build/README.md",
|
||||
|
||||
"build": {
|
||||
"target": "bun.devcontainer",
|
||||
"cacheFrom": ["ghcr.io/oven-sh/bun.devcontainer:latest"],
|
||||
"args": {
|
||||
"BUILDARCH": "${localEnv:DOCKER_BUILDARCH:amd64}",
|
||||
"--platform": "linux/${localEnv:DOCKER_BUILDARCH:amd64}",
|
||||
"--tag": "ghcr.io/oven-sh/bun.devcontainer:latest"
|
||||
}
|
||||
},
|
||||
"runArgs": [
|
||||
"--ulimit",
|
||||
"memlock=-1:-1",
|
||||
"--ulimit",
|
||||
"nofile=65536:65536",
|
||||
"--cap-add=SYS_PTRACE",
|
||||
"--security-opt",
|
||||
"seccomp=unconfined"
|
||||
],
|
||||
"workspaceMount": "source=bun,target=/build/bun,type=volume",
|
||||
"workspaceFolder": "/build/bun",
|
||||
"mounts": [
|
||||
"source=bun-install,target=/home/ubuntu/.bun,type=volume",
|
||||
"source=bun-config,target=/home/ubuntu/.config,type=volume"
|
||||
],
|
||||
|
||||
// Use 'forwardPorts' to make a list of ports inside the container available locally.
|
||||
"forwardPorts": [3000, 8081, 8080]
|
||||
|
||||
// Uncomment the next line to run commands after the container is created - for example installing curl.
|
||||
// "postCreateCommand": "apt-get update && apt-get install -y curl",
|
||||
|
||||
// Uncomment when using a ptrace-based debugger like C++, Go, and Rust
|
||||
|
||||
// Uncomment to use the Docker CLI from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker.
|
||||
// "mounts": [ "source=/var/run/docker.sock,target=/var/run/docker.sock,type=bind" ],
|
||||
|
||||
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
|
||||
// "remoteUser": "vscode"
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
# /etc/security/limits.conf
|
||||
#
|
||||
#Each line describes a limit for a user in the form:
|
||||
#
|
||||
#<domain> <type> <item> <value>
|
||||
#
|
||||
#Where:
|
||||
#<domain> can be:
|
||||
# - a user name
|
||||
# - a group name, with @group syntax
|
||||
# - the wildcard *, for default entry
|
||||
# - the wildcard %, can be also used with %group syntax,
|
||||
# for maxlogin limit
|
||||
# - NOTE: group and wildcard limits are not applied to root.
|
||||
# To apply a limit to the root user, <domain> must be
|
||||
# the literal username root.
|
||||
#
|
||||
#<type> can have the two values:
|
||||
# - "soft" for enforcing the soft limits
|
||||
# - "hard" for enforcing hard limits
|
||||
#
|
||||
#<item> can be one of the following:
|
||||
# - core - limits the core file size (KB)
|
||||
# - data - max data size (KB)
|
||||
# - fsize - maximum filesize (KB)
|
||||
# - memlock - max locked-in-memory address space (KB)
|
||||
# - nofile - max number of open file descriptors
|
||||
# - rss - max resident set size (KB)
|
||||
# - stack - max stack size (KB)
|
||||
# - cpu - max CPU time (MIN)
|
||||
# - nproc - max number of processes
|
||||
# - as - address space limit (KB)
|
||||
# - maxlogins - max number of logins for this user
|
||||
# - maxsyslogins - max number of logins on the system
|
||||
# - priority - the priority to run user process with
|
||||
# - locks - max number of file locks the user can hold
|
||||
# - sigpending - max number of pending signals
|
||||
# - msgqueue - max memory used by POSIX message queues (bytes)
|
||||
# - nice - max nice priority allowed to raise to values: [-20, 19]
|
||||
# - rtprio - max realtime priority
|
||||
# - chroot - change root to directory (Debian-specific)
|
||||
#
|
||||
#<domain> <type> <item> <value>
|
||||
#
|
||||
|
||||
* soft memlock 33554432
|
||||
* hard memlock 33554432
|
||||
* soft nofile 33554432
|
||||
* hard nofile 33554432
|
||||
|
||||
#* soft core 0
|
||||
#root hard core 100000
|
||||
#* hard rss 10000
|
||||
#@student hard nproc 20
|
||||
#@faculty soft nproc 20
|
||||
#@faculty hard nproc 50
|
||||
#ftp hard nproc 0
|
||||
#ftp - chroot /ftp
|
||||
#@student - maxlogins 4
|
||||
|
||||
# End of file
|
||||
@@ -1,454 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/common.md
|
||||
# Maintainer: The VS Code and Codespaces Teams
|
||||
#
|
||||
# Syntax: ./common-debian.sh [install zsh flag] [username] [user UID] [user GID] [upgrade packages flag] [install Oh My Zsh! flag] [Add non-free packages]
|
||||
|
||||
set -e
|
||||
|
||||
INSTALL_ZSH=${1:-"true"}
|
||||
USERNAME=${2:-"automatic"}
|
||||
USER_UID=${3:-"automatic"}
|
||||
USER_GID=${4:-"automatic"}
|
||||
UPGRADE_PACKAGES=${5:-"true"}
|
||||
INSTALL_OH_MYS=${6:-"true"}
|
||||
ADD_NON_FREE_PACKAGES=${7:-"false"}
|
||||
SCRIPT_DIR="$(cd $(dirname "${BASH_SOURCE[0]}") && pwd)"
|
||||
MARKER_FILE="/usr/local/etc/vscode-dev-containers/common"
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ensure that login shells get the correct path if the user updated the PATH using ENV.
|
||||
rm -f /etc/profile.d/00-restore-env.sh
|
||||
echo "export PATH=${PATH//$(sh -lc 'echo $PATH')/\$PATH}" > /etc/profile.d/00-restore-env.sh
|
||||
chmod +x /etc/profile.d/00-restore-env.sh
|
||||
|
||||
# If in automatic mode, determine if a user already exists, if not use vscode
|
||||
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
|
||||
USERNAME=""
|
||||
POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)")
|
||||
for CURRENT_USER in ${POSSIBLE_USERS[@]}; do
|
||||
if id -u ${CURRENT_USER} > /dev/null 2>&1; then
|
||||
USERNAME=${CURRENT_USER}
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ "${USERNAME}" = "" ]; then
|
||||
USERNAME=vscode
|
||||
fi
|
||||
elif [ "${USERNAME}" = "none" ]; then
|
||||
USERNAME=root
|
||||
USER_UID=0
|
||||
USER_GID=0
|
||||
fi
|
||||
|
||||
# Load markers to see which steps have already run
|
||||
if [ -f "${MARKER_FILE}" ]; then
|
||||
echo "Marker file found:"
|
||||
cat "${MARKER_FILE}"
|
||||
source "${MARKER_FILE}"
|
||||
fi
|
||||
|
||||
# Ensure apt is in non-interactive to avoid prompts
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Function to call apt-get if needed
|
||||
apt_get_update_if_needed()
|
||||
{
|
||||
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
|
||||
echo "Running apt-get update..."
|
||||
apt-get update
|
||||
else
|
||||
echo "Skipping apt-get update."
|
||||
fi
|
||||
}
|
||||
|
||||
# Run install apt-utils to avoid debconf warning then verify presence of other common developer tools and dependencies
|
||||
if [ "${PACKAGES_ALREADY_INSTALLED}" != "true" ]; then
|
||||
|
||||
package_list="apt-utils \
|
||||
openssh-client \
|
||||
gnupg2 \
|
||||
dirmngr \
|
||||
iproute2 \
|
||||
procps \
|
||||
lsof \
|
||||
htop \
|
||||
net-tools \
|
||||
psmisc \
|
||||
curl \
|
||||
wget \
|
||||
rsync \
|
||||
ca-certificates \
|
||||
unzip \
|
||||
zip \
|
||||
nano \
|
||||
vim-tiny \
|
||||
less \
|
||||
jq \
|
||||
lsb-release \
|
||||
apt-transport-https \
|
||||
dialog \
|
||||
libc6 \
|
||||
libgcc1 \
|
||||
libkrb5-3 \
|
||||
libgssapi-krb5-2 \
|
||||
libicu[0-9][0-9] \
|
||||
liblttng-ust[0-9] \
|
||||
libstdc++6 \
|
||||
zlib1g \
|
||||
locales \
|
||||
sudo \
|
||||
ncdu \
|
||||
man-db \
|
||||
strace \
|
||||
manpages \
|
||||
manpages-dev \
|
||||
init-system-helpers"
|
||||
|
||||
# Needed for adding manpages-posix and manpages-posix-dev which are non-free packages in Debian
|
||||
if [ "${ADD_NON_FREE_PACKAGES}" = "true" ]; then
|
||||
# Bring in variables from /etc/os-release like VERSION_CODENAME
|
||||
. /etc/os-release
|
||||
sed -i -E "s/deb http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME} main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME} main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i -E "s/deb-src http:\/\/(deb|httredir)\.debian\.org\/debian ${VERSION_CODENAME} main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME} main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i -E "s/deb http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME}-updates main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME}-updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i -E "s/deb-src http:\/\/(deb|httpredir)\.debian\.org\/debian ${VERSION_CODENAME}-updates main/deb http:\/\/\1\.debian\.org\/debian ${VERSION_CODENAME}-updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb-src http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}\/updates main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb-src http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main/deb http:\/\/deb\.debian\.org\/debian ${VERSION_CODENAME}-backports main contrib non-free/" /etc/apt/sources.list
|
||||
# Handle bullseye location for security https://www.debian.org/releases/bullseye/amd64/release-notes/ch-information.en.html
|
||||
sed -i "s/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main contrib non-free/" /etc/apt/sources.list
|
||||
sed -i "s/deb-src http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main/deb http:\/\/security\.debian\.org\/debian-security ${VERSION_CODENAME}-security main contrib non-free/" /etc/apt/sources.list
|
||||
echo "Running apt-get update..."
|
||||
apt-get update
|
||||
package_list="${package_list} manpages-posix manpages-posix-dev"
|
||||
else
|
||||
apt_get_update_if_needed
|
||||
fi
|
||||
|
||||
# Install libssl1.1 if available
|
||||
if [[ ! -z $(apt-cache --names-only search ^libssl1.1$) ]]; then
|
||||
package_list="${package_list} libssl1.1"
|
||||
fi
|
||||
|
||||
# Install appropriate version of libssl1.0.x if available
|
||||
libssl_package=$(dpkg-query -f '${db:Status-Abbrev}\t${binary:Package}\n' -W 'libssl1\.0\.?' 2>&1 || echo '')
|
||||
if [ "$(echo "$LIlibssl_packageBSSL" | grep -o 'libssl1\.0\.[0-9]:' | uniq | sort | wc -l)" -eq 0 ]; then
|
||||
if [[ ! -z $(apt-cache --names-only search ^libssl1.0.2$) ]]; then
|
||||
# Debian 9
|
||||
package_list="${package_list} libssl1.0.2"
|
||||
elif [[ ! -z $(apt-cache --names-only search ^libssl1.0.0$) ]]; then
|
||||
# Ubuntu 18.04, 16.04, earlier
|
||||
package_list="${package_list} libssl1.0.0"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Packages to verify are installed: ${package_list}"
|
||||
apt-get -y install --no-install-recommends ${package_list} 2> >( grep -v 'debconf: delaying package configuration, since apt-utils is not installed' >&2 )
|
||||
|
||||
# Install git if not already installed (may be more recent than distro version)
|
||||
if ! type git > /dev/null 2>&1; then
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
PACKAGES_ALREADY_INSTALLED="true"
|
||||
fi
|
||||
|
||||
# Get to latest versions of all packages
|
||||
if [ "${UPGRADE_PACKAGES}" = "true" ]; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y upgrade --no-install-recommends
|
||||
apt-get autoremove -y
|
||||
fi
|
||||
|
||||
# Ensure at least the en_US.UTF-8 UTF-8 locale is available.
|
||||
# Common need for both applications and things like the agnoster ZSH theme.
|
||||
if [ "${LOCALE_ALREADY_SET}" != "true" ] && ! grep -o -E '^\s*en_US.UTF-8\s+UTF-8' /etc/locale.gen > /dev/null; then
|
||||
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
|
||||
locale-gen
|
||||
LOCALE_ALREADY_SET="true"
|
||||
fi
|
||||
|
||||
# Create or update a non-root user to match UID/GID.
|
||||
group_name="${USERNAME}"
|
||||
if id -u ${USERNAME} > /dev/null 2>&1; then
|
||||
# User exists, update if needed
|
||||
if [ "${USER_GID}" != "automatic" ] && [ "$USER_GID" != "$(id -g $USERNAME)" ]; then
|
||||
group_name="$(id -gn $USERNAME)"
|
||||
groupmod --gid $USER_GID ${group_name}
|
||||
usermod --gid $USER_GID $USERNAME
|
||||
fi
|
||||
if [ "${USER_UID}" != "automatic" ] && [ "$USER_UID" != "$(id -u $USERNAME)" ]; then
|
||||
usermod --uid $USER_UID $USERNAME
|
||||
fi
|
||||
else
|
||||
# Create user
|
||||
if [ "${USER_GID}" = "automatic" ]; then
|
||||
groupadd $USERNAME
|
||||
else
|
||||
groupadd --gid $USER_GID $USERNAME
|
||||
fi
|
||||
if [ "${USER_UID}" = "automatic" ]; then
|
||||
useradd -s /bin/bash --gid $USERNAME -m $USERNAME
|
||||
else
|
||||
useradd -s /bin/bash --uid $USER_UID --gid $USERNAME -m $USERNAME
|
||||
fi
|
||||
fi
|
||||
|
||||
# Add sudo support for non-root user
|
||||
if [ "${USERNAME}" != "root" ] && [ "${EXISTING_NON_ROOT_USER}" != "${USERNAME}" ]; then
|
||||
echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME
|
||||
chmod 0440 /etc/sudoers.d/$USERNAME
|
||||
EXISTING_NON_ROOT_USER="${USERNAME}"
|
||||
fi
|
||||
|
||||
# ** Shell customization section **
|
||||
if [ "${USERNAME}" = "root" ]; then
|
||||
user_rc_path="/root"
|
||||
else
|
||||
user_rc_path="/home/${USERNAME}"
|
||||
fi
|
||||
|
||||
# Restore user .bashrc defaults from skeleton file if it doesn't exist or is empty
|
||||
if [ ! -f "${user_rc_path}/.bashrc" ] || [ ! -s "${user_rc_path}/.bashrc" ] ; then
|
||||
cp /etc/skel/.bashrc "${user_rc_path}/.bashrc"
|
||||
fi
|
||||
|
||||
# Restore user .profile defaults from skeleton file if it doesn't exist or is empty
|
||||
if [ ! -f "${user_rc_path}/.profile" ] || [ ! -s "${user_rc_path}/.profile" ] ; then
|
||||
cp /etc/skel/.profile "${user_rc_path}/.profile"
|
||||
fi
|
||||
|
||||
# .bashrc/.zshrc snippet
|
||||
rc_snippet="$(cat << 'EOF'
|
||||
|
||||
if [ -z "${USER}" ]; then export USER=$(whoami); fi
|
||||
if [[ "${PATH}" != *"$HOME/.local/bin"* ]]; then export PATH="${PATH}:$HOME/.local/bin"; fi
|
||||
|
||||
# Display optional first run image specific notice if configured and terminal is interactive
|
||||
if [ -t 1 ] && [[ "${TERM_PROGRAM}" = "vscode" || "${TERM_PROGRAM}" = "codespaces" ]] && [ ! -f "$HOME/.config/vscode-dev-containers/first-run-notice-already-displayed" ]; then
|
||||
if [ -f "/usr/local/etc/vscode-dev-containers/first-run-notice.txt" ]; then
|
||||
cat "/usr/local/etc/vscode-dev-containers/first-run-notice.txt"
|
||||
elif [ -f "/workspaces/.codespaces/shared/first-run-notice.txt" ]; then
|
||||
cat "/workspaces/.codespaces/shared/first-run-notice.txt"
|
||||
fi
|
||||
mkdir -p "$HOME/.config/vscode-dev-containers"
|
||||
# Mark first run notice as displayed after 10s to avoid problems with fast terminal refreshes hiding it
|
||||
((sleep 10s; touch "$HOME/.config/vscode-dev-containers/first-run-notice-already-displayed") &)
|
||||
fi
|
||||
|
||||
# Set the default git editor if not already set
|
||||
if [ -z "$(git config --get core.editor)" ] && [ -z "${GIT_EDITOR}" ]; then
|
||||
if [ "${TERM_PROGRAM}" = "vscode" ]; then
|
||||
if [[ -n $(command -v code-insiders) && -z $(command -v code) ]]; then
|
||||
export GIT_EDITOR="code-insiders --wait"
|
||||
else
|
||||
export GIT_EDITOR="code --wait"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
EOF
|
||||
)"
|
||||
|
||||
# code shim, it fallbacks to code-insiders if code is not available
|
||||
cat << 'EOF' > /usr/local/bin/code
|
||||
#!/bin/sh
|
||||
|
||||
get_in_path_except_current() {
|
||||
which -a "$1" | grep -A1 "$0" | grep -v "$0"
|
||||
}
|
||||
|
||||
code="$(get_in_path_except_current code)"
|
||||
|
||||
if [ -n "$code" ]; then
|
||||
exec "$code" "$@"
|
||||
elif [ "$(command -v code-insiders)" ]; then
|
||||
exec code-insiders "$@"
|
||||
else
|
||||
echo "code or code-insiders is not installed" >&2
|
||||
exit 127
|
||||
fi
|
||||
EOF
|
||||
chmod +x /usr/local/bin/code
|
||||
|
||||
# systemctl shim - tells people to use 'service' if systemd is not running
|
||||
cat << 'EOF' > /usr/local/bin/systemctl
|
||||
#!/bin/sh
|
||||
set -e
|
||||
if [ -d "/run/systemd/system" ]; then
|
||||
exec /bin/systemctl "$@"
|
||||
else
|
||||
echo '\n"systemd" is not running in this container due to its overhead.\nUse the "service" command to start services instead. e.g.: \n\nservice --status-all'
|
||||
fi
|
||||
EOF
|
||||
chmod +x /usr/local/bin/systemctl
|
||||
|
||||
# Codespaces bash and OMZ themes - partly inspired by https://github.com/ohmyzsh/ohmyzsh/blob/master/themes/robbyrussell.zsh-theme
|
||||
codespaces_bash="$(cat \
|
||||
<<'EOF'
|
||||
|
||||
# Codespaces bash prompt theme
|
||||
__bash_prompt() {
|
||||
local userpart='`export XIT=$? \
|
||||
&& [ ! -z "${GITHUB_USER}" ] && echo -n "\[\033[0;32m\]@${GITHUB_USER} " || echo -n "\[\033[0;32m\]\u " \
|
||||
&& [ "$XIT" -ne "0" ] && echo -n "\[\033[1;31m\]➜" || echo -n "\[\033[0m\]➜"`'
|
||||
local gitbranch='`\
|
||||
if [ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ]; then \
|
||||
export BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null || git rev-parse --short HEAD 2>/dev/null); \
|
||||
if [ "${BRANCH}" != "" ]; then \
|
||||
echo -n "\[\033[0;36m\](\[\033[1;31m\]${BRANCH}" \
|
||||
&& if git ls-files --error-unmatch -m --directory --no-empty-directory -o --exclude-standard ":/*" > /dev/null 2>&1; then \
|
||||
echo -n " \[\033[1;33m\]✗"; \
|
||||
fi \
|
||||
&& echo -n "\[\033[0;36m\]) "; \
|
||||
fi; \
|
||||
fi`'
|
||||
local lightblue='\[\033[1;34m\]'
|
||||
local removecolor='\[\033[0m\]'
|
||||
PS1="${userpart} ${lightblue}\w ${gitbranch}${removecolor}\$ "
|
||||
unset -f __bash_prompt
|
||||
}
|
||||
__bash_prompt
|
||||
|
||||
EOF
|
||||
)"
|
||||
|
||||
codespaces_zsh="$(cat \
|
||||
<<'EOF'
|
||||
# Codespaces zsh prompt theme
|
||||
__zsh_prompt() {
|
||||
local prompt_username
|
||||
if [ ! -z "${GITHUB_USER}" ]; then
|
||||
prompt_username="@${GITHUB_USER}"
|
||||
else
|
||||
prompt_username="%n"
|
||||
fi
|
||||
PROMPT="%{$fg[green]%}${prompt_username} %(?:%{$reset_color%}➜ :%{$fg_bold[red]%}➜ )" # User/exit code arrow
|
||||
PROMPT+='%{$fg_bold[blue]%}%(5~|%-1~/…/%3~|%4~)%{$reset_color%} ' # cwd
|
||||
PROMPT+='$([ "$(git config --get codespaces-theme.hide-status 2>/dev/null)" != 1 ] && git_prompt_info)' # Git status
|
||||
PROMPT+='%{$fg[white]%}$ %{$reset_color%}'
|
||||
unset -f __zsh_prompt
|
||||
}
|
||||
ZSH_THEME_GIT_PROMPT_PREFIX="%{$fg_bold[cyan]%}(%{$fg_bold[red]%}"
|
||||
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%} "
|
||||
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg_bold[yellow]%}✗%{$fg_bold[cyan]%})"
|
||||
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg_bold[cyan]%})"
|
||||
__zsh_prompt
|
||||
|
||||
EOF
|
||||
)"
|
||||
|
||||
# Add RC snippet and custom bash prompt
|
||||
if [ "${RC_SNIPPET_ALREADY_ADDED}" != "true" ]; then
|
||||
echo "${rc_snippet}" >> /etc/bash.bashrc
|
||||
echo "${codespaces_bash}" >> "${user_rc_path}/.bashrc"
|
||||
echo 'export PROMPT_DIRTRIM=4' >> "${user_rc_path}/.bashrc"
|
||||
if [ "${USERNAME}" != "root" ]; then
|
||||
echo "${codespaces_bash}" >> "/root/.bashrc"
|
||||
echo 'export PROMPT_DIRTRIM=4' >> "/root/.bashrc"
|
||||
fi
|
||||
chown ${USERNAME}:${group_name} "${user_rc_path}/.bashrc"
|
||||
RC_SNIPPET_ALREADY_ADDED="true"
|
||||
fi
|
||||
|
||||
# Optionally install and configure zsh and Oh My Zsh!
|
||||
if [ "${INSTALL_ZSH}" = "true" ]; then
|
||||
if ! type zsh > /dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get install -y zsh
|
||||
fi
|
||||
if [ "${ZSH_ALREADY_INSTALLED}" != "true" ]; then
|
||||
echo "${rc_snippet}" >> /etc/zsh/zshrc
|
||||
ZSH_ALREADY_INSTALLED="true"
|
||||
fi
|
||||
|
||||
# Adapted, simplified inline Oh My Zsh! install steps that adds, defaults to a codespaces theme.
|
||||
# See https://github.com/ohmyzsh/ohmyzsh/blob/master/tools/install.sh for official script.
|
||||
oh_my_install_dir="${user_rc_path}/.oh-my-zsh"
|
||||
if [ ! -d "${oh_my_install_dir}" ] && [ "${INSTALL_OH_MYS}" = "true" ]; then
|
||||
template_path="${oh_my_install_dir}/templates/zshrc.zsh-template"
|
||||
user_rc_file="${user_rc_path}/.zshrc"
|
||||
umask g-w,o-w
|
||||
mkdir -p ${oh_my_install_dir}
|
||||
git clone --depth=1 \
|
||||
-c core.eol=lf \
|
||||
-c core.autocrlf=false \
|
||||
-c fsck.zeroPaddedFilemode=ignore \
|
||||
-c fetch.fsck.zeroPaddedFilemode=ignore \
|
||||
-c receive.fsck.zeroPaddedFilemode=ignore \
|
||||
"https://github.com/ohmyzsh/ohmyzsh" "${oh_my_install_dir}" 2>&1
|
||||
echo -e "$(cat "${template_path}")\nDISABLE_AUTO_UPDATE=true\nDISABLE_UPDATE_PROMPT=true" > ${user_rc_file}
|
||||
sed -i -e 's/ZSH_THEME=.*/ZSH_THEME="codespaces"/g' ${user_rc_file}
|
||||
|
||||
mkdir -p ${oh_my_install_dir}/custom/themes
|
||||
echo "${codespaces_zsh}" > "${oh_my_install_dir}/custom/themes/codespaces.zsh-theme"
|
||||
# Shrink git while still enabling updates
|
||||
cd "${oh_my_install_dir}"
|
||||
git repack -a -d -f --depth=1 --window=1
|
||||
# Copy to non-root user if one is specified
|
||||
if [ "${USERNAME}" != "root" ]; then
|
||||
cp -rf "${user_rc_file}" "${oh_my_install_dir}" /root
|
||||
chown -R ${USERNAME}:${group_name} "${user_rc_path}"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# Persist image metadata info, script if meta.env found in same directory
|
||||
meta_info_script="$(cat << 'EOF'
|
||||
#!/bin/sh
|
||||
. /usr/local/etc/vscode-dev-containers/meta.env
|
||||
|
||||
# Minimal output
|
||||
if [ "$1" = "version" ] || [ "$1" = "image-version" ]; then
|
||||
echo "${VERSION}"
|
||||
exit 0
|
||||
elif [ "$1" = "release" ]; then
|
||||
echo "${GIT_REPOSITORY_RELEASE}"
|
||||
exit 0
|
||||
elif [ "$1" = "content" ] || [ "$1" = "content-url" ] || [ "$1" = "contents" ] || [ "$1" = "contents-url" ]; then
|
||||
echo "${CONTENTS_URL}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
#Full output
|
||||
echo
|
||||
echo "Development container image information"
|
||||
echo
|
||||
if [ ! -z "${VERSION}" ]; then echo "- Image version: ${VERSION}"; fi
|
||||
if [ ! -z "${DEFINITION_ID}" ]; then echo "- Definition ID: ${DEFINITION_ID}"; fi
|
||||
if [ ! -z "${VARIANT}" ]; then echo "- Variant: ${VARIANT}"; fi
|
||||
if [ ! -z "${GIT_REPOSITORY}" ]; then echo "- Source code repository: ${GIT_REPOSITORY}"; fi
|
||||
if [ ! -z "${GIT_REPOSITORY_RELEASE}" ]; then echo "- Source code release/branch: ${GIT_REPOSITORY_RELEASE}"; fi
|
||||
if [ ! -z "${BUILD_TIMESTAMP}" ]; then echo "- Timestamp: ${BUILD_TIMESTAMP}"; fi
|
||||
if [ ! -z "${CONTENTS_URL}" ]; then echo && echo "More info: ${CONTENTS_URL}"; fi
|
||||
echo
|
||||
EOF
|
||||
)"
|
||||
if [ -f "${SCRIPT_DIR}/meta.env" ]; then
|
||||
mkdir -p /usr/local/etc/vscode-dev-containers/
|
||||
cp -f "${SCRIPT_DIR}/meta.env" /usr/local/etc/vscode-dev-containers/meta.env
|
||||
echo "${meta_info_script}" > /usr/local/bin/devcontainer-info
|
||||
chmod +x /usr/local/bin/devcontainer-info
|
||||
fi
|
||||
|
||||
# Write marker file
|
||||
mkdir -p "$(dirname "${MARKER_FILE}")"
|
||||
echo -e "\
|
||||
PACKAGES_ALREADY_INSTALLED=${PACKAGES_ALREADY_INSTALLED}\n\
|
||||
LOCALE_ALREADY_SET=${LOCALE_ALREADY_SET}\n\
|
||||
EXISTING_NON_ROOT_USER=${EXISTING_NON_ROOT_USER}\n\
|
||||
RC_SNIPPET_ALREADY_ADDED=${RC_SNIPPET_ALREADY_ADDED}\n\
|
||||
ZSH_ALREADY_INSTALLED=${ZSH_ALREADY_INSTALLED}" > "${MARKER_FILE}"
|
||||
|
||||
echo "Done!"
|
||||
@@ -1,16 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "To get started, login to GitHub and clone bun's GitHub repo into /build/bun"
|
||||
echo "If it fails to open a browser, login with a Personal Access Token instead"
|
||||
echo "# First time setup"
|
||||
echo "gh auth login"
|
||||
echo "gh repo clone oven-sh/bun . -- --depth=1 --progress -j8"
|
||||
echo ""
|
||||
echo "# Compile bun dependencies (zig is already compiled)"
|
||||
echo "make devcontainer"
|
||||
echo ""
|
||||
echo "# Build bun for development"
|
||||
echo "make dev"
|
||||
echo ""
|
||||
echo "# Run bun"
|
||||
echo "bun-debug"
|
||||
@@ -1,207 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
|
||||
#-------------------------------------------------------------------------------------------------------------
|
||||
#
|
||||
# Docs: https://github.com/microsoft/vscode-dev-containers/blob/main/script-library/docs/github.md
|
||||
# Maintainer: The VS Code and Codespaces Teams
|
||||
#
|
||||
# Syntax: ./github-debian.sh [version]
|
||||
|
||||
CLI_VERSION=${1:-"latest"}
|
||||
|
||||
GITHUB_CLI_ARCHIVE_GPG_KEY=C99B11DEB97541F0
|
||||
GPG_KEY_SERVERS="keyserver hkp://keyserver.ubuntu.com:80
|
||||
keyserver hkps://keys.openpgp.org
|
||||
keyserver hkp://keyserver.pgp.com"
|
||||
|
||||
set -e
|
||||
|
||||
if [ "$(id -u)" -ne 0 ]; then
|
||||
echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.'
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Get central common setting
|
||||
get_common_setting() {
|
||||
if [ "${common_settings_file_loaded}" != "true" ]; then
|
||||
curl -sfL "https://aka.ms/vscode-dev-containers/script-library/settings.env" -o /tmp/vsdc-settings.env 2>/dev/null || echo "Could not download settings file. Skipping."
|
||||
common_settings_file_loaded=true
|
||||
fi
|
||||
if [ -f "/tmp/vsdc-settings.env" ]; then
|
||||
local multi_line=""
|
||||
if [ "$2" = "true" ]; then multi_line="-z"; fi
|
||||
local result="$(grep ${multi_line} -oP "$1=\"?\K[^\"]+" /tmp/vsdc-settings.env | tr -d '\0')"
|
||||
if [ ! -z "${result}" ]; then declare -g $1="${result}"; fi
|
||||
fi
|
||||
echo "$1=${!1}"
|
||||
}
|
||||
|
||||
# Import the specified key in a variable name passed in as
|
||||
receive_gpg_keys() {
|
||||
get_common_setting $1
|
||||
local keys=${!1}
|
||||
get_common_setting GPG_KEY_SERVERS true
|
||||
|
||||
# Use a temporary locaiton for gpg keys to avoid polluting image
|
||||
export GNUPGHOME="/tmp/tmp-gnupg"
|
||||
mkdir -p ${GNUPGHOME}
|
||||
chmod 700 ${GNUPGHOME}
|
||||
echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" >${GNUPGHOME}/dirmngr.conf
|
||||
# GPG key download sometimes fails for some reason and retrying fixes it.
|
||||
local retry_count=0
|
||||
local gpg_ok="false"
|
||||
set +e
|
||||
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do
|
||||
echo "(*) Downloading GPG key..."
|
||||
(echo "${keys}" | xargs -n 1 gpg --recv-keys) 2>&1 && gpg_ok="true"
|
||||
if [ "${gpg_ok}" != "true" ]; then
|
||||
echo "(*) Failed getting key, retring in 10s..."
|
||||
((retry_count++))
|
||||
sleep 10s
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Figure out correct version of a three part version number is not passed
|
||||
find_version_from_git_tags() {
|
||||
local variable_name=$1
|
||||
local requested_version=${!variable_name}
|
||||
if [ "${requested_version}" = "none" ]; then return; fi
|
||||
local repository=$2
|
||||
local prefix=${3:-"tags/v"}
|
||||
local separator=${4:-"."}
|
||||
local last_part_optional=${5:-"false"}
|
||||
if [ "$(echo "${requested_version}" | grep -o "." | wc -l)" != "2" ]; then
|
||||
local escaped_separator=${separator//./\\.}
|
||||
local last_part
|
||||
if [ "${last_part_optional}" = "true" ]; then
|
||||
last_part="(${escaped_separator}[0-9]+)?"
|
||||
else
|
||||
last_part="${escaped_separator}[0-9]+"
|
||||
fi
|
||||
local regex="${prefix}\\K[0-9]+${escaped_separator}[0-9]+${last_part}$"
|
||||
local version_list="$(git ls-remote --tags ${repository} | grep -oP "${regex}" | tr -d ' ' | tr "${separator}" "." | sort -rV)"
|
||||
if [ "${requested_version}" = "latest" ] || [ "${requested_version}" = "current" ] || [ "${requested_version}" = "lts" ]; then
|
||||
declare -g ${variable_name}="$(echo "${version_list}" | head -n 1)"
|
||||
else
|
||||
set +e
|
||||
declare -g ${variable_name}="$(echo "${version_list}" | grep -E -m 1 "^${requested_version//./\\.}([\\.\\s]|$)")"
|
||||
set -e
|
||||
fi
|
||||
fi
|
||||
if [ -z "${!variable_name}" ] || ! echo "${version_list}" | grep "^${!variable_name//./\\.}$" >/dev/null 2>&1; then
|
||||
echo -e "Invalid ${variable_name} value: ${requested_version}\nValid values:\n${version_list}" >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "${variable_name}=${!variable_name}"
|
||||
}
|
||||
|
||||
# Import the specified key in a variable name passed in as
|
||||
receive_gpg_keys() {
|
||||
get_common_setting $1
|
||||
local keys=${!1}
|
||||
get_common_setting GPG_KEY_SERVERS true
|
||||
local keyring_args=""
|
||||
if [ ! -z "$2" ]; then
|
||||
keyring_args="--no-default-keyring --keyring $2"
|
||||
fi
|
||||
|
||||
# Use a temporary locaiton for gpg keys to avoid polluting image
|
||||
export GNUPGHOME="/tmp/tmp-gnupg"
|
||||
mkdir -p ${GNUPGHOME}
|
||||
chmod 700 ${GNUPGHOME}
|
||||
echo -e "disable-ipv6\n${GPG_KEY_SERVERS}" >${GNUPGHOME}/dirmngr.conf
|
||||
# GPG key download sometimes fails for some reason and retrying fixes it.
|
||||
local retry_count=0
|
||||
local gpg_ok="false"
|
||||
set +e
|
||||
until [ "${gpg_ok}" = "true" ] || [ "${retry_count}" -eq "5" ]; do
|
||||
echo "(*) Downloading GPG key..."
|
||||
(echo "${keys}" | xargs -n 1 gpg -q ${keyring_args} --recv-keys) 2>&1 && gpg_ok="true"
|
||||
if [ "${gpg_ok}" != "true" ]; then
|
||||
echo "(*) Failed getting key, retring in 10s..."
|
||||
((retry_count++))
|
||||
sleep 10s
|
||||
fi
|
||||
done
|
||||
set -e
|
||||
if [ "${gpg_ok}" = "false" ]; then
|
||||
echo "(!) Failed to get gpg key."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Function to run apt-get if needed
|
||||
apt_get_update_if_needed() {
|
||||
if [ ! -d "/var/lib/apt/lists" ] || [ "$(ls /var/lib/apt/lists/ | wc -l)" = "0" ]; then
|
||||
echo "Running apt-get update..."
|
||||
apt-get update
|
||||
else
|
||||
echo "Skipping apt-get update."
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks if packages are installed and installs them if not
|
||||
check_packages() {
|
||||
if ! dpkg -s "$@" >/dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends "$@"
|
||||
fi
|
||||
}
|
||||
|
||||
# Fall back on direct download if no apt package exists
|
||||
# Fetches .deb file to be installed with dpkg
|
||||
install_deb_using_github() {
|
||||
check_packages wget
|
||||
arch=$(dpkg --print-architecture)
|
||||
|
||||
find_version_from_git_tags CLI_VERSION https://github.com/cli/cli
|
||||
cli_filename="gh_${CLI_VERSION}_linux_${arch}.deb"
|
||||
|
||||
mkdir -p /tmp/ghcli
|
||||
pushd /tmp/ghcli
|
||||
wget https://github.com/cli/cli/releases/download/v${CLI_VERSION}/${cli_filename}
|
||||
dpkg -i /tmp/ghcli/${cli_filename}
|
||||
popd
|
||||
rm -rf /tmp/ghcli
|
||||
}
|
||||
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# Install curl, apt-transport-https, curl, gpg, or dirmngr, git if missing
|
||||
check_packages curl ca-certificates apt-transport-https dirmngr gnupg2
|
||||
if ! type git >/dev/null 2>&1; then
|
||||
apt_get_update_if_needed
|
||||
apt-get -y install --no-install-recommends git
|
||||
fi
|
||||
|
||||
# Soft version matching
|
||||
if [ "${CLI_VERSION}" != "latest" ] && [ "${CLI_VERSION}" != "lts" ] && [ "${CLI_VERSION}" != "stable" ]; then
|
||||
find_version_from_git_tags CLI_VERSION "https://github.com/cli/cli"
|
||||
version_suffix="=${CLI_VERSION}"
|
||||
else
|
||||
version_suffix=""
|
||||
fi
|
||||
|
||||
# Install the GitHub CLI
|
||||
echo "Downloading github CLI..."
|
||||
|
||||
install_deb_using_github
|
||||
|
||||
# Method below does not work until cli/cli#6175 is fixed
|
||||
# # Import key safely (new method rather than deprecated apt-key approach) and install
|
||||
# . /etc/os-release
|
||||
# receive_gpg_keys GITHUB_CLI_ARCHIVE_GPG_KEY /usr/share/keyrings/githubcli-archive-keyring.gpg
|
||||
# echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" >/etc/apt/sources.list.d/github-cli.list
|
||||
# apt-get update
|
||||
# apt-get -y install "gh${version_suffix}"
|
||||
# rm -rf "/tmp/gh/gnupg"
|
||||
|
||||
echo "Done!"
|
||||
@@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
chsh -s $(which zsh)
|
||||
sh -c "$(curl -fsSL https://starship.rs/install.sh) -- --platform linux_musl" -- --yes
|
||||
echo "eval \"$(starship init zsh)\"" >>~/.zshrc
|
||||
|
||||
curl https://github.com/Jarred-Sumner/vscode-zig/releases/download/march18/zig-0.2.5.vsix >/home/ubuntu/vscode-zig.vsix
|
||||
@@ -1,8 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl -L https://github.com/zigtools/zls-vscode/releases/download/1.1.6/zls-vscode-1.1.6.vsix >/home/ubuntu/vscode-zig.vsix
|
||||
git clone https://github.com/zigtools/zls /home/ubuntu/zls
|
||||
cd /home/ubuntu/zls
|
||||
git checkout aabdb0c6ecb3c9a47feff2c2bfb9be4e95adf723
|
||||
git submodule update --init --recursive --progress --depth=1
|
||||
zig build -Drelease-fast
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"folders": [
|
||||
{
|
||||
// Source code
|
||||
"name": "bun",
|
||||
"path": "bun"
|
||||
},
|
||||
]
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
{
|
||||
"zig_exe_path": "/build/zig/zig",
|
||||
"enable_snippets": true,
|
||||
"warn_style": false,
|
||||
"enable_semantic_tokens": true,
|
||||
"operator_completions": true,
|
||||
"include_at_in_builtins": false,
|
||||
"max_detail_length": 1048576
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
name: 📗 Documentation Request
|
||||
name: 📗 Documentation Issue
|
||||
description: Tell us if there is missing or incorrect documentation
|
||||
labels: [documentation]
|
||||
labels: [docs]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
17
.github/workflows/bun-deploy-site.yml
vendored
Normal file
17
.github/workflows/bun-deploy-site.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
# redeploy Vercel site when a file in `docs` changes
|
||||
# using VERCEL_DEPLOY_HOOK environment variable
|
||||
|
||||
name: Deploy site
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- "docs/**"
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
deploy:
|
||||
name: Deploy site
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger Vercel build
|
||||
run: curl ${{ secrets.VERCEL_DEPLOY_HOOK }}
|
||||
47
.github/workflows/bun-dockerhub.yml
vendored
47
.github/workflows/bun-dockerhub.yml
vendored
@@ -1,47 +0,0 @@
|
||||
name: bun-dockerhub
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- dockerhub/Dockerfile
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
paths:
|
||||
- dockerhub/Dockerfile
|
||||
branches:
|
||||
- main
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
jobs:
|
||||
docker:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Collect metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: |
|
||||
${{ secrets.DOCKERHUB_USERNAME }}/bun
|
||||
tags: |
|
||||
type=match,pattern=bun-v(\d.\d.\d),group=1
|
||||
type=match,pattern=bun-v(\d.\d),group=1
|
||||
type=match,pattern=bun-v(\d),group=1
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
- name: Login to DockerHub
|
||||
if: github.event_name == 'release'
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
||||
- name: Build image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./dockerhub
|
||||
push: ${{ github.event_name == 'release' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
30
.github/workflows/bun-homebrew.yml
vendored
30
.github/workflows/bun-homebrew.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: bun-homebrew
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
- edited
|
||||
jobs:
|
||||
homebrew:
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'oven-sh' && github.event.release.published_at != null
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: oven-sh/homebrew-bun
|
||||
token: ${{ env.HOMEBREW_TOKEN }}
|
||||
- id: setup-ruby
|
||||
name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: '2.6'
|
||||
- id: update-tap
|
||||
name: Update Tap
|
||||
run: ruby scripts/release.rb "${{ github.event.release.tag_name }}"
|
||||
- id: commit-tap
|
||||
name: Commit Tap
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: Release ${{ github.event.release.tag_name }}
|
||||
130
.github/workflows/bun-linux-aarch64.yml
vendored
Normal file
130
.github/workflows/bun-linux-aarch64.yml
vendored
Normal file
@@ -0,0 +1,130 @@
|
||||
name: bun-linux
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
IMAGE_NAME: ${{ github.repository }}
|
||||
TEST_TAG: bun-test'
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "src/**/*"
|
||||
- "test/**/*"
|
||||
- "build.zig"
|
||||
- "Makefile"
|
||||
- "Dockerfile"
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
name: ${{matrix.tag}}
|
||||
runs-on: ${{matrix.runner}}
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- cpu: native
|
||||
tag: linux-aarch64
|
||||
arch: aarch64
|
||||
build_arch: arm64
|
||||
runner: linux-arm64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-linux-arm64-lto.tar.gz"
|
||||
webkit_basename: "bun-webkit-linux-arm64-lto"
|
||||
build_machine_arch: aarch64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: docker/setup-buildx-action@v2
|
||||
id: buildx
|
||||
with:
|
||||
install: true
|
||||
- name: Run
|
||||
run: |
|
||||
rm -rf ${{runner.temp}}/release
|
||||
- name: Login to GitHub Container Registry
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- run: |
|
||||
mkdir -p /tmp/.buildx-cache-${{matrix.tag}}
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
push: false
|
||||
cache-from: type=local,src=/tmp/.buildx-cache-${{matrix.tag}}
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-${{matrix.tag}}
|
||||
build-args: |
|
||||
ARCH=${{matrix.arch}}
|
||||
BUILDARCH=${{matrix.build_arch}}
|
||||
BUILD_MACHINE_ARCH=${{matrix.build_machine_arch}}
|
||||
CPU_TARGET=${{matrix.cpu}}
|
||||
WEBKIT_URL=${{matrix.webkit_url}}
|
||||
GIT_SHA=${{github.sha}}
|
||||
WEBKIT_BASENAME=${{matrix.webkit_basename}}
|
||||
platforms: linux/${{matrix.build_arch}}
|
||||
target: artifact
|
||||
outputs: type=local,dest=${{runner.temp}}/release
|
||||
- name: Zip
|
||||
run: |
|
||||
# if zip is not found
|
||||
if [ ! -x "$(command -v zip)" ]; then
|
||||
sudo apt-get update && sudo apt-get install -y zip --no-install-recommends
|
||||
fi
|
||||
|
||||
if [ ! -x "$(command -v strip)" ]; then
|
||||
sudo apt-get update && sudo apt-get install -y binutils --no-install-recommends
|
||||
fi
|
||||
|
||||
cd ${{runner.temp}}/release
|
||||
chmod +x bun-profile bun
|
||||
|
||||
mkdir bun-${{matrix.tag}}-profile
|
||||
mkdir bun-${{matrix.tag}}
|
||||
|
||||
strip bun
|
||||
|
||||
mv bun-profile bun-${{matrix.tag}}-profile/bun-profile
|
||||
mv bun bun-${{matrix.tag}}/bun
|
||||
|
||||
zip -r bun-${{matrix.tag}}-profile.zip bun-${{matrix.tag}}-profile
|
||||
zip -r bun-${{matrix.tag}}.zip bun-${{matrix.tag}}
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bun-${{matrix.tag}}-profile
|
||||
path: ${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bun-${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bun-obj-${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release/bun-obj
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{matrix.tag}}-dependencies
|
||||
path: ${{runner.temp}}/release/bun-dependencies
|
||||
- name: Release
|
||||
id: release
|
||||
uses: ncipollo/release-action@v1
|
||||
if: |
|
||||
github.repository_owner == 'oven-sh'
|
||||
&& github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
allowUpdates: true
|
||||
replacesArtifacts: true
|
||||
generateReleaseNotes: true
|
||||
artifactErrorsFailBuild: true
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/bun-${{matrix.tag}}.zip,${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip"
|
||||
108
.github/workflows/bun-linux-build.yml
vendored
108
.github/workflows/bun-linux-build.yml
vendored
@@ -32,32 +32,25 @@ jobs:
|
||||
runs-on: ${{matrix.runner}}
|
||||
timeout-minutes: 90
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- cpu: haswell
|
||||
tag: linux-x64
|
||||
arch: x86_64
|
||||
build_arch: amd64
|
||||
runner: linux-amd64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
runner: big-ubuntu
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
webkit_basename: "bun-webkit-linux-amd64-lto"
|
||||
build_machine_arch: x86_64
|
||||
- cpu: westmere
|
||||
- cpu: nehalem
|
||||
tag: linux-x64-baseline
|
||||
arch: x86_64
|
||||
build_arch: amd64
|
||||
runner: linux-amd64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
runner: big-ubuntu
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-linux-amd64-lto.tar.gz"
|
||||
webkit_basename: "bun-webkit-linux-amd64-lto"
|
||||
build_machine_arch: x86_64
|
||||
- cpu: native
|
||||
tag: linux-aarch64
|
||||
arch: aarch64
|
||||
build_arch: arm64
|
||||
runner: linux-arm64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-arm64-lto.tar.gz"
|
||||
webkit_basename: "bun-webkit-linux-arm64-lto"
|
||||
build_machine_arch: aarch64
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -128,10 +121,20 @@ jobs:
|
||||
with:
|
||||
name: bun-${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release/bun-${{matrix.tag}}.zip
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bun-obj-${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release/bun-obj
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: ${{matrix.tag}}-dependencies
|
||||
path: ${{runner.temp}}/release/bun-dependencies
|
||||
- name: Release
|
||||
id: release
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: |
|
||||
github.repository_owner == 'oven-sh'
|
||||
&& github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
@@ -143,11 +146,76 @@ jobs:
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/bun-${{matrix.tag}}.zip,${{runner.temp}}/release/bun-${{matrix.tag}}-profile.zip"
|
||||
- uses: actions/upload-artifact@v3
|
||||
|
||||
linux-test:
|
||||
name: Tests ${{matrix.tag}}
|
||||
runs-on: ubuntu-latest
|
||||
needs: [linux]
|
||||
if: github.event_name == 'pull_request'
|
||||
timeout-minutes: 20
|
||||
outputs:
|
||||
failing_tests: ${{ steps.test.outputs.failing_tests }}
|
||||
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- tag: linux-x64
|
||||
- tag: linux-x64-baseline
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
name: bun-obj-${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release/bun-obj
|
||||
- uses: actions/upload-artifact@v3
|
||||
submodules: false
|
||||
- id: download
|
||||
name: Download
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{matrix.tag}}-dependencies
|
||||
path: ${{runner.temp}}/release/bun-dependencies
|
||||
name: bun-${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release
|
||||
- id: install
|
||||
name: Install
|
||||
run: |
|
||||
cd ${{runner.temp}}/release
|
||||
unzip bun-${{matrix.tag}}.zip
|
||||
cd bun-${{matrix.tag}}
|
||||
chmod +x bun
|
||||
sudo mv bun /usr/local/bin/bun
|
||||
bun --version
|
||||
- id: test
|
||||
name: Test (node runner)
|
||||
# if: ${{github.event.inputs.use_bun == 'false'}}
|
||||
run: |
|
||||
bun install
|
||||
bun install --cwd test
|
||||
bun install --cwd packages/bun-internal-test
|
||||
node packages/bun-internal-test/src/runner.node.mjs || true
|
||||
- name: Comment on PR
|
||||
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
message: |
|
||||
❌ @${{ github.actor }} ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
|
||||
|
||||
${{ steps.test.outputs.failing_tests }}
|
||||
|
||||
**[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- name: Uncomment on PR
|
||||
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
mode: upsert
|
||||
create_if_not_exists: false
|
||||
message: |
|
||||
✅ test failures on ${{ matrix.tag }} have been resolved.
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- id: fail
|
||||
name: Fail the build
|
||||
if: steps.test.outputs.failing_tests != ''
|
||||
run: exit 1
|
||||
|
||||
104
.github/workflows/bun-mac-aarch64.yml
vendored
104
.github/workflows/bun-mac-aarch64.yml
vendored
@@ -27,11 +27,11 @@ on:
|
||||
jobs:
|
||||
macos-object-files:
|
||||
name: macOS Object
|
||||
runs-on: zig-object
|
||||
runs-on: med-ubuntu
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-obj-darwin-x64-baseline
|
||||
# - cpu: haswell
|
||||
@@ -104,13 +104,13 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64-baseline
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
# - cpu: haswell
|
||||
@@ -119,16 +119,16 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64-baseline
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
# - cpu: haswell
|
||||
@@ -137,7 +137,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
- cpu: native
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
tag: bun-darwin-aarch64
|
||||
obj: bun-obj-darwin-aarch64
|
||||
artifact: bun-obj-darwin-aarch64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
runner: macos-arm64
|
||||
dependencies: true
|
||||
compile_obj: true
|
||||
@@ -242,14 +242,14 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64-baseline
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: haswell
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64
|
||||
@@ -257,14 +257,14 @@ jobs:
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
- cpu: native
|
||||
arch: aarch64
|
||||
tag: bun-darwin-aarch64
|
||||
obj: bun-obj-darwin-aarch64
|
||||
package: bun-darwin-aarch64
|
||||
artifact: bun-obj-darwin-aarch64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
runner: macos-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -333,7 +333,7 @@ jobs:
|
||||
rm -rf packages/${{ matrix.package }}
|
||||
mkdir -p packages/${{ matrix.package }}
|
||||
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
|
||||
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
make bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
- name: Zip
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -370,7 +370,9 @@ jobs:
|
||||
- name: Release
|
||||
id: release
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: |
|
||||
github.repository_owner == 'oven-sh'
|
||||
&& github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
@@ -382,3 +384,75 @@ jobs:
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
|
||||
macOS-test:
|
||||
name: Tests ${{matrix.tag}}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
needs: [macOS]
|
||||
if: github.event_name == 'pull_request'
|
||||
timeout-minutes: 10
|
||||
outputs:
|
||||
failing_tests: ${{ steps.test.outputs.failing_tests }}
|
||||
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- tag: bun-darwin-aarch64
|
||||
runner: macos-arm64
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
- id: download
|
||||
name: Download
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release
|
||||
- id: install
|
||||
name: Install
|
||||
run: |
|
||||
cd ${{runner.temp}}/release
|
||||
unzip ${{matrix.tag}}.zip
|
||||
cd ${{matrix.tag}}
|
||||
chmod +x bun
|
||||
sudo mv bun /usr/local/bin/bun
|
||||
bun --version
|
||||
- id: test
|
||||
name: Test (node runner)
|
||||
# if: ${{github.event.inputs.use_bun == 'false'}}
|
||||
run: |
|
||||
bun install
|
||||
bun install --cwd test
|
||||
bun install --cwd packages/bun-internal-test
|
||||
node packages/bun-internal-test/src/runner.node.mjs || true
|
||||
- name: Comment on PR
|
||||
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
message: |
|
||||
❌ @${{ github.actor }} ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
|
||||
|
||||
${{ steps.test.outputs.failing_tests }}
|
||||
|
||||
**[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- name: Uncomment on PR
|
||||
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
mode: upsert
|
||||
create_if_not_exists: false
|
||||
message: |
|
||||
✅ test failures on ${{ matrix.tag }} have been resolved.
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- id: fail
|
||||
name: Fail the build
|
||||
if: steps.test.outputs.failing_tests != ''
|
||||
run: exit 1
|
||||
|
||||
104
.github/workflows/bun-mac-x64-baseline.yml
vendored
104
.github/workflows/bun-mac-x64-baseline.yml
vendored
@@ -27,11 +27,11 @@ on:
|
||||
jobs:
|
||||
macos-object-files:
|
||||
name: macOS Object
|
||||
runs-on: zig-object
|
||||
runs-on: med-ubuntu
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- cpu: westmere
|
||||
- cpu: nehalem
|
||||
arch: x86_64
|
||||
tag: bun-obj-darwin-x64-baseline
|
||||
# - cpu: haswell
|
||||
@@ -104,13 +104,13 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- cpu: westmere
|
||||
- cpu: nehalem
|
||||
arch: x86_64
|
||||
tag: bun-darwin-x64-baseline
|
||||
obj: bun-obj-darwin-x64-baseline
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64-baseline
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: true
|
||||
compile_obj: false
|
||||
# - cpu: haswell
|
||||
@@ -119,16 +119,16 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
- cpu: westmere
|
||||
- cpu: nehalem
|
||||
arch: x86_64
|
||||
tag: bun-darwin-x64-baseline
|
||||
obj: bun-obj-darwin-x64-baseline
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64-baseline
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: false
|
||||
compile_obj: true
|
||||
# - cpu: haswell
|
||||
@@ -137,7 +137,7 @@ jobs:
|
||||
# obj: bun-obj-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
# - cpu: native
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
# dependencies: true
|
||||
# compile_obj: true
|
||||
@@ -243,14 +243,14 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- cpu: westmere
|
||||
- cpu: nehalem
|
||||
arch: x86_64
|
||||
tag: bun-darwin-x64-baseline
|
||||
obj: bun-obj-darwin-x64-baseline
|
||||
package: bun-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64-baseline
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: haswell
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64
|
||||
@@ -258,14 +258,14 @@ jobs:
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: native
|
||||
# arch: aarch64
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# package: bun-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -337,7 +337,7 @@ jobs:
|
||||
rm -rf packages/${{ matrix.package }}
|
||||
mkdir -p packages/${{ matrix.package }}
|
||||
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
|
||||
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
make bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
- name: Zip
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -374,7 +374,9 @@ jobs:
|
||||
- name: Release
|
||||
id: release
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: |
|
||||
github.repository_owner == 'oven-sh'
|
||||
&& github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
@@ -386,3 +388,75 @@ jobs:
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
|
||||
macOS-test:
|
||||
name: Tests ${{matrix.tag}}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
needs: [macOS]
|
||||
if: github.event_name == 'pull_request'
|
||||
timeout-minutes: 30
|
||||
outputs:
|
||||
failing_tests: ${{ steps.test.outputs.failing_tests }}
|
||||
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- tag: bun-darwin-x64-baseline
|
||||
runner: macos-11
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
- id: download
|
||||
name: Download
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release
|
||||
- id: install
|
||||
name: Install
|
||||
run: |
|
||||
cd ${{runner.temp}}/release
|
||||
unzip ${{matrix.tag}}.zip
|
||||
cd ${{matrix.tag}}
|
||||
chmod +x bun
|
||||
sudo mv bun /usr/local/bin/bun
|
||||
bun --version
|
||||
- id: test
|
||||
name: Test (node runner)
|
||||
# if: ${{github.event.inputs.use_bun == 'false'}}
|
||||
run: |
|
||||
bun install
|
||||
bun install --cwd test
|
||||
bun install --cwd packages/bun-internal-test
|
||||
node packages/bun-internal-test/src/runner.node.mjs || true
|
||||
- name: Comment on PR
|
||||
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
message: |
|
||||
❌ @${{ github.actor }} ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
|
||||
|
||||
${{ steps.test.outputs.failing_tests }}
|
||||
|
||||
**[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- name: Uncomment on PR
|
||||
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
mode: upsert
|
||||
create_if_not_exists: false
|
||||
message: |
|
||||
✅ test failures on ${{ matrix.tag }} have been resolved.
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- id: fail
|
||||
name: Fail the build
|
||||
if: steps.test.outputs.failing_tests != ''
|
||||
run: exit 1
|
||||
|
||||
104
.github/workflows/bun-mac-x64.yml
vendored
104
.github/workflows/bun-mac-x64.yml
vendored
@@ -27,11 +27,11 @@ on:
|
||||
jobs:
|
||||
macos-object-files:
|
||||
name: macOS Object
|
||||
runs-on: zig-object
|
||||
runs-on: med-ubuntu
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-obj-darwin-x64-baseline
|
||||
- cpu: haswell
|
||||
@@ -104,13 +104,13 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64-baseline
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: true
|
||||
# compile_obj: false
|
||||
- cpu: haswell
|
||||
@@ -119,16 +119,16 @@ jobs:
|
||||
obj: bun-obj-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: true
|
||||
compile_obj: false
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64-baseline
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# dependencies: false
|
||||
# compile_obj: true
|
||||
- cpu: haswell
|
||||
@@ -137,7 +137,7 @@ jobs:
|
||||
obj: bun-obj-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
dependencies: false
|
||||
compile_obj: true
|
||||
# - cpu: native
|
||||
@@ -145,7 +145,7 @@ jobs:
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
# dependencies: true
|
||||
# compile_obj: true
|
||||
@@ -245,14 +245,14 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
# - cpu: westmere
|
||||
# - cpu: nehalem
|
||||
# arch: x86_64
|
||||
# tag: bun-darwin-x64-baseline
|
||||
# obj: bun-obj-darwin-x64-baseline
|
||||
# package: bun-darwin-x64
|
||||
# runner: macos-11
|
||||
# artifact: bun-obj-darwin-x64-baseline
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
- cpu: haswell
|
||||
arch: x86_64
|
||||
tag: bun-darwin-x64
|
||||
@@ -260,14 +260,14 @@ jobs:
|
||||
package: bun-darwin-x64
|
||||
runner: macos-11
|
||||
artifact: bun-obj-darwin-x64
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-amd64-lto.tar.gz"
|
||||
# - cpu: native
|
||||
# arch: aarch64
|
||||
# tag: bun-darwin-aarch64
|
||||
# obj: bun-obj-darwin-aarch64
|
||||
# package: bun-darwin-aarch64
|
||||
# artifact: bun-obj-darwin-aarch64
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# webkit_url: "https://github.com/oven-sh/WebKit/releases/download/apr12-23/bun-webkit-macos-arm64-lto.tar.gz"
|
||||
# runner: macos-arm64
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
@@ -339,7 +339,7 @@ jobs:
|
||||
rm -rf packages/${{ matrix.package }}
|
||||
mkdir -p packages/${{ matrix.package }}
|
||||
mv ${{ runner.temp }}/release/* packages/${{ matrix.package }}/
|
||||
make webcrypto bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
make bun-link-lld-release copy-to-bun-release-dir-bin
|
||||
- name: Zip
|
||||
env:
|
||||
CPU_TARGET: ${{ matrix.cpu }}
|
||||
@@ -376,7 +376,9 @@ jobs:
|
||||
- name: Release
|
||||
id: release
|
||||
uses: ncipollo/release-action@v1
|
||||
if: github.ref == 'refs/heads/main'
|
||||
if: |
|
||||
github.repository_owner == 'oven-sh'
|
||||
&& github.ref == 'refs/heads/main'
|
||||
with:
|
||||
prerelease: true
|
||||
body: "This canary release of Bun corresponds to the commit [${{ github.sha }}]"
|
||||
@@ -388,3 +390,75 @@ jobs:
|
||||
name: "Canary (${{github.sha}})"
|
||||
tag: "canary"
|
||||
artifacts: "${{runner.temp}}/release/${{matrix.tag}}.zip,${{runner.temp}}/release/${{matrix.tag}}-profile.zip"
|
||||
macOS-test:
|
||||
name: Tests ${{matrix.tag}}
|
||||
runs-on: ${{ matrix.runner }}
|
||||
needs: [macOS]
|
||||
if: github.event_name == 'pull_request'
|
||||
timeout-minutes: 30
|
||||
outputs:
|
||||
failing_tests: ${{ steps.test.outputs.failing_tests }}
|
||||
failing_tests_count: ${{ steps.test.outputs.failing_tests_count }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- tag: bun-darwin-x64
|
||||
runner: macos-11
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
- id: download
|
||||
name: Download
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: ${{matrix.tag}}
|
||||
path: ${{runner.temp}}/release
|
||||
- id: install
|
||||
name: Install
|
||||
run: |
|
||||
cd ${{runner.temp}}/release
|
||||
unzip ${{matrix.tag}}.zip
|
||||
cd ${{matrix.tag}}
|
||||
chmod +x bun
|
||||
sudo mv bun /usr/local/bin/bun
|
||||
bun --version
|
||||
- id: test
|
||||
name: Test (node runner)
|
||||
# if: ${{github.event.inputs.use_bun == 'false'}}
|
||||
run: |
|
||||
bun install
|
||||
bun install --cwd test
|
||||
bun install --cwd packages/bun-internal-test
|
||||
node packages/bun-internal-test/src/runner.node.mjs || true
|
||||
- name: Comment on PR
|
||||
if: steps.test.outputs.failing_tests != '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
message: |
|
||||
❌ @${{ github.actor }} ${{ steps.test.outputs.failing_tests_count }} files with test failures on ${{ matrix.tag }}:
|
||||
|
||||
${{ steps.test.outputs.failing_tests }}
|
||||
|
||||
**[View test output](https://github.com/oven-sh/bun/actions/runs/${{github.run_id}})**
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- name: Uncomment on PR
|
||||
if: steps.test.outputs.failing_tests == '' && github.event_name == 'pull_request'
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: test-failures-${{matrix.tag}}
|
||||
mode: upsert
|
||||
create_if_not_exists: false
|
||||
message: |
|
||||
✅ test failures on ${{ matrix.tag }} have been resolved.
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- id: fail
|
||||
name: Fail the build
|
||||
if: steps.test.outputs.failing_tests != ''
|
||||
run: exit 1
|
||||
|
||||
175
.github/workflows/bun-release-canary.yml
vendored
Normal file
175
.github/workflows/bun-release-canary.yml
vendored
Normal file
@@ -0,0 +1,175 @@
|
||||
name: bun-release-canary
|
||||
concurrency: release-canary
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 14 * * *" # every day at 6am PST
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
sign:
|
||||
name: Sign Release
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-release
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-gpg
|
||||
name: Setup GPG
|
||||
uses: crazy-max/ghaction-import-gpg@v5
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: bun-run
|
||||
name: Sign Release
|
||||
run: |
|
||||
echo "$GPG_PASSPHRASE" | bun upload-assets -- "canary"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
npm:
|
||||
name: Release to NPM
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-release
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: bun-run
|
||||
name: Release
|
||||
run: bun upload-npm -- canary publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
# npm-types:
|
||||
# name: Release types to NPM
|
||||
# runs-on: ubuntu-latest
|
||||
# defaults:
|
||||
# run:
|
||||
# working-directory: packages/bun-types
|
||||
# steps:
|
||||
# - id: checkout
|
||||
# name: Checkout
|
||||
# uses: actions/checkout@v3
|
||||
# - id: setup-node
|
||||
# name: Setup Node.js
|
||||
# uses: actions/setup-node@v3
|
||||
# with:
|
||||
# node-version: latest
|
||||
# - id: setup-bun
|
||||
# name: Setup Bun
|
||||
# uses: oven-sh/setup-bun@v1
|
||||
# with:
|
||||
# bun-version: canary
|
||||
# - id: bun-install
|
||||
# name: Install Dependencies
|
||||
# run: bun install
|
||||
# - id: setup-env
|
||||
# name: Setup Environment
|
||||
# run: |
|
||||
# SHA=$(git rev-parse --short "$GITHUB_SHA")
|
||||
# VERSION=$(bun --version)
|
||||
# TAG="${VERSION}-canary.$(date '+%Y%m%d').1+${SHA}"
|
||||
# echo "Setup tag: ${TAG}"
|
||||
# echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
# - id: bun-run
|
||||
# name: Build
|
||||
# run: bun run build
|
||||
# env:
|
||||
# BUN_VERSION: ${{ env.TAG }}
|
||||
# - id: npm-publish
|
||||
# name: Release
|
||||
# uses: JS-DevTools/npm-publish@v1
|
||||
# with:
|
||||
# package: packages/bun-types/dist/package.json
|
||||
# token: ${{ secrets.NPM_TOKEN }}
|
||||
# tag: canary
|
||||
docker:
|
||||
name: Release to Dockerhub
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: qemu
|
||||
name: Setup Docker QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- id: buildx
|
||||
name: Setup Docker buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
- id: metadata
|
||||
name: Setup Docker metadata
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: oven/bun
|
||||
tags: canary
|
||||
- id: login
|
||||
name: Login to Docker
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- id: push
|
||||
name: Push to Docker
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./dockerhub
|
||||
file: ./dockerhub/Dockerfile-debian
|
||||
platforms: linux/amd64,linux/arm64
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
push: true
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
||||
build-args: |
|
||||
BUN_VERSION=canary
|
||||
s3:
|
||||
name: Upload to S3
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-release
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: bun-run
|
||||
name: Release
|
||||
run: bun upload-s3 -- canary
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
|
||||
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
|
||||
AWS_BUCKET: bun
|
||||
53
.github/workflows/bun-release-types-canary.yml
vendored
Normal file
53
.github/workflows/bun-release-types-canary.yml
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
name: bun-release-canary
|
||||
concurrency: release-canary
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "packages/bun-types/**"
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
npm-types:
|
||||
name: Release types to NPM
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-node
|
||||
name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: setup-env
|
||||
name: Setup Environment
|
||||
run: |
|
||||
SHA=$(git rev-parse --short "$GITHUB_SHA")
|
||||
VERSION=$(bun --version)
|
||||
TAG="${VERSION}-canary.$(date +'%Y%m%dT%H%M%S')"
|
||||
echo "Setup tag: ${TAG}"
|
||||
echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
- id: bun-run
|
||||
name: Build
|
||||
run: bun run build
|
||||
env:
|
||||
BUN_VERSION: ${{ env.TAG }}
|
||||
- id: npm-publish
|
||||
name: Release
|
||||
uses: JS-DevTools/npm-publish@v1
|
||||
with:
|
||||
package: packages/bun-types/dist/package.json
|
||||
token: ${{ secrets.NPM_TOKEN }}
|
||||
tag: canary
|
||||
251
.github/workflows/bun-release.yml
vendored
Normal file
251
.github/workflows/bun-release.yml
vendored
Normal file
@@ -0,0 +1,251 @@
|
||||
name: bun-release
|
||||
concurrency: release
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- published
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
tag:
|
||||
type: string
|
||||
description: The tag to publish
|
||||
required: true
|
||||
jobs:
|
||||
sign:
|
||||
name: Sign Release
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-release
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-env
|
||||
name: Setup Environment
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
|
||||
echo "Setup tag: ${TAG}"
|
||||
echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
- id: setup-gpg
|
||||
name: Setup GPG
|
||||
uses: crazy-max/ghaction-import-gpg@v5
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: bun-run
|
||||
name: Sign Release
|
||||
run: |
|
||||
echo "$GPG_PASSPHRASE" | bun upload-assets -- "${{ env.TAG }}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
|
||||
npm:
|
||||
name: Release to NPM
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-release
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-env
|
||||
name: Setup Environment
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
|
||||
echo "Setup tag: ${TAG}"
|
||||
echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: bun-run
|
||||
name: Release
|
||||
run: bun upload-npm -- "${{ env.TAG }}" publish
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
npm-types:
|
||||
name: Release types to NPM
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-env
|
||||
name: Setup Environment
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
|
||||
echo "Setup tag: ${TAG}"
|
||||
echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
- id: setup-node
|
||||
name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: bun-run
|
||||
name: Build
|
||||
run: bun run build
|
||||
env:
|
||||
BUN_VERSION: ${{ env.TAG }}
|
||||
- id: npm-publish
|
||||
name: Release
|
||||
uses: JS-DevTools/npm-publish@v1
|
||||
with:
|
||||
package: packages/bun-types/dist/package.json
|
||||
token: ${{ secrets.NPM_TOKEN }}
|
||||
docker:
|
||||
name: Release to Dockerhub
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: environment
|
||||
name: Setup Environment
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
|
||||
echo "Setup tag: ${TAG}"
|
||||
echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
- id: qemu
|
||||
name: Setup Docker QEMU
|
||||
uses: docker/setup-qemu-action@v2
|
||||
- id: buildx
|
||||
name: Setup Docker buildx
|
||||
uses: docker/setup-buildx-action@v2
|
||||
with:
|
||||
platforms: linux/amd64,linux/arm64
|
||||
- id: metadata
|
||||
name: Setup Docker metadata
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: oven/bun
|
||||
tags: |
|
||||
type=match,pattern=(bun-v)?(\d.\d.\d),group=2,value=${{ env.TAG }}
|
||||
type=match,pattern=(bun-v)?(\d.\d),group=2,value=${{ env.TAG }}
|
||||
- id: login
|
||||
name: Login to Docker
|
||||
uses: docker/login-action@v2
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- id: push
|
||||
name: Push to Docker
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: ./dockerhub
|
||||
file: ./dockerhub/Dockerfile-debian
|
||||
platforms: linux/amd64,linux/arm64
|
||||
builder: ${{ steps.buildx.outputs.name }}
|
||||
push: true
|
||||
tags: ${{ steps.metadata.outputs.tags }}
|
||||
labels: ${{ steps.metadata.outputs.labels }}
|
||||
build-args: |
|
||||
BUN_VERSION=${{ env.TAG }}
|
||||
homebrew:
|
||||
name: Release to Homebrew
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
repository: oven-sh/homebrew-bun
|
||||
token: ${{ secrets.ROBOBUN_TOKEN }}
|
||||
- id: setup-gpg
|
||||
name: Setup GPG
|
||||
uses: crazy-max/ghaction-import-gpg@v5
|
||||
with:
|
||||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
|
||||
passphrase: ${{ secrets.GPG_PASSPHRASE }}
|
||||
- id: setup-env
|
||||
name: Setup Environment
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
|
||||
echo "Setup tag: ${TAG}"
|
||||
echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
- id: setup-ruby
|
||||
name: Setup Ruby
|
||||
uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: "2.6"
|
||||
- id: update-tap
|
||||
name: Update Tap
|
||||
run: ruby scripts/release.rb "${{ env.TAG }}"
|
||||
- id: commit-tap
|
||||
name: Commit Tap
|
||||
uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_options: --gpg-sign=${{ steps.setup-gpg.outputs.keyid }}
|
||||
commit_message: Release ${{ env.TAG }}
|
||||
commit_user_name: robobun
|
||||
commit_user_email: robobun@oven.sh
|
||||
commit_author: robobun <robobun@oven.sh>
|
||||
s3:
|
||||
name: Upload to S3
|
||||
runs-on: ubuntu-latest
|
||||
needs: sign
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-release
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- id: setup-env
|
||||
name: Setup Environment
|
||||
run: |
|
||||
TAG="${{ github.event.inputs.tag }}"
|
||||
TAG="${TAG:-"${{ github.event.release.tag_name }}"}"
|
||||
echo "Setup tag: ${TAG}"
|
||||
echo "TAG=${TAG}" >> ${GITHUB_ENV}
|
||||
- id: setup-bun
|
||||
name: Setup Bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- id: bun-install
|
||||
name: Install Dependencies
|
||||
run: bun install
|
||||
- id: bun-run
|
||||
name: Release
|
||||
run: bun upload-s3 -- "${{ env.TAG }}"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY}}
|
||||
AWS_ENDPOINT: ${{ secrets.AWS_ENDPOINT }}
|
||||
AWS_BUCKET: bun
|
||||
34
.github/workflows/bun-typecheck.yml
vendored
Normal file
34
.github/workflows/bun-typecheck.yml
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
name: typecheck
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
paths:
|
||||
- "packages/bun-types/**"
|
||||
- "test/**"
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- "packages/bun-types/**"
|
||||
- "test/**"
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: check-tests
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v3
|
||||
- name: Install bun
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: canary
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
working-directory: test
|
||||
- name: Typecheck tests
|
||||
run: bun run typecheck
|
||||
137
.github/workflows/bun-types-release.yml
vendored
137
.github/workflows/bun-types-release.yml
vendored
@@ -1,137 +0,0 @@
|
||||
name: Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
test-build:
|
||||
name: Test & Build
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- name: Install bun
|
||||
uses: xhyrom/setup-bun@v0.1.8
|
||||
with:
|
||||
bun-version: canary
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
- name: ESLint
|
||||
run: bun run lint
|
||||
|
||||
- name: Build package
|
||||
run: bun run build
|
||||
|
||||
- name: Upload artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: bun-types
|
||||
path: packages/bun-types/dist/*
|
||||
if-no-files-found: error
|
||||
|
||||
publish-npm:
|
||||
name: Publish on NPM
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-build]
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
registry-url: 'https://registry.npmjs.org'
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bun-types
|
||||
path: packages/bun-types/dist
|
||||
|
||||
- name: Publish on NPM
|
||||
run: cd packages/bun-types/dist/ && npm publish --access public
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
|
||||
publish-gpr:
|
||||
name: Publish on GPR
|
||||
runs-on: ubuntu-latest
|
||||
needs: [test-build]
|
||||
if: github.repository_owner == 'oven-sh'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: packages/bun-types
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: latest
|
||||
registry-url: 'https://npm.pkg.github.com/'
|
||||
scope: '@oven-sh'
|
||||
|
||||
- name: Install bun
|
||||
uses: xhyrom/setup-bun@v0.1.8
|
||||
with:
|
||||
bun-version: canary
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Download all artifacts
|
||||
uses: actions/download-artifact@v3
|
||||
with:
|
||||
name: bun-types
|
||||
path: dist
|
||||
|
||||
- name: Add scope to name
|
||||
run: bun scripts/gpr.ts
|
||||
|
||||
- name: Publish on GPR
|
||||
run: cd dist/ && npm publish --access public
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
# no need for separate releases now
|
||||
# create-release:
|
||||
# name: Create Release
|
||||
# runs-on: ubuntu-latest
|
||||
# needs: [test-build]
|
||||
# defaults:
|
||||
# run:
|
||||
# working-directory: packages/bun-types
|
||||
# if: github.repository_owner == 'oven-sh'
|
||||
|
||||
# steps:
|
||||
# - name: Download all artifacts
|
||||
# uses: actions/download-artifact@v3
|
||||
# with:
|
||||
# name: bun-types
|
||||
# path: packages/bun-types/dist
|
||||
|
||||
# - name: Set version
|
||||
# run: echo "version=$(jq --raw-output '.version' dist/package.json)" >> $GITHUB_ENV
|
||||
|
||||
# - name: Create Release
|
||||
# uses: softprops/action-gh-release@v0.1.14
|
||||
# with:
|
||||
# tag_name: "v${{ env.version }}"
|
||||
# body: "This is the release of bun-types that corresponds to the commit [${{ github.sha }}]"
|
||||
# token: ${{ secrets.GITHUB_TOKEN }}
|
||||
# files: |
|
||||
# dist/*
|
||||
21
.github/workflows/bun-types-tests.yml
vendored
21
.github/workflows/bun-types-tests.yml
vendored
@@ -1,16 +1,16 @@
|
||||
name: TypeScript Types
|
||||
name: bun-types
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- packages/bun-types/**/*
|
||||
- "packages/bun-types/**"
|
||||
branches: [main]
|
||||
pull_request:
|
||||
paths:
|
||||
- packages/bun-types/**/*
|
||||
- "packages/bun-types/**"
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
name: Build and Test
|
||||
name: type-tests
|
||||
runs-on: ubuntu-latest
|
||||
defaults:
|
||||
run:
|
||||
@@ -18,13 +18,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repo
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Install bun
|
||||
uses: xhyrom/setup-bun@v0.1.8
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
bun-version: canary
|
||||
|
||||
- name: Install node
|
||||
uses: actions/setup-node@v3
|
||||
@@ -32,13 +31,11 @@ jobs:
|
||||
node-version: latest
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
run: |
|
||||
bun install
|
||||
|
||||
- name: Generate package
|
||||
run: bun run build
|
||||
|
||||
- name: ESLint
|
||||
run: bun run lint
|
||||
|
||||
- name: Tests
|
||||
run: bun run test
|
||||
|
||||
76
.github/workflows/prettier-fmt.yml
vendored
Normal file
76
.github/workflows/prettier-fmt.yml
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
name: prettier
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- jarred/test-actions
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
prettier-fmt:
|
||||
name: prettier
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
prettier_fmt_errs: ${{ steps.fmt.outputs.prettier_fmt_errs }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- id: setup
|
||||
name: Setup
|
||||
uses: oven-sh/setup-bun@v1
|
||||
with:
|
||||
bun-version: latest
|
||||
- id: install
|
||||
name: Install prettier
|
||||
run: bun install
|
||||
- name: Run prettier
|
||||
id: fmt
|
||||
run: |
|
||||
rm -f .failed
|
||||
bun prettier --check "./bench/**/*.{ts,tsx,js,jsx,mjs}" "./test/**/*.{ts,tsx,js,jsx,mjs}" "./src/**/*.{ts,tsx,js,jsx}" --config .prettierrc.cjs 2> prettier-fmt.err > prettier-fmt1.err || echo 'failed' > .failed
|
||||
|
||||
if [ -s .failed ]; then
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "prettier_fmt_errs<<${delimiter}" >> "${GITHUB_OUTPUT}"
|
||||
cat prettier-fmt.err >> "${GITHUB_OUTPUT}"
|
||||
cat prettier-fmt1.err >> "${GITHUB_OUTPUT}"
|
||||
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
|
||||
fi
|
||||
- name: Comment on PR
|
||||
if: steps.fmt.outputs.prettier_fmt_errs != ''
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: prettier-fmt
|
||||
message: |
|
||||
❌ @${{ github.actor }} `prettier` reported errors
|
||||
|
||||
```js
|
||||
${{ steps.fmt.outputs.prettier_fmt_errs }}
|
||||
```
|
||||
|
||||
To one-off fix this manually, run:
|
||||
```sh
|
||||
bun fmt
|
||||
```
|
||||
|
||||
You might need to run `bun install` locally and configure your text editor to [auto-format on save](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode).
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- name: Uncomment on PR
|
||||
if: steps.fmt.outputs.prettier_fmt_errs == ''
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: prettier-fmt
|
||||
mode: upsert
|
||||
create_if_not_exists: false
|
||||
message: |
|
||||
✅ `prettier` errors have been resolved. Thank you.
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
- name: Fail the job
|
||||
if: steps.fmt.outputs.prettier_fmt_errs != ''
|
||||
run: exit 1
|
||||
59
.github/workflows/run-test-manually.yml
vendored
Normal file
59
.github/workflows/run-test-manually.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Run Tests Manually
|
||||
|
||||
on:
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
version:
|
||||
description: "Version"
|
||||
required: true
|
||||
default: "canary"
|
||||
type: string
|
||||
use_bun:
|
||||
description: "Use Bun?"
|
||||
required: true
|
||||
default: true
|
||||
type: boolean
|
||||
jobs:
|
||||
linux-test:
|
||||
name: Tests ${{matrix.tag}} ${{github.event.inputs.version}}
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- tag: linux-x64
|
||||
- tag: linux-x64-baseline
|
||||
steps:
|
||||
- id: checkout
|
||||
name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: false
|
||||
- id: install-npm
|
||||
name: Install (npm)
|
||||
run: |
|
||||
npm install @oven/bun-${{matrix.tag}}@${{github.event.inputs.version}}
|
||||
chmod +x node_modules/@oven/bun-${{matrix.tag}}/bin/bun
|
||||
sudo cp node_modules/@oven/bun-${{matrix.tag}}/bin/bun /usr/bin/bun
|
||||
- id: test
|
||||
name: Test
|
||||
if: ${{github.event.inputs.use_bun == 'true'}}
|
||||
run: |
|
||||
bun install
|
||||
bun install --cwd test/bun.js
|
||||
bun install --cwd test/bun.js/third-party/body-parser-test
|
||||
cd packages/bun-internal-test
|
||||
bun install
|
||||
bun run test
|
||||
- id: test-node-runner
|
||||
name: Test (node runner)
|
||||
if: ${{github.event.inputs.use_bun == 'false'}}
|
||||
run: |
|
||||
bun install
|
||||
bun install --cwd test/bun.js
|
||||
bun install --cwd test/bun.js/third-party/body-parser-test
|
||||
cd packages/bun-internal-test
|
||||
bun install
|
||||
node src/runner.node.mjs
|
||||
87
.github/workflows/zig-fmt.yml
vendored
Normal file
87
.github/workflows/zig-fmt.yml
vendored
Normal file
@@ -0,0 +1,87 @@
|
||||
name: zig-fmt
|
||||
|
||||
env:
|
||||
ZIG_VERSION: 0.11.0-dev.2571+31738de28
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- jarred/test-actions
|
||||
paths:
|
||||
- "src/**/*.zig"
|
||||
- "src/*.zig"
|
||||
# Allows you to run this workflow manually from the Actions tab
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
zig-fmt:
|
||||
name: zig fmt
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
zig_fmt_errs: ${{ steps.fmt.outputs.zig_fmt_errs }}
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
submodules: recursive
|
||||
- name: Install zig
|
||||
run: |
|
||||
curl https://ziglang.org/builds/zig-linux-x86_64-${{env.ZIG_VERSION}}.tar.xz -L -o zig.tar.xz
|
||||
tar -xf zig.tar.xz
|
||||
sudo mv zig-linux-x86_64-${{env.ZIG_VERSION}}/zig /usr/local/bin
|
||||
- name: Run zig fmt
|
||||
id: fmt
|
||||
run: |
|
||||
zig fmt --check src/*.zig src/**/*.zig 2> zig-fmt.err > zig-fmt.err2 || echo "Failed"
|
||||
delimiter="$(openssl rand -hex 8)"
|
||||
echo "zig_fmt_errs<<${delimiter}" >> "${GITHUB_OUTPUT}"
|
||||
|
||||
if [ -s zig-fmt.err ]; then
|
||||
echo "// The following errors occurred:" >> "${GITHUB_OUTPUT}"
|
||||
cat zig-fmt.err >> "${GITHUB_OUTPUT}"
|
||||
fi
|
||||
|
||||
if [ -s zig-fmt.err2 ]; then
|
||||
echo "// The following files were not formatted:" >> "${GITHUB_OUTPUT}"
|
||||
cat zig-fmt.err2 >> "${GITHUB_OUTPUT}"
|
||||
fi
|
||||
|
||||
echo "${delimiter}" >> "${GITHUB_OUTPUT}"
|
||||
- name: Comment on PR
|
||||
if: steps.fmt.outputs.zig_fmt_errs != ''
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: zig-fmt
|
||||
message: |
|
||||
❌ @${{ github.actor }} `zig fmt` reported errors. Consider configuring your text editor to [auto-format on save](https://github.com/ziglang/vscode-zig)
|
||||
|
||||
```zig
|
||||
// # zig fmt --check src/*.zig src/**/*.zig
|
||||
${{ steps.fmt.outputs.zig_fmt_errs }}
|
||||
```
|
||||
|
||||
To one-off fix this manually, run:
|
||||
|
||||
```sh
|
||||
zig fmt src/*.zig src/**/*.zig
|
||||
```
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
<sup>zig v${{env.ZIG_VERSION}}</sup>
|
||||
|
||||
- name: Uncomment on PR
|
||||
if: steps.fmt.outputs.zig_fmt_errs == ''
|
||||
uses: thollander/actions-comment-pull-request@v2
|
||||
with:
|
||||
comment_tag: zig-fmt
|
||||
mode: upsert
|
||||
create_if_not_exists: false
|
||||
message: |
|
||||
✅ `zig fmt` errors have been resolved. Thank you.
|
||||
|
||||
<sup>[#${{github.sha}}](https://github.com/oven-sh/bun/commits/${{github.sha}})</sup>
|
||||
<sup>zig v${{env.ZIG_VERSION}}</sup>
|
||||
|
||||
- name: Fail the job
|
||||
if: steps.fmt.outputs.zig_fmt_errs != ''
|
||||
run: exit 1
|
||||
12
.gitignore
vendored
12
.gitignore
vendored
@@ -1,7 +1,6 @@
|
||||
.DS_Store
|
||||
zig-cache
|
||||
*.wasm
|
||||
|
||||
packages/*/*.wasm
|
||||
*.o
|
||||
*.a
|
||||
profile.json
|
||||
@@ -14,7 +13,7 @@ dist
|
||||
*.log
|
||||
*.out.js
|
||||
*.out.refresh.js
|
||||
/package-lock.json
|
||||
**/package-lock.json
|
||||
build
|
||||
*.wat
|
||||
zig-out
|
||||
@@ -46,6 +45,7 @@ outcss
|
||||
txt.js
|
||||
.idea
|
||||
.vscode/cpp*
|
||||
.vscode/clang*
|
||||
|
||||
node_modules_*
|
||||
*.jsb
|
||||
@@ -110,3 +110,9 @@ misctools/machbench
|
||||
bun-webkit
|
||||
|
||||
src/deps/c-ares/build
|
||||
src/bun.js/bindings-obj
|
||||
src/bun.js/debug-bindings-obj
|
||||
|
||||
failing-tests.txt
|
||||
test.txt
|
||||
myscript.sh
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
src/fallback.html
|
||||
# src/test
|
||||
test/bun.js/solid-dom-fixtures
|
||||
test/bun.js/bundled
|
||||
#src/bun.js/builtins
|
||||
# src/api/demo
|
||||
src/bun.js/WebKit
|
||||
src/bun.js/builtins/js
|
||||
src/*.out.js
|
||||
src/*out.*.js
|
||||
src/deps
|
||||
src/test/fixtures
|
||||
src/react-refresh.js
|
||||
test/snapshots
|
||||
test/snapshots-no-hmr
|
||||
test/js/deno/*.test.ts
|
||||
test/js/deno/**/*.test.ts
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"tabWidth": 2,
|
||||
"useTabs": false,
|
||||
"singleQuote": false,
|
||||
"bracketSpacing": true,
|
||||
"trailingComma": "all"
|
||||
}
|
||||
15
.prettierrc.cjs
Normal file
15
.prettierrc.cjs
Normal file
@@ -0,0 +1,15 @@
|
||||
module.exports = {
|
||||
arrowParens: "avoid",
|
||||
printWidth: 120,
|
||||
trailingComma: "all",
|
||||
useTabs: false,
|
||||
quoteProps: "preserve",
|
||||
overrides: [
|
||||
{
|
||||
files: "README.md",
|
||||
options: {
|
||||
printWidth: 80,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -7,3 +7,7 @@ if [ -d ./node_modules/bun-webkit ]; then
|
||||
# get the first matching bun-webkit-* directory name
|
||||
ln -s ./node_modules/$(ls ./node_modules | grep bun-webkit- | head -n 1) ./bun-webkit
|
||||
fi
|
||||
|
||||
# sets up vscode C++ intellisense
|
||||
rm -f .vscode/clang++
|
||||
ln -s $(which clang++-15 || which clang++) .vscode/clang++ 2>/dev/null
|
||||
|
||||
12
.vscode/c_cpp_properties.json
vendored
12
.vscode/c_cpp_properties.json
vendored
@@ -12,13 +12,12 @@
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/WebCore/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/webcore/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
|
||||
"${workspaceFolder}/src/bun.js/builtins/",
|
||||
"${workspaceFolder}/src/bun.js/builtins/cpp",
|
||||
"${workspaceFolder}/src/deps/boringssl/include/",
|
||||
|
||||
"${workspaceFolder}/src/deps",
|
||||
"${workspaceFolder}/src/deps/uws/uSockets/src"
|
||||
],
|
||||
@@ -32,12 +31,11 @@
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/WTF/Headers/**",
|
||||
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Release/bmalloc/Headers/**",
|
||||
"${workspaceFolder}/src/bun.js/bindings/*",
|
||||
"${workspaceFolder}/src/bun.js/bindings/**",
|
||||
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
|
||||
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
|
||||
"${workspaceFolder}/src/bun.js/builtins/**",
|
||||
"${workspaceFolder}/src/bun.js/builtins/cpp/**",
|
||||
"${workspaceFolder}/src/bun.js/modules/**",
|
||||
"${workspaceFolder}/src/bun.js/builtins/*",
|
||||
"${workspaceFolder}/src/bun.js/builtins/cpp/*",
|
||||
"${workspaceFolder}/src/bun.js/modules/*",
|
||||
"${workspaceFolder}/src/deps",
|
||||
"${workspaceFolder}/src/deps/boringssl/include/",
|
||||
"${workspaceFolder}/src/deps/uws/uSockets/src"
|
||||
@@ -57,7 +55,7 @@
|
||||
"DU_DISABLE_RENAMING=1"
|
||||
],
|
||||
"macFrameworkPath": [],
|
||||
"compilerPath": "/opt/homebrew/opt/llvm/bin/clang++",
|
||||
"compilerPath": "${workspaceFolder}/.vscode/clang++",
|
||||
"cStandard": "c17",
|
||||
"cppStandard": "c++20"
|
||||
}
|
||||
|
||||
6
.vscode/extensions.json
vendored
6
.vscode/extensions.json
vendored
@@ -1,8 +1,10 @@
|
||||
{
|
||||
"recommendations": [
|
||||
"AugusteRame.zls-vscode",
|
||||
"ziglang.vscode-zig",
|
||||
"esbenp.prettier-vscode",
|
||||
"xaver.clang-format",
|
||||
"vadimcn.vscode-lldb"
|
||||
"vadimcn.vscode-lldb",
|
||||
"bierner.comment-tagged-templates",
|
||||
"ms-vscode.cpptools"
|
||||
]
|
||||
}
|
||||
|
||||
117
.vscode/launch.json
generated
vendored
117
.vscode/launch.json
generated
vendored
@@ -7,7 +7,19 @@
|
||||
"name": "bun test",
|
||||
"program": "bun-debug",
|
||||
"args": ["wiptest", "${file}"],
|
||||
"cwd": "${workspaceFolder}/test/bun.js",
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun test --watch",
|
||||
"program": "bun-debug",
|
||||
"args": ["--watch", "test", "${file}"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
},
|
||||
@@ -38,6 +50,18 @@
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun run (watch)",
|
||||
"program": "bun-debug",
|
||||
"args": ["--watch", "${file}"],
|
||||
"cwd": "${file}/../../",
|
||||
"env": {
|
||||
"FORCE_COLOR": "1"
|
||||
},
|
||||
"console": "internalConsole"
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
@@ -114,13 +138,100 @@
|
||||
"request": "launch",
|
||||
"name": "bun build debug",
|
||||
"program": "bun-debug",
|
||||
"args": ["build", "--platform=bun", "--outdir=/tmp/testout", "${file}"],
|
||||
"cwd": "${file}/../../",
|
||||
"args": ["bun", "./test/fixtures/bundle/trivial/index.js"],
|
||||
"cwd": "${workspaceFolder}",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"BUN_CONFIG_MINIFY_WHITESPACE": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun build debug out.js",
|
||||
"program": "bun-debug",
|
||||
"args": ["--outfile=out.js", "bun", "${file}"],
|
||||
"cwd": "${file}/../",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"BUN_CONFIG_MINIFY_WHITESPACE": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun build debug STDOUT",
|
||||
"program": "bun-debug",
|
||||
"args": ["bun", "${file}"],
|
||||
"cwd": "${file}/../",
|
||||
"console": "internalConsole",
|
||||
"env": {}
|
||||
},
|
||||
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun build debug (no splitting, browser entry)",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"--entry-names=./[name].[ext]",
|
||||
"--outdir=/Users/jarred/Code/bun-rsc/.rsc-no-split",
|
||||
"--platform=browser",
|
||||
"bun",
|
||||
"./quick.tsx"
|
||||
],
|
||||
"cwd": "/Users/jarred/Code/bun-rsc",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"NODE_ENV": "production"
|
||||
// "BUN_DEBUG_QUIET_LOGS": "1"
|
||||
// "BUN_DUMP_SYMBOLS": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun build debug (splitting, rsc)",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"--entry-names=./[name].[ext]",
|
||||
"--outdir=/Users/jarred/Code/bun-rsc/.rsc-split",
|
||||
"--server-components",
|
||||
"--platform=bun",
|
||||
"--splitting",
|
||||
"bun",
|
||||
"/Users/jarred/Code/bun-rsc/components/Message.tsx",
|
||||
"/Users/jarred/Code/bun-rsc/components/Button.tsx",
|
||||
],
|
||||
"cwd": "/Users/jarred/Code/bun-rsc",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"NODE_ENV": "production"
|
||||
// "BUN_DEBUG_QUIET_LOGS": "1"
|
||||
// "BUN_DUMP_SYMBOLS": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
"name": "bun build debug (NO splitting, rsc)",
|
||||
"program": "bun-debug",
|
||||
"args": [
|
||||
"--entry-names=./[name].[ext]",
|
||||
"--outdir=/Users/jarred/Code/bun-rsc/.rsccheck",
|
||||
"--server-components",
|
||||
"--platform=bun",
|
||||
"bun",
|
||||
"/Users/jarred/Code/bun-rsc/pages/index.js"
|
||||
],
|
||||
"cwd": "/Users/jarred/Code/bun-rsc",
|
||||
"console": "internalConsole",
|
||||
"env": {
|
||||
"NODE_ENV": "production"
|
||||
// "BUN_DEBUG_QUIET_LOGS": "1"
|
||||
// "BUN_DUMP_SYMBOLS": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "lldb",
|
||||
"request": "launch",
|
||||
|
||||
31
.vscode/settings.json
vendored
31
.vscode/settings.json
vendored
@@ -13,7 +13,7 @@
|
||||
"[zig]": {
|
||||
"editor.tabSize": 4,
|
||||
"editor.useTabStops": false,
|
||||
"editor.defaultFormatter": "tiehuis.zig",
|
||||
"editor.defaultFormatter": "ziglang.vscode-zig",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[ts]": {
|
||||
@@ -24,6 +24,8 @@
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"zig.zls.enableInlayHints": false,
|
||||
|
||||
"[jsx]": {
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
@@ -32,8 +34,24 @@
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"[yaml]": {
|
||||
"editor.formatOnSave": true
|
||||
},
|
||||
"zig.beforeDebugCmd": "make build-unit ${file} ${filter} ${bin}",
|
||||
"zig.testCmd": "make test ${file} ${filter} ${bin}",
|
||||
"[markdown]": {
|
||||
"editor.unicodeHighlight.ambiguousCharacters": false,
|
||||
"editor.unicodeHighlight.invisibleCharacters": false,
|
||||
"diffEditor.ignoreTrimWhitespace": false,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.formatOnSave": true,
|
||||
"editor.wordWrap": "on",
|
||||
"editor.quickSuggestions": {
|
||||
"comments": "off",
|
||||
"strings": "off",
|
||||
"other": "off"
|
||||
}
|
||||
},
|
||||
"lldb.verboseLogging": false,
|
||||
"files.exclude": {
|
||||
"**/.git": true,
|
||||
@@ -182,9 +200,14 @@
|
||||
"ethernet.h": "c",
|
||||
"inet.h": "c",
|
||||
"packet.h": "c",
|
||||
"queue": "cpp"
|
||||
"queue": "cpp",
|
||||
"compare": "cpp",
|
||||
"concepts": "cpp",
|
||||
"typeindex": "cpp",
|
||||
"__verbose_abort": "cpp"
|
||||
},
|
||||
"cmake.configureOnOpen": false,
|
||||
"C_Cpp.errorSquiggles": "Enabled",
|
||||
"eslint.workingDirectories": ["packages/bun-types"]
|
||||
"C_Cpp.errorSquiggles": "enabled",
|
||||
"eslint.workingDirectories": ["packages/bun-types"],
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
||||
|
||||
90
CONTRIBUTING.md
Normal file
90
CONTRIBUTING.md
Normal file
@@ -0,0 +1,90 @@
|
||||
# Contributing to Bun
|
||||
|
||||
> **Important:** All contributions need test coverage. If you are adding a new feature, please add a test. If you are fixing a bug, please add a test that fails before your fix and passes after your fix.
|
||||
|
||||
## Bun's codebase
|
||||
|
||||
Bun is written mostly in Zig, but WebKit & JavaScriptCore (the JavaScript engine) is written in C++.
|
||||
|
||||
Today (February 2023), Bun's codebase has five distinct parts:
|
||||
|
||||
- JavaScript, JSX, & TypeScript transpiler, module resolver, and related code
|
||||
- JavaScript runtime ([`src/bun.js/`](src/bun.js/))
|
||||
- JavaScript runtime bindings ([`src/bun.zig/bindings/**/*.cpp`](src/bun.zig/bindings/))
|
||||
- Package manager ([`src/install/`](src/install/))
|
||||
- Shared utilities ([`src/string_immutable.zig`](src/string_immutable.zig))
|
||||
|
||||
The JavaScript transpiler & module resolver is mostly independent from the runtime. It predates the runtime and is entirely in Zig. The JavaScript parser is mostly in [`src/js_parser.zig`](src/js_parser.zig). The JavaScript AST data structures are mostly in [`src/js_ast.zig`](src/js_ast.zig). The JavaScript lexer is in [`src/js_lexer.zig`](src/js_lexer.zig). A lot of this code started as a port of esbuild's equivalent code from Go to Zig, but has had many small changes since then.
|
||||
|
||||
## Getting started
|
||||
|
||||
Please refer to [Bun's Development Guide](https://bun.sh/docs/project/development) to get your dev environment setup!
|
||||
|
||||
## Memory management in Bun
|
||||
|
||||
For the Zig code, please:
|
||||
|
||||
1. Do your best to avoid dynamically allocating memory.
|
||||
2. If we need to allocate memory, carefully consider the owner of that memory. If it's a JavaScript object, it will need a finalizer. If it's in Zig, it will need to be freed either via an arena or manually.
|
||||
3. Prefer arenas over manual memory management. Manually freeing memory is leak & crash prone.
|
||||
4. If the memory needs to be accessed across threads, use `bun.default_allocator`. Mimalloc threadlocal heaps are not safe to free across threads.
|
||||
|
||||
The JavaScript transpiler has special-handling for memory management. The parser allocates into a single arena and the memory is recycled after each parse.
|
||||
|
||||
## JavaScript runtime
|
||||
|
||||
Most of Bun's JavaScript runtime code lives in [`src/bun.js`](src/bun.js).
|
||||
|
||||
### Calling C++ from Zig & Zig from C++
|
||||
|
||||
TODO: document this (see [`bindings.zig`](src/bun.js/bindings/bindings.zig) and [`bindings.cpp`](src/bun.js/bindings/bindings.cpp) for now)
|
||||
|
||||
### Adding a new JavaScript class
|
||||
|
||||
1. Add a new file in [`src/bun.js/*.classes.ts`](src/bun.js) to define the instance and static methods for the class.
|
||||
2. Add a new file in [`src/bun.js/**/*.zig`](src/bun.js) and expose the struct in [`src/bun.js/generated_classes_list.zig`](src/bun.js/generated_classes_list.zig)
|
||||
3. Run `make codegen`
|
||||
|
||||
Copy from examples like `Subprocess` or `Response`.
|
||||
|
||||
### ESM modules
|
||||
|
||||
Bun implements ESM modules in a mix of native code and JavaScript.
|
||||
|
||||
Several Node.js modules are implemented in JavaScript and loosely based on browserify polyfills.
|
||||
|
||||
The ESM modules in Bun are located in [`src/bun.js/*.exports.js`](src/bun.js/). Unlike other code in Bun, these files are NOT transpiled. They are loaded directly into the JavaScriptCore VM. That means `require` does not work in these files. Instead, you must use `import.meta.require`, or ideally, not use require/import other files at all.
|
||||
|
||||
The module loader is in [`src/bun.js/module_loader.zig`](src/bun.js/module_loader.zig).
|
||||
|
||||
### JavaScript Builtins
|
||||
|
||||
JavaScript builtins are located in [`src/bun.js/builtins/*.js`](src/bun.js/builtins).
|
||||
|
||||
These files support a JavaScriptCore-only syntax for internal slots. `@` is used to access an internal slot. For example: `new @Array(123)` will create a new `Array` similar to `new Array(123)`, except if a library modifies the `Array` global, it will not affect the internal slot (`@Array`). These names must be allow-listed in `BunBuiltinNames.h` (though JavaScriptCore allowlists some names by default).
|
||||
|
||||
They can not use or reference ESM-modules. The files that end with `*Internals.js` are automatically loaded globally. Most usage of internals right now are the stream implementations (which share a lot of code from Safari/WebKit) and ImportMetaObject (which is how `require` is implemented in the runtime)
|
||||
|
||||
To regenerate the builtins:
|
||||
|
||||
```sh
|
||||
make clean-bindings && make generate-builtins && make bindings -j10
|
||||
```
|
||||
|
||||
It is recommended that you have ccache installed or else you will spend a lot of time waiting for the bindings to compile.
|
||||
|
||||
### Memory management in Bun's JavaScript runtime
|
||||
|
||||
TODO: fill this out (for now, use `JSC.Strong` in most cases)
|
||||
|
||||
### Strings
|
||||
|
||||
TODO: fill this out (for now, use `JSValue.toSlice()` in most cases)
|
||||
|
||||
#### JavaScriptCore C API
|
||||
|
||||
Do not copy from examples leveraging the JavaScriptCore C API. Please do not use this in new code. We will not accept PRs that add new code that uses the JavaScriptCore C API.
|
||||
|
||||
## Testing
|
||||
|
||||
See [`test/README.md`](test/README.md) for information on how to run tests.
|
||||
29
Dockerfile
29
Dockerfile
@@ -10,9 +10,9 @@ ARG ARCH=x86_64
|
||||
ARG BUILD_MACHINE_ARCH=x86_64
|
||||
ARG TRIPLET=${ARCH}-linux-gnu
|
||||
ARG BUILDARCH=amd64
|
||||
ARG WEBKIT_TAG=jul27-2
|
||||
ARG WEBKIT_TAG=feb9
|
||||
ARG ZIG_TAG=jul1
|
||||
ARG ZIG_VERSION="0.11.0-dev.947+cf822c6dd"
|
||||
ARG ZIG_VERSION="0.11.0-dev.2571+31738de28"
|
||||
ARG WEBKIT_BASENAME="bun-webkit-linux-$BUILDARCH"
|
||||
|
||||
ARG ZIG_FOLDERNAME=zig-linux-${BUILD_MACHINE_ARCH}-${ZIG_VERSION}
|
||||
@@ -20,7 +20,7 @@ ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
|
||||
ARG WEBKIT_URL="https://github.com/oven-sh/WebKit/releases/download/$WEBKIT_TAG/${WEBKIT_BASENAME}.tar.gz"
|
||||
ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
|
||||
ARG GIT_SHA=""
|
||||
ARG BUN_BASE_VERSION=0.4
|
||||
ARG BUN_BASE_VERSION=0.6
|
||||
|
||||
FROM bitnami/minideb:bullseye as bun-base
|
||||
|
||||
@@ -122,8 +122,8 @@ ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG CPU_TARGET
|
||||
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
ENV CCACHE_DIR=/ccache
|
||||
ENV JSC_BASE_DIR=${WEBKIT_DIR}
|
||||
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
|
||||
@@ -149,6 +149,9 @@ ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
|
||||
ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/deps/lol-html ${BUN_DIR}/src/deps/lol-html
|
||||
|
||||
@@ -303,8 +306,6 @@ ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG CPU_TARGET
|
||||
|
||||
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
@@ -401,6 +402,7 @@ ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY .prettierrc.cjs ${BUN_DIR}/.prettierrc.cjs
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
@@ -425,7 +427,7 @@ ENV CCACHE_DIR=/ccache
|
||||
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && make prerelease && \
|
||||
mkdir -p $BUN_RELEASE_DIR && \
|
||||
OUTPUT_DIR=/tmp/bun-${TRIPLET}-${GIT_SHA} $ZIG_PATH/zig build obj -Doutput-dir=/tmp/bun-${TRIPLET}-${GIT_SHA} -Drelease-fast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
|
||||
OUTPUT_DIR=/tmp/bun-${TRIPLET}-${GIT_SHA} $ZIG_PATH/zig build obj -Doutput-dir=/tmp/bun-${TRIPLET}-${GIT_SHA} -Doptimize=ReleaseFast -Dtarget="${TRIPLET}" -Dcpu="${CPU_TARGET}" && \
|
||||
cp /tmp/bun-${TRIPLET}-${GIT_SHA}/bun.o /tmp/bun-${TRIPLET}-${GIT_SHA}/bun-${BUN_BASE_VERSION}.$(cat ${BUN_DIR}/src/build-id).o && cd / && rm -rf $BUN_DIR
|
||||
|
||||
FROM scratch as build_release_obj
|
||||
@@ -459,19 +461,20 @@ ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY .prettierrc.cjs ${BUN_DIR}/.prettierrc.cjs
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
ENV JSC_BASE_DIR=${WEBKIT_DIR}
|
||||
ENV LIB_ICU_PATH=${WEBKIT_DIR}/lib
|
||||
|
||||
# Required for `make webcrypto`
|
||||
# Required for webcrypto bindings
|
||||
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
|
||||
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && mkdir -p $BUN_RELEASE_DIR && make webcrypto && \
|
||||
make release-bindings -j10 && mv ${BUN_DEPS_OUT_DIR}/libwebcrypto.a /tmp && mv src/bun.js/bindings-obj/* /tmp
|
||||
RUN --mount=type=cache,target=/ccache cd $BUN_DIR && mkdir -p src/bun.js/bindings-obj && rm -rf $HOME/.cache zig-cache && mkdir -p $BUN_RELEASE_DIR && \
|
||||
make release-bindings -j10 && mv src/bun.js/bindings-obj/* /tmp
|
||||
|
||||
FROM bun-base as sqlite
|
||||
|
||||
@@ -484,10 +487,14 @@ ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
|
||||
ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
ENV CCACHE_DIR=/ccache
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY src/bun.js/bindings/sqlite ${BUN_DIR}/src/bun.js/bindings/sqlite
|
||||
COPY .prettierrc.cjs ${BUN_DIR}/.prettierrc.cjs
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
@@ -499,7 +506,6 @@ RUN --mount=type=cache,target=/ccache cd $BUN_DIR && make sqlite
|
||||
FROM scratch as build_release_cpp
|
||||
|
||||
COPY --from=compile_cpp /tmp/*.o /
|
||||
COPY --from=compile_cpp /tmp/libwebcrypto.a /
|
||||
|
||||
FROM prepare_release as build_release
|
||||
|
||||
@@ -515,6 +521,7 @@ ARG CPU_TARGET
|
||||
ENV CPU_TARGET=${CPU_TARGET}
|
||||
|
||||
COPY Makefile ${BUN_DIR}/Makefile
|
||||
COPY .prettierrc.cjs ${BUN_DIR}/.prettierrc.cjs
|
||||
|
||||
WORKDIR $BUN_DIR
|
||||
|
||||
|
||||
@@ -1,126 +0,0 @@
|
||||
ARG DEBIAN_FRONTEND=noninteractive
|
||||
ARG GITHUB_WORKSPACE=/build
|
||||
ARG BUILDARCH=amd64
|
||||
ARG ARCH=x86_64
|
||||
ARG ZIG_PATH=${GITHUB_WORKSPACE}/zig
|
||||
ARG WEBKIT_DIR=${GITHUB_WORKSPACE}/bun-webkit
|
||||
ARG BUN_RELEASE_DIR=${GITHUB_WORKSPACE}/bun-release
|
||||
ARG BUN_DEPS_OUT_DIR=${GITHUB_WORKSPACE}/bun-deps
|
||||
ARG BUN_DIR=${GITHUB_WORKSPACE}/bun
|
||||
ARG BUN_PACKAGES_DIR=${BUN_DIR}/packages
|
||||
ARG ZIG_VERSION="0.11.0-dev.947+cf822c6dd"
|
||||
|
||||
ARG ZIG_FOLDERNAME=zig-linux-${ARCH}-${ZIG_VERSION}
|
||||
ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
|
||||
ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
|
||||
|
||||
FROM --platform=linux/${BUILDARCH} ubuntu:22.04 as bun.devcontainer
|
||||
|
||||
ARG DEBIAN_FRONTEND
|
||||
ARG GITHUB_WORKSPACE
|
||||
ARG BUILDARCH
|
||||
ARG ZIG_PATH
|
||||
ARG WEBKIT_DIR
|
||||
ARG BUN_RELEASE_DIR
|
||||
ARG BUN_DEPS_OUT_DIR
|
||||
ARG BUN_DIR
|
||||
ARG BUN_PACKAGES_DIR
|
||||
|
||||
ENV WEBKIT_OUT_DIR ${WEBKIT_DIR}
|
||||
ENV PATH "$ZIG_PATH:$PATH"
|
||||
ENV JSC_BASE_DIR $WEBKIT_OUT_DIR
|
||||
ENV LIB_ICU_PATH ${WEBKIT_OUT_DIR}/lib
|
||||
ENV BUN_RELEASE_DIR ${BUN_RELEASE_DIR}
|
||||
ENV PATH "${BUN_PACKAGES_DIR}/bun-linux-x64:${BUN_PACKAGES_DIR}/bun-linux-aarch64:${BUN_PACKAGES_DIR}/debug-bun-linux-x64:${BUN_PACKAGES_DIR}/debug-bun-linux-aarch64:$PATH"
|
||||
ENV PATH "/home/ubuntu/zls/zig-out/bin:$PATH"
|
||||
ENV BUN_INSTALL /home/ubuntu/.bun
|
||||
ENV XDG_CONFIG_HOME /home/ubuntu/.config
|
||||
|
||||
WORKDIR ${GITHUB_WORKSPACE}
|
||||
|
||||
RUN apt-get update && \
|
||||
apt-get install --no-install-recommends -y wget gnupg2 curl lsb-release wget software-properties-common && \
|
||||
add-apt-repository ppa:longsleep/golang-backports && \
|
||||
wget https://apt.llvm.org/llvm.sh --no-check-certificate && \
|
||||
chmod +x llvm.sh && \
|
||||
./llvm.sh 15 && \
|
||||
curl -fsSL https://deb.nodesource.com/setup_16.x | bash - && \
|
||||
apt-get update && \
|
||||
apt-get install --no-install-recommends -y \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg2 \
|
||||
software-properties-common \
|
||||
cmake \
|
||||
build-essential \
|
||||
git \
|
||||
libssl-dev \
|
||||
ruby \
|
||||
liblld-15-dev \
|
||||
libclang-15-dev \
|
||||
nodejs \
|
||||
gcc \
|
||||
g++ \
|
||||
clang-15 \
|
||||
clang-format-15 \
|
||||
libc++-15-dev \
|
||||
libc++abi-15-dev \
|
||||
lld-15 \
|
||||
libicu-dev \
|
||||
wget \
|
||||
rustc \
|
||||
cargo \
|
||||
unzip \
|
||||
tar \
|
||||
golang-go ninja-build pkg-config automake autoconf libtool curl && \
|
||||
update-alternatives --install /usr/bin/cc cc /usr/bin/clang-15 90 && \
|
||||
update-alternatives --install /usr/bin/cpp cpp /usr/bin/clang++-15 90 && \
|
||||
update-alternatives --install /usr/bin/c++ c++ /usr/bin/clang++-15 90 && \
|
||||
npm install -g esbuild
|
||||
|
||||
ENV CC=clang-15
|
||||
ENV CXX=clang++-15
|
||||
ENV ZIG "${ZIG_PATH}/zig"
|
||||
|
||||
WORKDIR $GITHUB_WORKSPACE
|
||||
|
||||
RUN cd / && mkdir -p $BUN_RELEASE_DIR $BUN_DEPS_OUT_DIR ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
|
||||
|
||||
WORKDIR $GITHUB_WORKSPACE
|
||||
|
||||
|
||||
ARG ZIG_FOLDERNAME
|
||||
ARG ZIG_FILENAME
|
||||
ARG ZIG_URL
|
||||
|
||||
ADD $ZIG_URL .
|
||||
RUN tar -xf ${ZIG_FILENAME} && \
|
||||
rm ${ZIG_FILENAME} && \
|
||||
mv ${ZIG_FOLDERNAME} ${ZIG_PATH};
|
||||
|
||||
RUN cd $GITHUB_WORKSPACE && \
|
||||
curl -o bun-webkit-linux-$BUILDARCH.tar.gz -L https://github.com/oven-sh/WebKit/releases/download/dec30/bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
tar -xzf bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
rm bun-webkit-linux-$BUILDARCH.tar.gz && \
|
||||
cat $WEBKIT_OUT_DIR/include/cmakeconfig.h > /dev/null
|
||||
|
||||
RUN apt-get -y update && update-alternatives --install /usr/bin/lldb lldb /usr/bin/lldb-15 90
|
||||
|
||||
COPY .devcontainer/workspace.code-workspace $GITHUB_WORKSPACE/workspace.code-workspace
|
||||
COPY .devcontainer/zls.json $GITHUB_WORKSPACE/workspace.code-workspace
|
||||
COPY .devcontainer/limits.conf /etc/security/limits.conf
|
||||
COPY ".devcontainer/scripts/" /scripts/
|
||||
COPY ".devcontainer/scripts/getting-started.sh" $GITHUB_WORKSPACE/getting-started.sh
|
||||
COPY ".devcontainer/README.md" $GITHUB_WORKSPACE/README.md
|
||||
|
||||
ENV JSC_BASE_DIR=$WEBKIT_DIR
|
||||
ENV WEBKIT_RELEASE_DIR=$WEBKIT_DIR
|
||||
ENV WEBKIT_DEBUG_DIR=$WEBKIT_DIR
|
||||
ENV WEBKIT_RELEASE_DIR_LTO=$WEBKIT_DIR
|
||||
|
||||
RUN mkdir -p /home/ubuntu/.bun /home/ubuntu/.config $GITHUB_WORKSPACE/bun && \
|
||||
bash /scripts/common-debian.sh && \
|
||||
bash /scripts/github.sh && \
|
||||
bash /scripts/nice.sh && \
|
||||
bash /scripts/zig-env.sh
|
||||
COPY .devcontainer/zls.json /home/ubuntu/.config/zls.json
|
||||
405
Makefile
405
Makefile
@@ -1,4 +1,4 @@
|
||||
SHELL := $(shell which bash) # Use bash syntax to be consistent
|
||||
SHELL := $(shell which bash) # Use bash syntax to be consistent
|
||||
|
||||
OS_NAME := $(shell uname -s | tr '[:upper:]' '[:lower:]')
|
||||
ARCH_NAME_RAW := $(shell uname -m)
|
||||
@@ -35,15 +35,15 @@ DOCKER_BUILDARCH = amd64
|
||||
BREW_PREFIX_PATH = /usr/local
|
||||
DEFAULT_MIN_MACOS_VERSION = 10.14
|
||||
MARCH_NATIVE = -march=$(CPU_TARGET) -mtune=$(CPU_TARGET)
|
||||
NATIVE_OR_OLD_MARCH = -march=westmere
|
||||
NATIVE_OR_OLD_MARCH = -march=nehalem
|
||||
endif
|
||||
|
||||
MIN_MACOS_VERSION ?= $(DEFAULT_MIN_MACOS_VERSION)
|
||||
BUN_BASE_VERSION = 0.4
|
||||
BUN_BASE_VERSION = 0.6
|
||||
|
||||
AR=
|
||||
|
||||
BUN_OR_NODE = $(shell which bun || which node)
|
||||
BUN_OR_NODE = $(shell which bun 2>/dev/null || which node 2>/dev/null)
|
||||
|
||||
CXX_VERSION=c++2a
|
||||
TRIPLET = $(OS_NAME)-$(ARCH_NAME)
|
||||
@@ -52,30 +52,31 @@ PACKAGES_REALPATH = $(realpath packages)
|
||||
PACKAGE_DIR = $(PACKAGES_REALPATH)/$(PACKAGE_NAME)
|
||||
DEBUG_PACKAGE_DIR = $(PACKAGES_REALPATH)/debug-$(PACKAGE_NAME)
|
||||
RELEASE_BUN = $(PACKAGE_DIR)/bun
|
||||
DEBUG_BIN = $(DEBUG_PACKAGE_DIR)/
|
||||
DEBUG_BIN = $(DEBUG_PACKAGE_DIR)
|
||||
DEBUG_BUN = $(DEBUG_BIN)/bun-debug
|
||||
BUILD_ID = $(shell cat ./src/build-id)
|
||||
PACKAGE_JSON_VERSION = $(BUN_BASE_VERSION).$(BUILD_ID)
|
||||
BUN_BUILD_TAG = bun-v$(PACKAGE_JSON_VERSION)
|
||||
BUN_RELEASE_BIN = $(PACKAGE_DIR)/bun
|
||||
PRETTIER ?= $(shell which prettier || echo "./node_modules/.bin/prettier")
|
||||
DSYMUTIL ?= $(shell which dsymutil || which dsymutil-15)
|
||||
PRETTIER ?= $(shell which prettier 2>/dev/null || echo "./node_modules/.bin/prettier")
|
||||
ESBUILD = $(shell which esbuild 2>/dev/null || echo "./node_modules/.bin/esbuild")
|
||||
DSYMUTIL ?= $(shell which dsymutil 2>/dev/null || which dsymutil-15 2>/dev/null)
|
||||
WEBKIT_DIR ?= $(realpath src/bun.js/WebKit)
|
||||
WEBKIT_RELEASE_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Release
|
||||
WEBKIT_DEBUG_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Debug
|
||||
WEBKIT_RELEASE_DIR_LTO ?= $(WEBKIT_DIR)/WebKitBuild/ReleaseLTO
|
||||
|
||||
|
||||
NPM_CLIENT ?= $(shell which bun || which npm)
|
||||
ZIG ?= $(shell which zig || echo -e "error: Missing zig. Please make sure zig is in PATH. Or set ZIG=/path/to-zig-executable")
|
||||
NPM_CLIENT ?= $(shell which bun 2>/dev/null || which npm 2>/dev/null)
|
||||
ZIG ?= $(shell which zig 2>/dev/null || echo -e "error: Missing zig. Please make sure zig is in PATH. Or set ZIG=/path/to-zig-executable")
|
||||
|
||||
# We must use the same compiler version for the JavaScriptCore bindings and JavaScriptCore
|
||||
# If we don't do this, strange memory allocation failures occur.
|
||||
# This is easier to happen than you'd expect.
|
||||
# Using realpath here causes issues because clang uses clang++ as a symlink
|
||||
# so if that's resolved, it won't build for C++
|
||||
REAL_CC = $(shell which clang-15 || which clang)
|
||||
REAL_CXX = $(shell which clang++-15 || which clang++)
|
||||
REAL_CC = $(shell which clang-15 2>/dev/null || which clang 2>/dev/null)
|
||||
REAL_CXX = $(shell which clang++-15 2>/dev/null || which clang++ 2>/dev/null)
|
||||
|
||||
CC = $(REAL_CC)
|
||||
CXX = $(REAL_CXX)
|
||||
@@ -85,7 +86,7 @@ CCACHE_PATH := $(shell which ccache 2>/dev/null)
|
||||
|
||||
CCACHE_CC_FLAG = CC=$(CCACHE_CC_OR_CC)
|
||||
|
||||
ifeq (,$(findstring,$(shell which ccache),ccache))
|
||||
ifeq (,$(findstring,$(shell which ccache 2>/dev/null),ccache))
|
||||
CMAKE_CXX_COMPILER_LAUNCHER_FLAG := -DCMAKE_CXX_COMPILER_LAUNCHER=$(CCACHE_PATH) -DCMAKE_C_COMPILER_LAUNCHER=$(CCACHE_PATH)
|
||||
CCACHE_CC_OR_CC := "$(CCACHE_PATH) $(REAL_CC)"
|
||||
export CCACHE_COMPILERTYPE = clang
|
||||
@@ -117,7 +118,7 @@ ifeq ($(OS_NAME),darwin)
|
||||
endif
|
||||
|
||||
# macOS sed is different
|
||||
SED = $(shell which gsed || which sed)
|
||||
SED = $(shell which gsed 2>/dev/null || which sed 2>/dev/null)
|
||||
|
||||
BUN_DIR ?= $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
|
||||
BUN_DEPS_DIR ?= $(shell pwd)/src/deps
|
||||
@@ -146,9 +147,9 @@ CMAKE_FLAGS_WITHOUT_RELEASE = -DCMAKE_C_COMPILER=$(CC) \
|
||||
-DCMAKE_OSX_DEPLOYMENT_TARGET=$(MIN_MACOS_VERSION) \
|
||||
$(CMAKE_CXX_COMPILER_LAUNCHER_FLAG) \
|
||||
-DCMAKE_AR=$(AR) \
|
||||
-DCMAKE_RANLIB=$(which llvm-15-ranlib || which llvm-ranlib)
|
||||
|
||||
|
||||
-DCMAKE_RANLIB=$(which llvm-15-ranlib 2>/dev/null || which llvm-ranlib 2>/dev/null)
|
||||
|
||||
|
||||
|
||||
CMAKE_FLAGS = $(CMAKE_FLAGS_WITHOUT_RELEASE) -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
@@ -168,7 +169,7 @@ endif
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
LIBICONV_PATH =
|
||||
AR = $(shell which llvm-ar-15 || which llvm-ar || which ar)
|
||||
AR = $(shell which llvm-ar-15 2>/dev/null || which llvm-ar 2>/dev/null || which ar 2>/dev/null)
|
||||
endif
|
||||
|
||||
OPTIMIZATION_LEVEL=-O3 $(MARCH_NATIVE)
|
||||
@@ -184,14 +185,13 @@ DEFAULT_USE_BMALLOC := 1
|
||||
USE_BMALLOC ?= DEFAULT_USE_BMALLOC
|
||||
|
||||
# Set via postinstall
|
||||
AUTO_JSX_BASE_DIR ?= $(realpath $(firstword $(wildcard bun-webkit)))
|
||||
|
||||
ifeq (,$(AUTO_JSX_BASE_DIR))
|
||||
AUTO_JSX_BASE_DIR ?= $(HOME)/webkit-build
|
||||
ifeq (,$(realpath $(JSC_BASE_DIR)))
|
||||
JSC_BASE_DIR = $(realpath $(firstword $(wildcard bun-webkit)))
|
||||
ifeq (,$(JSC_BASE_DIR))
|
||||
JSC_BASE_DIR = $(HOME)/webkit-build
|
||||
endif
|
||||
endif
|
||||
|
||||
JSC_BASE_DIR ?= $(AUTO_JSX_BASE_DIR)
|
||||
|
||||
DEFAULT_JSC_LIB :=
|
||||
DEFAULT_JSC_LIB_DEBUG :=
|
||||
|
||||
@@ -266,7 +266,7 @@ STRIP=/usr/bin/strip
|
||||
endif
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
STRIP=$(shell which llvm-strip || which llvm-strip-15 || which strip || echo "Missing strip")
|
||||
STRIP=$(shell which llvm-strip 2>/dev/null || which llvm-strip-15 2>/dev/null || which strip 2>/dev/null || echo "Missing strip")
|
||||
endif
|
||||
|
||||
|
||||
@@ -286,6 +286,7 @@ SRC_SQLITE_FILES := $(wildcard $(SRC_DIR)/sqlite/*.cpp)
|
||||
SRC_NODE_OS_FILES := $(wildcard $(SRC_DIR)/node_os/*.cpp)
|
||||
SRC_IO_FILES := $(wildcard src/io/*.cpp)
|
||||
SRC_BUILTINS_FILES := $(wildcard src/bun.js/builtins/*.cpp)
|
||||
SRC_WEBCRYPTO_FILES := $(wildcard $(SRC_DIR)/webcrypto/*.cpp)
|
||||
|
||||
OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRC_FILES))
|
||||
WEBCORE_OBJ_FILES := $(patsubst $(SRC_DIR)/webcore/%.cpp,$(OBJ_DIR)/%.o,$(SRC_WEBCORE_FILES))
|
||||
@@ -294,6 +295,7 @@ NODE_OS_OBJ_FILES := $(patsubst $(SRC_DIR)/node_os/%.cpp,$(OBJ_DIR)/%.o,$(SRC_NO
|
||||
BUILTINS_OBJ_FILES := $(patsubst src/bun.js/builtins/%.cpp,$(OBJ_DIR)/%.o,$(SRC_BUILTINS_FILES))
|
||||
IO_FILES := $(patsubst src/io/%.cpp,$(OBJ_DIR)/%.o,$(SRC_IO_FILES))
|
||||
MODULES_OBJ_FILES := $(patsubst $(MODULES_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(MODULES_FILES))
|
||||
WEBCRYPTO_OBJ_FILES := $(patsubst $(SRC_DIR)/webcrypto/%.cpp,$(OBJ_DIR)/%.o,$(SRC_WEBCRYPTO_FILES))
|
||||
|
||||
DEBUG_OBJ_FILES := $(patsubst $(SRC_DIR)/%.cpp,$(DEBUG_OBJ_DIR)/%.o,$(SRC_FILES))
|
||||
DEBUG_WEBCORE_OBJ_FILES := $(patsubst $(SRC_DIR)/webcore/%.cpp,$(DEBUG_OBJ_DIR)/%.o,$(SRC_WEBCORE_FILES))
|
||||
@@ -302,9 +304,13 @@ DEBUG_NODE_OS_OBJ_FILES := $(patsubst $(SRC_DIR)/node_os/%.cpp,$(DEBUG_OBJ_DIR)/
|
||||
DEBUG_BUILTINS_OBJ_FILES := $(patsubst src/bun.js/builtins/%.cpp,$(DEBUG_OBJ_DIR)/%.o,$(SRC_BUILTINS_FILES))
|
||||
DEBUG_IO_FILES := $(patsubst src/io/%.cpp,$(DEBUG_OBJ_DIR)/%.o,$(SRC_IO_FILES))
|
||||
DEBUG_MODULES_OBJ_FILES := $(patsubst $(MODULES_DIR)/%.cpp,$(DEBUG_OBJ_DIR)/%.o,$(MODULES_FILES))
|
||||
DEBUG_WEBCRYPTO_OBJ_FILES := $(patsubst $(SRC_DIR)/webcrypto/%.cpp, $(DEBUG_OBJ_DIR)/%.o, $(SRC_WEBCRYPTO_FILES))
|
||||
|
||||
BINDINGS_OBJ := $(OBJ_FILES) $(WEBCORE_OBJ_FILES) $(SQLITE_OBJ_FILES) $(NODE_OS_OBJ_FILES) $(BUILTINS_OBJ_FILES) $(IO_FILES) $(MODULES_OBJ_FILES)
|
||||
DEBUG_BINDINGS_OBJ := $(DEBUG_OBJ_FILES) $(DEBUG_WEBCORE_OBJ_FILES) $(DEBUG_SQLITE_OBJ_FILES) $(DEBUG_NODE_OS_OBJ_FILES) $(DEBUG_BUILTINS_OBJ_FILES) $(DEBUG_IO_FILES) $(DEBUG_MODULES_OBJ_FILES)
|
||||
BINDINGS_OBJ := $(OBJ_FILES) $(WEBCORE_OBJ_FILES) $(SQLITE_OBJ_FILES) $(NODE_OS_OBJ_FILES) $(BUILTINS_OBJ_FILES) $(IO_FILES) $(MODULES_OBJ_FILES) $(WEBCRYPTO_OBJ_FILES)
|
||||
DEBUG_BINDINGS_OBJ := $(DEBUG_OBJ_FILES) $(DEBUG_WEBCORE_OBJ_FILES) $(DEBUG_SQLITE_OBJ_FILES) $(DEBUG_NODE_OS_OBJ_FILES) $(DEBUG_BUILTINS_OBJ_FILES) $(DEBUG_IO_FILES) $(DEBUG_MODULES_OBJ_FILES) $(DEBUG_WEBCRYPTO_OBJ_FILES)
|
||||
|
||||
-include $(BINDINGS_OBJ:.o=.d)
|
||||
-include $(DEBUG_BINDINGS_OBJ:.o=.d)
|
||||
|
||||
ALL_JSC_INCLUDE_DIRS := -I$(WEBKIT_RELEASE_DIR)/WTF/Headers \
|
||||
-I$(WEBKIT_RELEASE_DIR)/ICU/Headers \
|
||||
@@ -395,6 +401,10 @@ CLANG_FLAGS = $(INCLUDE_DIRS) \
|
||||
-fvisibility=hidden \
|
||||
-fvisibility-inlines-hidden
|
||||
|
||||
ifeq ($(OS_NAME),darwin)
|
||||
CLANG_FLAGS += -DBUN_FAST_TLS=1 -DUSE_BUN_FAST_TLS=1 -DHAVE_BUN_FAST_TLS=1
|
||||
endif
|
||||
|
||||
PLATFORM_LINKER_FLAGS =
|
||||
|
||||
SYMBOLS=
|
||||
@@ -495,9 +505,9 @@ BUN_LLD_FLAGS_WITHOUT_JSC = $(ARCHIVE_FILES) \
|
||||
|
||||
|
||||
|
||||
BUN_LLD_FLAGS = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES) $(BINDINGS_OBJ) -lwebcrypto
|
||||
BUN_LLD_FLAGS_DEBUG = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES_DEBUG) $(DEBUG_BINDINGS_OBJ) -lwebcrypto-debug
|
||||
BUN_LLD_FLAGS_FAST = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES_DEBUG) $(BINDINGS_OBJ) -lwebcrypto-debug
|
||||
BUN_LLD_FLAGS = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES) $(BINDINGS_OBJ)
|
||||
BUN_LLD_FLAGS_DEBUG = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES_DEBUG) $(DEBUG_BINDINGS_OBJ)
|
||||
BUN_LLD_FLAGS_FAST = $(BUN_LLD_FLAGS_WITHOUT_JSC) $(WRAP_SYMBOLS_ON_LINUX) $(JSC_FILES_DEBUG) $(BINDINGS_OBJ)
|
||||
|
||||
CLANG_VERSION = $(shell $(CC) --version | awk '/version/ {for(i=1; i<=NF; i++){if($$i=="version"){split($$(i+1),v,".");print v[1]}}}')
|
||||
|
||||
@@ -508,7 +518,15 @@ bun:
|
||||
npm-install:
|
||||
$(NPM_CLIENT) install --ignore-scripts --production
|
||||
|
||||
npm-install-dev:
|
||||
$(NPM_CLIENT) install
|
||||
cd test && $(NPM_CLIENT) install
|
||||
cd packages/bun-types && $(NPM_CLIENT) install --production
|
||||
|
||||
print-% : ; @echo $* = $($*)
|
||||
get-% : ; @echo $($*)
|
||||
print-version:
|
||||
@echo $(PACKAGE_JSON_VERSION)
|
||||
|
||||
|
||||
|
||||
@@ -527,13 +545,16 @@ tinycc:
|
||||
make -j10 && \
|
||||
cp $(TINYCC_DIR)/*.a $(BUN_DEPS_OUT_DIR)
|
||||
|
||||
PYTHON=$(shell which python 2>/dev/null || which python3 2>/dev/null || which python2 2>/dev/null)
|
||||
|
||||
.PHONY: builtins
|
||||
builtins: ## to generate builtins
|
||||
@if [ -z "$(WEBKIT_DIR)" ] || [ ! -d "$(WEBKIT_DIR)/Source" ]; then echo "WebKit is not cloned. Please run make init-submodules"; exit 1; fi
|
||||
rm -f src/bun.js/bindings/*Builtin*.cpp src/bun.js/bindings/*Builtin*.h src/bun.js/bindings/*Builtin*.cpp
|
||||
rm -rf src/bun.js/builtins/cpp
|
||||
mkdir -p src/bun.js/builtins/cpp
|
||||
$(shell which python || which python2) $(realpath $(WEBKIT_DIR)/Source/JavaScriptCore/Scripts/generate-js-builtins.py) -i $(realpath src)/bun.js/builtins/js -o $(realpath src)/bun.js/builtins/cpp --framework WebCore --force
|
||||
$(shell which python || which python2) $(realpath $(WEBKIT_DIR)/Source/JavaScriptCore/Scripts/generate-js-builtins.py) -i $(realpath src)/bun.js/builtins/js -o $(realpath src)/bun.js/builtins/cpp --framework WebCore --wrappers-only
|
||||
$(PYTHON) $(realpath $(WEBKIT_DIR)/Source/JavaScriptCore/Scripts/generate-js-builtins.py) -i $(realpath src)/bun.js/builtins/js -o $(realpath src)/bun.js/builtins/cpp --framework WebCore --force
|
||||
$(PYTHON) $(realpath $(WEBKIT_DIR)/Source/JavaScriptCore/Scripts/generate-js-builtins.py) -i $(realpath src)/bun.js/builtins/js -o $(realpath src)/bun.js/builtins/cpp --framework WebCore --wrappers-only
|
||||
rm -rf /tmp/1.h src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h.1
|
||||
echo -e '// clang-format off\nnamespace Zig { class GlobalObject; }\n#include "root.h"\n' >> /tmp/1.h
|
||||
cat /tmp/1.h src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h > src/bun.js/builtins/cpp/WebCoreJSBuiltinInternals.h.1
|
||||
@@ -562,7 +583,11 @@ c-ares:
|
||||
rm -rf $(BUN_DEPS_DIR)/c-ares/build && \
|
||||
mkdir $(BUN_DEPS_DIR)/c-ares/build && \
|
||||
cd $(BUN_DEPS_DIR)/c-ares/build && \
|
||||
cmake $(CMAKE_FLAGS) -DCMAKE_C_FLAGS="$(CFLAGS) -flto=full" -DCMAKE_BUILD_TYPE=Release -DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_SHARED=OFF -G "Ninja" .. && \
|
||||
cmake $(CMAKE_FLAGS) -DCMAKE_C_FLAGS="$(CFLAGS) -flto=full" \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||
-DCARES_STATIC=ON -DCARES_STATIC_PIC=ON -DCARES_SHARED=OFF \
|
||||
-G "Ninja" .. && \
|
||||
ninja && cp lib/libcares.a $(BUN_DEPS_OUT_DIR)/libcares.a
|
||||
|
||||
.PHONY: prepare-types
|
||||
@@ -579,8 +604,7 @@ release-types:
|
||||
|
||||
.PHONY: format
|
||||
format: ## to format the code
|
||||
-$(PRETTIER) --write 'test/bun.js/*.{js,jsx,ts,tsx}'
|
||||
-$(PRETTIER) --write 'test/bun.js/solid-dom-fixtures/**/*.{js,jsx,ts,tsx}'
|
||||
-$(PRETTIER) --write 'test/**/*.{js,jsx,ts,tsx}'
|
||||
|
||||
|
||||
.PHONY: lolhtml
|
||||
@@ -608,7 +632,7 @@ boringssl-debug: boringssl-build-debug boringssl-copy
|
||||
|
||||
.PHONY: compile-ffi-test
|
||||
compile-ffi-test:
|
||||
clang $(OPTIMIZATION_LEVEL) -shared -undefined dynamic_lookup -o /tmp/bun-ffi-test.dylib -fPIC ./test/bun.js/ffi-test.c
|
||||
clang $(OPTIMIZATION_LEVEL) -shared -undefined dynamic_lookup -o /tmp/bun-ffi-test.dylib -fPIC ./test/js/bun/ffi/ffi-test.c
|
||||
|
||||
sqlite:
|
||||
|
||||
@@ -625,7 +649,7 @@ libarchive:
|
||||
|
||||
.PHONY: tgz
|
||||
tgz:
|
||||
$(ZIG) build tgz-obj -Drelease-fast
|
||||
$(ZIG) build tgz-obj -Doptimize=ReleaseFast
|
||||
$(CXX) $(PACKAGE_DIR)/tgz.o -g -o ./misctools/tgz $(DEFAULT_LINKER_FLAGS) -lc $(ARCHIVE_FILES)
|
||||
rm -rf $(PACKAGE_DIR)/tgz.o
|
||||
|
||||
@@ -649,7 +673,8 @@ require:
|
||||
@echo "Checking if the required utilities are available..."
|
||||
@if [ $(CLANG_VERSION) -lt "15" ]; then echo -e "ERROR: clang version >=15 required, found: $(CLANG_VERSION). Install with:\n\n $(POSIX_PKG_MANAGER) install llvm@15"; exit 1; fi
|
||||
@cmake --version >/dev/null 2>&1 || (echo -e "ERROR: cmake is required."; exit 1)
|
||||
@esbuild --version >/dev/null 2>&1 || (echo -e "ERROR: esbuild is required."; exit 1)
|
||||
@$(PYTHON) --version >/dev/null 2>&1 || (echo -e "ERROR: python is required."; exit 1)
|
||||
@$(ESBUILD) --version >/dev/null 2>&1 || (echo -e "ERROR: esbuild is required."; exit 1)
|
||||
@$(NPM_CLIENT) --version >/dev/null 2>&1 || (echo -e "ERROR: NPM client (bun or npm) is required."; exit 1)
|
||||
@go version >/dev/null 2>&1 || (echo -e "ERROR: go is required."; exit 1)
|
||||
@which aclocal > /dev/null || (echo -e "ERROR: automake is required. Install with:\n\n $(POSIX_PKG_MANAGER) install automake"; exit 1)
|
||||
@@ -658,15 +683,15 @@ require:
|
||||
@echo "You have the dependencies installed! Woo"
|
||||
|
||||
init-submodules:
|
||||
git submodule update --init --recursive --progress --depth=1
|
||||
git submodule update --init --recursive --progress --depth=1 --checkout
|
||||
|
||||
.PHONY: build-obj
|
||||
build-obj:
|
||||
$(ZIG) build obj -Drelease-fast -Dcpu="$(CPU_TARGET)"
|
||||
$(ZIG) build obj -Doptimize=ReleaseFast -Dcpu="$(CPU_TARGET)"
|
||||
|
||||
.PHONY: dev-build-obj-wasm
|
||||
dev-build-obj-wasm:
|
||||
$(ZIG) build bun-wasm -Dtarget=wasm32-freestanding --prominent-compile-errors
|
||||
$(ZIG) build bun-wasm -Dtarget=wasm32-freestanding
|
||||
|
||||
.PHONY: dev-wasm
|
||||
dev-wasm: dev-build-obj-wasm
|
||||
@@ -679,7 +704,7 @@ dev-wasm: dev-build-obj-wasm
|
||||
|
||||
.PHONY: build-obj-wasm
|
||||
build-obj-wasm:
|
||||
$(ZIG) build bun-wasm -Drelease-fast -Dtarget=wasm32-freestanding --prominent-compile-errors
|
||||
$(ZIG) build bun-wasm -Doptimize=ReleaseFast -Dtarget=wasm32-freestanding
|
||||
emcc -sEXPORTED_FUNCTIONS="['_bun_free', '_cycleStart', '_cycleEnd', '_bun_malloc', '_scan', '_transform', '_init']" \
|
||||
-g -s ERROR_ON_UNDEFINED_SYMBOLS=0 -DNDEBUG \
|
||||
$(BUN_DEPS_DIR)/libmimalloc.a.wasm \
|
||||
@@ -689,7 +714,7 @@ build-obj-wasm:
|
||||
|
||||
.PHONY: build-obj-wasm-small
|
||||
build-obj-wasm-small:
|
||||
$(ZIG) build bun-wasm -Drelease-small -Dtarget=wasm32-freestanding --prominent-compile-errors
|
||||
$(ZIG) build bun-wasm -Doptimize=ReleaseSmall -Dtarget=wasm32-freestanding
|
||||
emcc -sEXPORTED_FUNCTIONS="['_bun_free', '_cycleStart', '_cycleEnd', '_bun_malloc', '_scan', '_transform', '_init']" \
|
||||
-g -s ERROR_ON_UNDEFINED_SYMBOLS=0 -DNDEBUG \
|
||||
$(BUN_DEPS_DIR)/libmimalloc.a.wasm \
|
||||
@@ -704,10 +729,10 @@ wasm: api build-obj-wasm-small
|
||||
@cp src/api/schema.d.ts packages/bun-wasm/schema.d.ts
|
||||
@cp src/api/schema.js packages/bun-wasm/schema.js
|
||||
@cd packages/bun-wasm && $(NPM_CLIENT) run tsc -- -p .
|
||||
@esbuild --sourcemap=external --external:fs --define:process.env.NODE_ENV='"production"' --outdir=packages/bun-wasm --target=esnext --bundle packages/bun-wasm/index.ts --format=esm --minify 2> /dev/null
|
||||
@$(ESBUILD) --sourcemap=external --external:fs --define:process.env.NODE_ENV='"production"' --outdir=packages/bun-wasm --target=esnext --bundle packages/bun-wasm/index.ts --format=esm --minify 2> /dev/null
|
||||
@mv packages/bun-wasm/index.js packages/bun-wasm/index.mjs
|
||||
@mv packages/bun-wasm/index.js.map packages/bun-wasm/index.mjs.map
|
||||
@esbuild --sourcemap=external --external:fs --define:process.env.NODE_ENV='"production"' --outdir=packages/bun-wasm --target=esnext --bundle packages/bun-wasm/index.ts --format=cjs --minify --platform=node 2> /dev/null
|
||||
@$(ESBUILD) --sourcemap=external --external:fs --define:process.env.NODE_ENV='"production"' --outdir=packages/bun-wasm --target=esnext --bundle packages/bun-wasm/index.ts --format=cjs --minify --platform=node 2> /dev/null
|
||||
@mv packages/bun-wasm/index.js packages/bun-wasm/index.cjs
|
||||
@mv packages/bun-wasm/index.js.map packages/bun-wasm/index.cjs.map
|
||||
@rm -rf packages/bun-wasm/*.tsbuildinfo
|
||||
@@ -716,22 +741,22 @@ wasm: api build-obj-wasm-small
|
||||
|
||||
.PHONY: build-obj-safe
|
||||
build-obj-safe:
|
||||
$(ZIG) build obj -Drelease-safe
|
||||
$(ZIG) build obj -Doptimize=ReleaseSafe -Dcpu="$(CPU_TARGET)"
|
||||
|
||||
UWS_CC_FLAGS = -pthread -DLIBUS_USE_OPENSSL=1 -DUWS_HTTPRESPONSE_NO_WRITEMARK=1 -DLIBUS_USE_BORINGSSL=1 -DWITH_BORINGSSL=1 -Wpedantic -Wall -Wextra -Wsign-conversion -Wconversion $(UWS_INCLUDE) -DUWS_WITH_PROXY
|
||||
UWS_CXX_FLAGS = $(UWS_CC_FLAGS) -std=$(CXX_VERSION) -fno-exceptions
|
||||
UWS_CXX_FLAGS = $(UWS_CC_FLAGS) -std=$(CXX_VERSION) -fno-exceptions -fno-rtti
|
||||
UWS_LDFLAGS = -I$(BUN_DEPS_DIR)/boringssl/include -I$(ZLIB_INCLUDE_DIR)
|
||||
USOCKETS_DIR = $(BUN_DEPS_DIR)/uws/uSockets/
|
||||
USOCKETS_SRC_DIR = $(BUN_DEPS_DIR)/uws/uSockets/src/
|
||||
|
||||
usockets:
|
||||
rm -rf $(BUN_DEPS_DIR)/uws/uSockets/*.o $(BUN_DEPS_DIR)/uws/uSockets/**/*.o $(BUN_DEPS_DIR)/uws/uSockets/*.a $(BUN_DEPS_DIR)/uws/uSockets/*.bc
|
||||
cd $(USOCKETS_DIR) && $(CC_WITH_CCACHE) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CFLAGS) $(UWS_CC_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.c) $(wildcard $(USOCKETS_SRC_DIR)/**/*.c)
|
||||
cd $(USOCKETS_DIR) && $(CXX_WITH_CCACHE) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CXXFLAGS) $(UWS_CXX_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -g -c $(wildcard $(USOCKETS_SRC_DIR)/*.cpp) $(wildcard $(USOCKETS_SRC_DIR)/**/*.cpp)
|
||||
cd $(USOCKETS_DIR) && $(CC_WITH_CCACHE) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CFLAGS) $(UWS_CC_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -c $(wildcard $(USOCKETS_SRC_DIR)/*.c) $(wildcard $(USOCKETS_SRC_DIR)/**/*.c)
|
||||
cd $(USOCKETS_DIR) && $(CXX_WITH_CCACHE) -fno-builtin-malloc -fno-builtin-free -fno-builtin-realloc $(EMIT_LLVM_FOR_RELEASE) $(MACOS_MIN_FLAG) -fPIC $(CXXFLAGS) $(UWS_CXX_FLAGS) -save-temps -I$(BUN_DEPS_DIR)/uws/uSockets/src $(UWS_LDFLAGS) -g $(DEFAULT_LINKER_FLAGS) $(PLATFORM_LINKER_FLAGS) $(OPTIMIZATION_LEVEL) -c $(wildcard $(USOCKETS_SRC_DIR)/*.cpp) $(wildcard $(USOCKETS_SRC_DIR)/**/*.cpp)
|
||||
cd $(USOCKETS_DIR) && $(AR) rcvs $(BUN_DEPS_OUT_DIR)/libusockets.a $(USOCKETS_DIR)/*.{o,bc}
|
||||
|
||||
uws: usockets
|
||||
$(CXX_WITH_CCACHE) $(EMIT_LLVM_FOR_RELEASE) -fPIC -I$(BUN_DEPS_DIR)/uws/uSockets/src $(CLANG_FLAGS) $(CFLAGS) $(UWS_CXX_FLAGS) $(UWS_LDFLAGS) $(PLATFORM_LINKER_FLAGS) -c -I$(BUN_DEPS_DIR) $(BUN_DEPS_OUT_DIR)/libusockets.a $(BUN_DEPS_DIR)/libuwsockets.cpp -o $(BUN_DEPS_OUT_DIR)/libuwsockets.o
|
||||
$(CXX_WITH_CCACHE) -O2 $(EMIT_LLVM_FOR_RELEASE) -fPIC -I$(BUN_DEPS_DIR)/uws/uSockets/src $(CLANG_FLAGS) $(CFLAGS) $(UWS_CXX_FLAGS) $(UWS_LDFLAGS) $(PLATFORM_LINKER_FLAGS) -c -I$(BUN_DEPS_DIR) $(BUN_DEPS_OUT_DIR)/libusockets.a $(BUN_DEPS_DIR)/libuwsockets.cpp -o $(BUN_DEPS_OUT_DIR)/libuwsockets.o
|
||||
|
||||
.PHONY: sign-macos-x64
|
||||
sign-macos-x64:
|
||||
@@ -781,8 +806,7 @@ fmt: fmt-cpp fmt-zig
|
||||
api:
|
||||
./node_modules/.bin/peechy --schema src/api/schema.peechy --esm src/api/schema.js --ts src/api/schema.d.ts --zig src/api/schema.zig
|
||||
$(ZIG) fmt src/api/schema.zig
|
||||
$(PRETTIER) --write src/api/schema.js
|
||||
$(PRETTIER) --write src/api/schema.d.ts
|
||||
$(PRETTIER) --config=.prettierrc.cjs --write src/api/schema.js src/api/schema.d.ts
|
||||
|
||||
.PHONY: node-fallbacks
|
||||
node-fallbacks:
|
||||
@@ -791,21 +815,21 @@ node-fallbacks:
|
||||
|
||||
.PHONY: fallback_decoder
|
||||
fallback_decoder:
|
||||
@esbuild --target=esnext --bundle src/fallback.ts --format=iife --platform=browser --minify > src/fallback.out.js
|
||||
@$(ESBUILD) --target=esnext --bundle src/fallback.ts --format=iife --platform=browser --minify > src/fallback.out.js
|
||||
|
||||
.PHONY: runtime_js
|
||||
runtime_js:
|
||||
@NODE_ENV=production esbuild --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.out.js; cat src/runtime.footer.js >> src/runtime.out.js
|
||||
@NODE_ENV=production esbuild --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index-with-refresh.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.out.refresh.js; cat src/runtime.footer.with-refresh.js >> src/runtime.out.refresh.js
|
||||
@NODE_ENV=production esbuild --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.node.pre.out.js; cat src/runtime.node.pre.out.js src/runtime.footer.node.js > src/runtime.node.out.js
|
||||
@NODE_ENV=production esbuild --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.bun.pre.out.js; cat src/runtime.bun.pre.out.js src/runtime.footer.bun.js > src/runtime.bun.out.js
|
||||
@NODE_ENV=production $(ESBUILD) --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.out.js; cat src/runtime.footer.js >> src/runtime.out.js
|
||||
@NODE_ENV=production $(ESBUILD) --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index-with-refresh.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.out.refresh.js; cat src/runtime.footer.with-refresh.js >> src/runtime.out.refresh.js
|
||||
@NODE_ENV=production $(ESBUILD) --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.node.pre.out.js; cat src/runtime.node.pre.out.js src/runtime.footer.node.js > src/runtime.node.out.js
|
||||
@NODE_ENV=production $(ESBUILD) --define:process.env.NODE_ENV="production" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --minify --external:/bun:* > src/runtime.bun.pre.out.js; cat src/runtime.bun.pre.out.js src/runtime.footer.bun.js > src/runtime.bun.out.js
|
||||
|
||||
.PHONY: runtime_js_dev
|
||||
runtime_js_dev:
|
||||
@NODE_ENV=development esbuild --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.out.js; cat src/runtime.footer.js >> src/runtime.out.js
|
||||
@NODE_ENV=development esbuild --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index-with-refresh.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.out.refresh.js; cat src/runtime.footer.with-refresh.js >> src/runtime.out.refresh.js
|
||||
@NODE_ENV=development esbuild --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.node.pre.out.js; cat src/runtime.node.pre.out.js src/runtime.footer.node.js > src/runtime.node.out.js
|
||||
@NODE_ENV=development esbuild --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.bun.pre.out.js; cat src/runtime.bun.pre.out.js src/runtime.footer.bun.js > src/runtime.bun.out.js
|
||||
@NODE_ENV=development $(ESBUILD) --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.out.js; cat src/runtime.footer.js >> src/runtime.out.js
|
||||
@NODE_ENV=development $(ESBUILD) --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index-with-refresh.ts --format=iife --platform=browser --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.out.refresh.js; cat src/runtime.footer.with-refresh.js >> src/runtime.out.refresh.js
|
||||
@NODE_ENV=development $(ESBUILD) --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.node.pre.out.js; cat src/runtime.node.pre.out.js src/runtime.footer.node.js > src/runtime.node.out.js
|
||||
@NODE_ENV=development $(ESBUILD) --define:process.env.NODE_ENV="development" --target=esnext --bundle src/runtime/index-without-hmr.ts --format=iife --platform=node --global-name=BUN_RUNTIME --external:/bun:* > src/runtime.bun.pre.out.js; cat src/runtime.bun.pre.out.js src/runtime.footer.bun.js > src/runtime.bun.out.js
|
||||
|
||||
.PHONY: bun_error
|
||||
bun_error:
|
||||
@@ -814,18 +838,18 @@ bun_error:
|
||||
.PHONY: generate-install-script
|
||||
generate-install-script:
|
||||
@rm -f $(PACKAGES_REALPATH)/bun/install.js
|
||||
@esbuild --log-level=error --define:BUN_VERSION="\"$(PACKAGE_JSON_VERSION)\"" --define:process.env.NODE_ENV="\"production\"" --platform=node --format=cjs $(PACKAGES_REALPATH)/bun/install.ts > $(PACKAGES_REALPATH)/bun/install.js
|
||||
@$(ESBUILD) --log-level=error --define:BUN_VERSION="\"$(PACKAGE_JSON_VERSION)\"" --define:process.env.NODE_ENV="\"production\"" --platform=node --format=cjs $(PACKAGES_REALPATH)/bun/install.ts > $(PACKAGES_REALPATH)/bun/install.js
|
||||
|
||||
.PHONY: fetch
|
||||
fetch: $(IO_FILES)
|
||||
$(ZIG) build -Drelease-fast fetch-obj
|
||||
$(ZIG) build -Doptimize=ReleaseFast fetch-obj
|
||||
$(CXX) $(PACKAGE_DIR)/fetch.o -g $(OPTIMIZATION_LEVEL) -o ./misctools/fetch $(IO_FILES) $(DEFAULT_LINKER_FLAGS) -lc $(MINIMUM_ARCHIVE_FILES)
|
||||
rm -rf $(PACKAGE_DIR)/fetch.o
|
||||
|
||||
.PHONY: sha
|
||||
sha:
|
||||
$(ZIG) build -Drelease-fast sha-bench-obj
|
||||
$(CXX) $(PACKAGE_DIR)/sha.o -g $(OPTIMIZATION_LEVEL) -o ./misctools/sha $(DEFAULT_LINKER_FLAGS) -lc $(MINIMUM_ARCHIVE_FILES)
|
||||
$(ZIG) build -Doptimize=ReleaseFast sha-bench-obj
|
||||
$(CXX) $(PACKAGE_DIR)/sha.o -I$(BUN_DEPS_DIR) -g $(OPTIMIZATION_LEVEL) -o ./misctools/sha $(DEFAULT_LINKER_FLAGS) -lc $(MINIMUM_ARCHIVE_FILES)
|
||||
rm -rf $(PACKAGE_DIR)/sha.o
|
||||
|
||||
.PHONY: fetch-debug
|
||||
@@ -840,7 +864,7 @@ machbench-debug: $(IO_FILES)
|
||||
|
||||
.PHONY: machbench
|
||||
machbench: $(IO_FILES)
|
||||
$(ZIG) build -Drelease-fast machbench-obj
|
||||
$(ZIG) build -Doptimize=ReleaseFast machbench-obj
|
||||
$(CXX) $(PACKAGE_DIR)/machbench.o -g $(OPTIMIZATION_LEVEL) -o ./misctools/machbench $(IO_FILES) $(DEFAULT_LINKER_FLAGS) -lc $(MINIMUM_ARCHIVE_FILES)
|
||||
rm -rf $(PACKAGE_DIR)/machbench.o
|
||||
|
||||
@@ -852,7 +876,7 @@ httpbench-debug: $(IO_FILES)
|
||||
|
||||
.PHONY: httpbench-release
|
||||
httpbench-release: $(IO_FILES)
|
||||
$(ZIG) build -Drelease-fast httpbench-obj
|
||||
$(ZIG) build -Doptimize=ReleaseFast httpbench-obj
|
||||
$(CXX) $(PACKAGE_DIR)/httpbench.o -g $(OPTIMIZATION_LEVEL) -o ./misctools/httpbench $(IO_FILES) $(DEFAULT_LINKER_FLAGS) -lc $(MINIMUM_ARCHIVE_FILES)
|
||||
rm -rf $(PACKAGE_DIR)/httpbench.o
|
||||
|
||||
@@ -890,31 +914,12 @@ jsc: jsc-build jsc-copy-headers jsc-bindings
|
||||
.PHONY: jsc-build
|
||||
jsc-build: $(JSC_BUILD_STEPS)
|
||||
.PHONY: jsc-bindings
|
||||
jsc-bindings: headers bindings webcrypto-debug webcrypto
|
||||
jsc-bindings: headers bindings
|
||||
|
||||
.PHONY: clone-submodules
|
||||
clone-submodules:
|
||||
git -c submodule."src/bun.js/WebKit".update=none submodule update --init --recursive --depth=1 --progress
|
||||
|
||||
.PHONY: devcontainer
|
||||
devcontainer: $(OBJ_DIR) $(DEBUG_OBJ_DIR) clone-submodules mimalloc zlib libarchive boringssl picohttp identifier-cache node-fallbacks npm-install api analytics bun_error fallback_decoder bindings uws lolhtml usockets tinycc c-ares runtime_js_dev sqlite webcrypto-debug webcrypto
|
||||
|
||||
.PHONY: devcontainer-build
|
||||
devcontainer-build:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer build --workspace-folder .
|
||||
|
||||
.PHONY: devcontainer-up
|
||||
devcontainer-up:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer up --workspace-folder .
|
||||
|
||||
.PHONY: devcontainer-rebuild
|
||||
devcontainer-rebuild:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer up --workspace-folder . --remove-existing-container
|
||||
|
||||
.PHONY: devcontainer-sh
|
||||
devcontainer-sh:
|
||||
DOCKER_BUILDARCH="$(DOCKER_BUILDARCH)" devcontainer exec --workspace-folder . zsh
|
||||
|
||||
CLANG_FORMAT := $(shell command -v clang-format 2> /dev/null)
|
||||
|
||||
.PHONY: headers
|
||||
@@ -922,7 +927,7 @@ headers:
|
||||
rm -f /tmp/build-jsc-headers src/bun.js/bindings/headers.zig
|
||||
touch src/bun.js/bindings/headers.zig
|
||||
$(ZIG) build headers-obj
|
||||
$(CXX) $(PLATFORM_LINKER_FLAGS) $(JSC_FILES_DEBUG) ${ICU_FLAGS} $(DEBUG_IO_FILES) $(BUN_LLD_FLAGS_WITHOUT_JSC) -g $(DEBUG_BIN)/headers.o -W -o /tmp/build-jsc-headers -lc;
|
||||
$(CXX) $(PLATFORM_LINKER_FLAGS) $(JSC_FILES_DEBUG) ${ICU_FLAGS} $(BUN_LLD_FLAGS_WITHOUT_JSC) -g $(DEBUG_BIN)/headers.o -W -o /tmp/build-jsc-headers -lc;
|
||||
/tmp/build-jsc-headers
|
||||
$(ZIG) translate-c src/bun.js/bindings/headers.h > src/bun.js/bindings/headers.zig
|
||||
$(BUN_OR_NODE) misctools/headers-cleaner.js
|
||||
@@ -1073,57 +1078,20 @@ release-bin-dir:
|
||||
|
||||
.PHONY: dev-obj
|
||||
dev-obj:
|
||||
$(ZIG) build obj --prominent-compile-errors
|
||||
$(ZIG) build obj -freference-trace -Dcpu="$(CPU_TARGET)"
|
||||
|
||||
.PHONY: dev-obj-linux
|
||||
dev-obj-linux:
|
||||
$(ZIG) build obj -Dtarget=x86_64-linux-gnu
|
||||
$(ZIG) build obj -Dtarget=x86_64-linux-gnu -Dcpu="$(CPU_TARGET)"
|
||||
|
||||
.PHONY: dev
|
||||
dev: mkdir-dev dev-obj bun-link-lld-debug bun-codesign-debug
|
||||
dev: mkdir-dev dev-obj bun-link-lld-debug
|
||||
|
||||
mkdir-dev:
|
||||
mkdir -p $(DEBUG_PACKAGE_DIR)/bin
|
||||
mkdir -p $(DEBUG_PACKAGE_DIR)
|
||||
|
||||
test-install:
|
||||
cd test/scripts && $(NPM_CLIENT) install
|
||||
|
||||
.PHONY: test-bun-dev
|
||||
test-bun-dev:
|
||||
BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-dev.sh
|
||||
BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-dev-index-html.sh
|
||||
|
||||
.PHONY: test-dev-bun-dev
|
||||
test-dev-bun-dev:
|
||||
BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-dev.sh
|
||||
BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-dev-index-html.sh
|
||||
|
||||
.PHONY: test-bun-snapshot
|
||||
test-bun-snapshot:
|
||||
rm -rf test/bun.js/snapshots.js
|
||||
touch test/bun.js/snapshots.js
|
||||
$(foreach i,$(wildcard test/bun.js/*.snapshot.*),echo "" >> test/bun.js/snapshots.js; echo "// $i" >> test/bun.js/snapshots.js; $(RELEASE_BUN) build $i --platform=bun >> test/bun.js/snapshots.js;)
|
||||
|
||||
.PHONY: test-dev-bun-snapshot
|
||||
test-dev-bun-snapshot:
|
||||
rm -rf test/bun.js/snapshots.debug.js
|
||||
touch test/bun.js/snapshots.debug.js
|
||||
$(foreach i,$(wildcard test/bun.js/*.snapshot.*),echo "" >> test/bun.js/snapshots.debug.js; echo "// $i" >> test/bun.js/snapshots.debug.js; $(DEBUG_BUN) build $i --platform=bun >> test/bun.js/snapshots.debug.js;)
|
||||
|
||||
.PHONY: test-bun-init
|
||||
test-bun-init:
|
||||
BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-init-check.sh
|
||||
|
||||
.PHONY: test-dev-bun-init
|
||||
test-dev-bun-init:
|
||||
BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-init-check.sh
|
||||
|
||||
.PHONY: test-bun-wiptest
|
||||
test-bun-wiptest: test/wiptest/run
|
||||
cd test/wiptest && BUN_BIN=$(DEBUG_BUN) ./run ./fixtures
|
||||
|
||||
.PHONY: test-all
|
||||
test-all: test-install test-bun-snapshot test-with-hmr test-no-hmr test-create-next test-create-react test-bun-run test-bun-install test-bun-dev test-bun-init
|
||||
test-all:
|
||||
$(RELEASE_BUN) test
|
||||
|
||||
.PHONY: copy-test-node-modules
|
||||
copy-test-node-modules:
|
||||
@@ -1134,73 +1102,6 @@ copy-test-node-modules:
|
||||
kill-bun:
|
||||
-killall -9 bun bun-debug
|
||||
|
||||
.PHONY: test-dev-create-next
|
||||
test-dev-create-next:
|
||||
BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-create-next.sh
|
||||
|
||||
.PHONY: test-dev-create-react
|
||||
test-dev-create-react:
|
||||
BUN_BIN=$(DEBUG_BUN) bash test/apps/bun-create-react.sh
|
||||
|
||||
.PHONY: test-create-next
|
||||
test-create-next:
|
||||
BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-create-next.sh
|
||||
|
||||
.PHONY: test-bun-run
|
||||
test-bun-run:
|
||||
cd test/apps && BUN_BIN=$(RELEASE_BUN) bash ./bun-run-check.sh
|
||||
|
||||
.PHONY: test-bun-install
|
||||
test-bun-install: test-bun-install-git-status
|
||||
cd test/apps && JS_RUNTIME=$(RELEASE_BUN) NPM_CLIENT=$(RELEASE_BUN) bash ./bun-install.sh
|
||||
cd test/apps && BUN_BIN=$(RELEASE_BUN) bash ./bun-install-utf8.sh
|
||||
|
||||
.PHONY: test-bun-install-git-status
|
||||
test-bun-install-git-status:
|
||||
cd test/apps && JS_RUNTIME=$(RELEASE_BUN) BUN_BIN=$(RELEASE_BUN) bash ./bun-install-lockfile-status.sh
|
||||
|
||||
.PHONY: test-dev-bun-install
|
||||
test-dev-bun-install: test-dev-bun-install-git-status
|
||||
cd test/apps && JS_RUNTIME=$(DEBUG_BUN) NPM_CLIENT=$(DEBUG_BUN) bash ./bun-install.sh
|
||||
cd test/apps && BUN_BIN=$(DEBUG_BUN) bash ./bun-install-utf8.sh
|
||||
|
||||
.PHONY: test-dev-bun-install-git-status
|
||||
test-dev-bun-install-git-status:
|
||||
cd test/apps && BUN_BIN=$(DEBUG_BUN) bash ./bun-install-lockfile-status.sh
|
||||
|
||||
.PHONY: test-create-react
|
||||
test-create-react:
|
||||
BUN_BIN=$(RELEASE_BUN) bash test/apps/bun-create-react.sh
|
||||
|
||||
.PHONY: test-with-hmr
|
||||
test-with-hmr: kill-bun copy-test-node-modules
|
||||
BUN_BIN=$(RELEASE_BUN) node test/scripts/browser.js
|
||||
|
||||
.PHONY: test-no-hmr
|
||||
test-no-hmr: kill-bun copy-test-node-modules
|
||||
-killall bun -9;
|
||||
DISABLE_HMR="DISABLE_HMR" BUN_BIN=$(RELEASE_BUN) node test/scripts/browser.js
|
||||
|
||||
.PHONY: test-dev-with-hmr
|
||||
test-dev-with-hmr: copy-test-node-modules
|
||||
-killall bun-debug -9;
|
||||
BUN_BIN=$(DEBUG_BUN) node test/scripts/browser.js
|
||||
|
||||
.PHONY: test-dev-no-hmr
|
||||
test-dev-no-hmr: copy-test-node-modules
|
||||
-killall bun-debug -9;
|
||||
DISABLE_HMR="DISABLE_HMR" BUN_BIN=$(DEBUG_BUN) node test/scripts/browser.js
|
||||
|
||||
.PHONY: test-dev-bun-hmr
|
||||
test-dev-bun-run:
|
||||
cd test/apps && BUN_BIN=$(DEBUG_BUN) bash bun-run-check.sh
|
||||
|
||||
.PHONY: test-dev-all
|
||||
test-dev-all: test-install test-dev-bun-snapshot test-dev-with-hmr test-dev-no-hmr test-dev-create-next test-dev-create-react test-dev-bun-run test-dev-bun-install test-dev-bun-dev test-dev-bun-init
|
||||
test-dev-bunjs:
|
||||
|
||||
test-dev: test-dev-with-hmr
|
||||
|
||||
jsc-copy-headers:
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/heap/WeakHandleOwner.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/WeakHandleOwner.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/LazyClassStructureInlines.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/LazyClassStructureInlines.h
|
||||
@@ -1210,10 +1111,10 @@ jsc-copy-headers:
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/runtime/JSModuleNamespaceObject.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/JSModuleNamespaceObject.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/jit/JIT.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/JIT.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/StructureStubInfo.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/StructureStubInfo.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/PolymorphicAccess.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/PolymorphicAccess.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/AccessCase.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/AccessCase.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/ObjectPropertyConditionSet.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/ObjectPropertyConditionSet.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/PolyProtoAccessChain.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/PolyProtoAccessChain.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/InlineCacheCompiler.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/InlineCacheCompiler.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/PutKind.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/PutKind.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/StructureStubClearingWatchpoint.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/StructureStubClearingWatchpoint.h
|
||||
cp $(WEBKIT_DIR)/Source/JavaScriptCore/bytecode/AdaptiveInferredPropertyValueWatchpointBase.h $(WEBKIT_RELEASE_DIR)/JavaScriptCore/PrivateHeaders/JavaScriptCore/AdaptiveInferredPropertyValueWatchpointBase.h
|
||||
@@ -1269,6 +1170,7 @@ jsc-build-mac-compile:
|
||||
-DENABLE_SINGLE_THREADED_VM_ENTRY_SCOPE=ON \
|
||||
-DCMAKE_BUILD_TYPE=relwithdebuginfo \
|
||||
-DUSE_THIN_ARCHIVES=OFF \
|
||||
-DBUN_FAST_TLS=ON \
|
||||
-DENABLE_FTL_JIT=ON \
|
||||
-G Ninja \
|
||||
$(CMAKE_FLAGS_WITHOUT_RELEASE) \
|
||||
@@ -1290,6 +1192,7 @@ jsc-build-mac-compile-lto:
|
||||
-DENABLE_SINGLE_THREADED_VM_ENTRY_SCOPE=ON \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DUSE_THIN_ARCHIVES=OFF \
|
||||
-DBUN_FAST_TLS=ON \
|
||||
-DCMAKE_C_FLAGS="-flto=full" \
|
||||
-DCMAKE_CXX_FLAGS="-flto=full" \
|
||||
-DENABLE_FTL_JIT=ON \
|
||||
@@ -1368,7 +1271,7 @@ jsc-build-mac-copy:
|
||||
clean-jsc:
|
||||
cd src/bun.js/WebKit && rm -rf **/CMakeCache.txt **/CMakeFiles && rm -rf src/bun.js/WebKit/WebKitBuild
|
||||
clean-bindings:
|
||||
rm -rf $(OBJ_DIR)/*.o $(DEBUG_OBJ_DIR)/*.o $(DEBUG_OBJ_DIR)/webcore/*.o $(DEBUG_BINDINGS_OBJ) $(OBJ_DIR)/webcore/*.o $(BINDINGS_OBJ)
|
||||
rm -rf $(OBJ_DIR)/*.o $(DEBUG_OBJ_DIR)/*.o $(DEBUG_OBJ_DIR)/webcore/*.o $(DEBUG_BINDINGS_OBJ) $(OBJ_DIR)/webcore/*.o $(BINDINGS_OBJ) $(OBJ_DIR)/*.d $(DEBUG_OBJ_DIR)/*.d
|
||||
|
||||
.PHONY: clean
|
||||
clean: clean-bindings
|
||||
@@ -1381,20 +1284,29 @@ clean: clean-bindings
|
||||
(cd $(BUN_DEPS_DIR)/c-ares && rm -rf build && make clean) || echo "";
|
||||
|
||||
.PHONY: release-bindings
|
||||
release-bindings: $(OBJ_DIR) $(OBJ_FILES) $(WEBCORE_OBJ_FILES) $(SQLITE_OBJ_FILES) $(NODE_OS_OBJ_FILES) $(BUILTINS_OBJ_FILES) $(IO_FILES) $(MODULES_OBJ_FILES)
|
||||
release-bindings: $(OBJ_DIR) $(OBJ_FILES) $(WEBCORE_OBJ_FILES) $(SQLITE_OBJ_FILES) $(NODE_OS_OBJ_FILES) $(BUILTINS_OBJ_FILES) $(IO_FILES) $(MODULES_OBJ_FILES) $(WEBCRYPTO_OBJ_FILES)
|
||||
|
||||
# Do not add $(DEBUG_DIR) to this list
|
||||
# It will break caching, causing you to have to wait for every .cpp file to rebuild.
|
||||
.PHONY: bindings
|
||||
bindings: $(DEBUG_OBJ_DIR) $(DEBUG_OBJ_FILES) $(DEBUG_WEBCORE_OBJ_FILES) $(DEBUG_SQLITE_OBJ_FILES) $(DEBUG_NODE_OS_OBJ_FILES) $(DEBUG_BUILTINS_OBJ_FILES) $(DEBUG_IO_FILES) $(DEBUG_MODULES_OBJ_FILES)
|
||||
bindings: $(DEBUG_OBJ_DIR) $(DEBUG_OBJ_FILES) $(DEBUG_WEBCORE_OBJ_FILES) $(DEBUG_SQLITE_OBJ_FILES) $(DEBUG_NODE_OS_OBJ_FILES) $(DEBUG_BUILTINS_OBJ_FILES) $(DEBUG_IO_FILES) $(DEBUG_MODULES_OBJ_FILES) $(DEBUG_WEBCRYPTO_OBJ_FILES)
|
||||
|
||||
.PHONY: jsc-bindings-mac
|
||||
jsc-bindings-mac: bindings
|
||||
|
||||
# lInux only
|
||||
MIMALLOC_VALGRIND_ENABLED_FLAG =
|
||||
|
||||
ifeq ($(OS_NAME),linux)
|
||||
MIMALLOC_VALGRIND_ENABLED_FLAG = -DMI_VALGRIND=ON
|
||||
endif
|
||||
|
||||
|
||||
.PHONY: mimalloc-debug
|
||||
mimalloc-debug:
|
||||
rm -rf $(BUN_DEPS_DIR)/mimalloc/CMakeCache* $(BUN_DEPS_DIR)/mimalloc/CMakeFiles
|
||||
cd $(BUN_DEPS_DIR)/mimalloc; make clean || echo ""; \
|
||||
CFLAGS="$(CFLAGS)" cmake $(CMAKE_FLAGS_WITHOUT_RELEASE) ${MIMALLOC_OVERRIDE_FLAG} \
|
||||
CFLAGS="$(CFLAGS)" cmake $(CMAKE_FLAGS_WITHOUT_RELEASE) ${MIMALLOC_OVERRIDE_FLAG} ${MIMALLOC_VALGRIND_ENABLED_FLAG} \
|
||||
-DCMAKE_BUILD_TYPE=Debug \
|
||||
-DMI_DEBUG_FULL=1 \
|
||||
-DMI_SKIP_COLLECT_ON_EXIT=1 \
|
||||
@@ -1545,6 +1457,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1555,6 +1468,7 @@ $(OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1565,6 +1479,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/webcore/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1575,6 +1490,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/sqlite/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1585,6 +1501,7 @@ $(OBJ_DIR)/%.o: src/io/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1595,6 +1512,7 @@ $(OBJ_DIR)/%.o: $(SRC_DIR)/node_os/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1605,6 +1523,19 @@ $(OBJ_DIR)/%.o: src/bun.js/builtins/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM) \
|
||||
-c -o $@ $<
|
||||
|
||||
|
||||
$(OBJ_DIR)/%.o: src/bun.js/bindings/webcrypto/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1618,6 +1549,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) $(UWS_INCLUDE) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1632,6 +1564,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/webcore/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1644,6 +1577,7 @@ $(DEBUG_OBJ_DIR)/%.o: src/io/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1659,6 +1593,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/sqlite/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1673,6 +1608,7 @@ $(DEBUG_OBJ_DIR)/%.o: $(SRC_DIR)/node_os/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1687,6 +1623,7 @@ $(DEBUG_OBJ_DIR)/%.o: src/bun.js/builtins/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1699,6 +1636,7 @@ $(DEBUG_OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
@@ -1707,11 +1645,12 @@ $(DEBUG_OBJ_DIR)/%.o: src/bun.js/modules/%.cpp
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
|
||||
|
||||
$(DEBUG_OBJ_DIR)/webcrypto/%.o: src/bun.js/bindings/webcrypto/%.cpp
|
||||
.PHONY: src/bun.js/bindings/webcrypto/%.cpp
|
||||
$(DEBUG_OBJ_DIR)/%.o: src/bun.js/bindings/webcrypto/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(DEBUG_OPTIMIZATION_LEVEL) \
|
||||
-MMD \
|
||||
-fno-exceptions \
|
||||
-I$(SRC_DIR) \
|
||||
-fno-rtti \
|
||||
@@ -1720,43 +1659,6 @@ $(DEBUG_OBJ_DIR)/webcrypto/%.o: src/bun.js/bindings/webcrypto/%.cpp
|
||||
-DBUN_DEBUG \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
|
||||
|
||||
|
||||
.PHONY: webcrypto-debug-obj
|
||||
# Make all the .cpp files in the webcrypto directory into .o files using Makefile substitutions
|
||||
webcrypto-debug-obj: $(patsubst src/bun.js/bindings/webcrypto/%.cpp, $(DEBUG_OBJ_DIR)/webcrypto/%.o, $(wildcard src/bun.js/bindings/webcrypto/*.cpp))
|
||||
|
||||
.PHONY: webcrypto-debug
|
||||
webcrypto-debug:
|
||||
rm -rf $(DEBUG_OBJ_DIR)/webcrypto $(BUN_DEPS_OUT_DIR)/libwebcrypto-debug.a
|
||||
mkdir -p $(DEBUG_OBJ_DIR)/webcrypto
|
||||
make webcrypto-debug-obj -j$(CPUS)
|
||||
$(AR) rcs $(BUN_DEPS_OUT_DIR)/libwebcrypto-debug.a $(DEBUG_OBJ_DIR)/webcrypto/*.o
|
||||
|
||||
|
||||
$(OBJ_DIR)/webcrypto/%.o: src/bun.js/bindings/webcrypto/%.cpp
|
||||
$(CXX_WITH_CCACHE) $(CLANG_FLAGS) \
|
||||
$(MACOS_MIN_FLAG) \
|
||||
$(OPTIMIZATION_LEVEL) \
|
||||
-fno-exceptions \
|
||||
-fno-rtti \
|
||||
-ferror-limit=1000 \
|
||||
$(EMIT_LLVM_FOR_RELEASE) \
|
||||
-g3 -c -o $@ $<
|
||||
|
||||
|
||||
.PHONY: webcrypto-obj
|
||||
# Make all the .cpp files in the webcrypto directory into .o files using Makefile substitutions
|
||||
webcrypto-obj: $(patsubst src/bun.js/bindings/webcrypto/%.cpp, $(OBJ_DIR)/webcrypto/%.o, $(wildcard src/bun.js/bindings/webcrypto/*.cpp))
|
||||
|
||||
.PHONY: webcrypto
|
||||
webcrypto:
|
||||
rm -rf $(OBJ_DIR)/webcrypto $(BUN_DEPS_OUT_DIR)/libwebcrypto.a
|
||||
mkdir -p $(OBJ_DIR)/webcrypto
|
||||
make webcrypto-obj -j$(CPUS)
|
||||
$(AR) rcs $(BUN_DEPS_OUT_DIR)/libwebcrypto.a $(OBJ_DIR)/webcrypto/*.o
|
||||
|
||||
sizegen:
|
||||
mkdir -p $(BUN_TMP_DIR)
|
||||
$(CXX) src/bun.js/headergen/sizegen.cpp -Wl,-dead_strip -Wl,-dead_strip_dylibs -fuse-ld=lld -o $(BUN_TMP_DIR)/sizegen $(CLANG_FLAGS) -O1
|
||||
@@ -1923,12 +1825,31 @@ copy-to-bun-release-dir-bin:
|
||||
PACKAGE_MAP = --pkg-begin async_io $(BUN_DIR)/src/io/io_darwin.zig --pkg-begin bun $(BUN_DIR)/src/bun_redirect.zig --pkg-end --pkg-end --pkg-begin javascript_core $(BUN_DIR)/src/jsc.zig --pkg-begin bun $(BUN_DIR)/src/bun_redirect.zig --pkg-end --pkg-end --pkg-begin bun $(BUN_DIR)/src/bun_redirect.zig --pkg-end
|
||||
|
||||
|
||||
.PHONY: vendor-without-npm
|
||||
vendor-without-npm: node-fallbacks runtime_js fallback_decoder bun_error mimalloc picohttp zlib boringssl libarchive lolhtml sqlite usockets uws tinycc c-ares
|
||||
|
||||
.PHONY: vendor-without-check
|
||||
vendor-without-check: npm-install node-fallbacks runtime_js fallback_decoder bun_error mimalloc picohttp zlib boringssl libarchive lolhtml sqlite usockets uws tinycc c-ares
|
||||
vendor-without-check: npm-install vendor-without-npm
|
||||
|
||||
.PHONY: vendor
|
||||
vendor: require init-submodules vendor-without-check
|
||||
|
||||
.PHONY: vendor-dev
|
||||
vendor-dev: require init-submodules npm-install-dev vendor-without-npm
|
||||
|
||||
.PHONY: bun
|
||||
bun: vendor identifier-cache build-obj bun-link-lld-release bun-codesign-release-local
|
||||
|
||||
.PHONY: regenerate-bindings
|
||||
regenerate-bindings:
|
||||
@make clean-bindings builtins
|
||||
@make bindings -j$(CPU_COUNT)
|
||||
|
||||
.PHONY: setup
|
||||
setup: vendor-dev builtins identifier-cache clean-bindings
|
||||
make jsc-check
|
||||
make bindings -j$(CPU_COUNT)
|
||||
@echo ""
|
||||
@echo "Development environment setup complete"
|
||||
@echo "Run \`make dev\` to build \`bun-debug\`"
|
||||
@echo ""
|
||||
|
||||
BIN
bench/bun.lockb
BIN
bench/bun.lockb
Binary file not shown.
@@ -6,7 +6,4 @@ const arg = process.argv.slice(1);
|
||||
|
||||
// TODO: remove Buffer.from() when readFileSync() returns Buffer
|
||||
|
||||
for (let i = 0; i < count; i++)
|
||||
console.log(
|
||||
arg.map((file) => Buffer.from(readFileSync(file, "utf8"))).join("")
|
||||
);
|
||||
for (let i = 0; i < count; i++) console.log(arg.map(file => Buffer.from(readFileSync(file, "utf8"))).join(""));
|
||||
|
||||
@@ -7,14 +7,8 @@ function runner(ready) {
|
||||
for (let i = 0; i < size; i++) {
|
||||
rand[i] = (Math.random() * 1024 * 1024) | 0;
|
||||
}
|
||||
const dest = `/tmp/fs-test-copy-file-${(
|
||||
(Math.random() * 10000000 + 100) |
|
||||
0
|
||||
).toString(32)}`;
|
||||
const src = `/tmp/fs-test-copy-file-${(
|
||||
(Math.random() * 10000000 + 100) |
|
||||
0
|
||||
).toString(32)}`;
|
||||
const dest = `/tmp/fs-test-copy-file-${((Math.random() * 10000000 + 100) | 0).toString(32)}`;
|
||||
const src = `/tmp/fs-test-copy-file-${((Math.random() * 10000000 + 100) | 0).toString(32)}`;
|
||||
writeFileSync(src, Buffer.from(rand.buffer), { encoding: "buffer" });
|
||||
const { size: fileSize } = statSync(src);
|
||||
if (fileSize !== rand.byteLength) {
|
||||
@@ -35,6 +29,6 @@ runner((src, dest, rand) =>
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
})
|
||||
}),
|
||||
);
|
||||
await run();
|
||||
|
||||
Binary file not shown.
@@ -1 +1 @@
|
||||
console.log("Hello via Bun!");
|
||||
console.log("Hello via Bun!");
|
||||
|
||||
@@ -6,9 +6,7 @@ bench(`fetch(https://example.com) x ${count}`, async () => {
|
||||
const requests = new Array(count);
|
||||
|
||||
for (let i = 0; i < requests.length; i++) {
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
|
||||
r.text(),
|
||||
);
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then(r => r.text());
|
||||
}
|
||||
|
||||
await Promise.all(requests);
|
||||
|
||||
@@ -6,9 +6,7 @@ bench(`fetch(https://example.com) x ${count}`, async () => {
|
||||
const requests = new Array(count);
|
||||
|
||||
for (let i = 0; i < requests.length; i++) {
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
|
||||
r.text(),
|
||||
);
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then(r => r.text());
|
||||
}
|
||||
|
||||
await Promise.all(requests);
|
||||
|
||||
@@ -6,9 +6,7 @@ bench(`fetch(https://example.com) x ${count}`, async () => {
|
||||
const requests = new Array(count);
|
||||
|
||||
for (let i = 0; i < requests.length; i++) {
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then((r) =>
|
||||
r.text()
|
||||
);
|
||||
requests[i] = fetch(`https://www.example.com/?cachebust=${i}`).then(r => r.text());
|
||||
}
|
||||
|
||||
await Promise.all(requests);
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
import { ptr, dlopen, CString, toBuffer } from "bun:ffi";
|
||||
import { run, bench, group } from "mitata";
|
||||
|
||||
const { napiNoop, napiHash, napiString } = require(import.meta.dir +
|
||||
"/src/ffi_napi_bench.node");
|
||||
const { napiNoop, napiHash, napiString } = require(import.meta.dir + "/src/ffi_napi_bench.node");
|
||||
|
||||
const {
|
||||
symbols: {
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { run, bench, group } from "../node_modules/mitata/src/cli.mjs";
|
||||
|
||||
const extension = "darwin" !== Deno.build.os ? "so" : "dylib";
|
||||
const path = new URL(
|
||||
"src/target/release/libffi_napi_bench." + extension,
|
||||
import.meta.url,
|
||||
).pathname;
|
||||
const path = new URL("src/target/release/libffi_napi_bench." + extension, import.meta.url).pathname;
|
||||
|
||||
const {
|
||||
symbols: { ffi_noop, ffi_hash, ffi_string },
|
||||
|
||||
Binary file not shown.
@@ -29,7 +29,7 @@ loop:
|
||||
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \
|
||||
-e 'end tell'
|
||||
sleep 0.5
|
||||
cd src; zig run -Drelease-fast ../color-looper.zig -- ./colors.css:0 $(SLEEP_INTERVAL)
|
||||
cd src; zig run -Doptimize=ReleaseFast ../color-looper.zig -- ./colors.css:0 $(SLEEP_INTERVAL)
|
||||
cp src/colors.css.blob $(PROJECT)/colors.css.blob
|
||||
|
||||
loop-emotion:
|
||||
@@ -40,7 +40,7 @@ loop-emotion:
|
||||
-e 'if windows is not {} then perform action "AXRaise" of item 1 of windows' \
|
||||
-e 'end tell'
|
||||
sleep 0.5
|
||||
cd src; zig run -Drelease-fast ../color-looper.emotion.zig -- ./css-in-js-styles.tsx:0 $(SLEEP_INTERVAL)
|
||||
cd src; zig run -Doptimize=ReleaseFast ../color-looper.emotion.zig -- ./css-in-js-styles.tsx:0 $(SLEEP_INTERVAL)
|
||||
cp src/css-in-js-styles.tsx.blob $(PROJECT)/css-in-js-styles.blob
|
||||
|
||||
process_video:
|
||||
|
||||
@@ -24,7 +24,7 @@ if (process.env.PROJECT === "bun") {
|
||||
|
||||
// bunProcess.stderr.pipe(process.stderr);
|
||||
// bunProcess.stdout.pipe(process.stdout);
|
||||
bunProcess.once("error", (err) => {
|
||||
bunProcess.once("error", err => {
|
||||
console.error("❌ bun error", err);
|
||||
process.exit(1);
|
||||
});
|
||||
@@ -32,19 +32,15 @@ if (process.env.PROJECT === "bun") {
|
||||
bunProcess?.kill(0);
|
||||
});
|
||||
} else if (process.env.PROJECT === "next") {
|
||||
const bunProcess = child_process.spawn(
|
||||
"./node_modules/.bin/next",
|
||||
["--port", "8080"],
|
||||
{
|
||||
cwd: process.cwd(),
|
||||
stdio: "ignore",
|
||||
env: {
|
||||
...process.env,
|
||||
},
|
||||
|
||||
shell: false,
|
||||
const bunProcess = child_process.spawn("./node_modules/.bin/next", ["--port", "8080"], {
|
||||
cwd: process.cwd(),
|
||||
stdio: "ignore",
|
||||
env: {
|
||||
...process.env,
|
||||
},
|
||||
);
|
||||
|
||||
shell: false,
|
||||
});
|
||||
}
|
||||
|
||||
const delay = new Promise((resolve, reject) => {
|
||||
@@ -111,7 +107,7 @@ async function main() {
|
||||
return runPage();
|
||||
}
|
||||
|
||||
main().catch((error) =>
|
||||
main().catch(error =>
|
||||
setTimeout(() => {
|
||||
throw error;
|
||||
}),
|
||||
|
||||
Binary file not shown.
@@ -4,9 +4,7 @@ const path = require("path");
|
||||
const PROJECT = process.env.PROJECT || "bun";
|
||||
const percentile = require("percentile");
|
||||
const PACKAGE_NAME = process.env.PACKAGE_NAME;
|
||||
const label = `${PACKAGE_NAME}@${
|
||||
require(PACKAGE_NAME + "/package.json").version
|
||||
}`;
|
||||
const label = `${PACKAGE_NAME}@${require(PACKAGE_NAME + "/package.json").version}`;
|
||||
|
||||
const BASEFOLDER = path.resolve(PROJECT);
|
||||
const OUTFILE = path.join(process.cwd(), process.env.OUTFILE);
|
||||
@@ -20,10 +18,10 @@ const TOTAL_FRAMES = VALID_TIMES.length;
|
||||
const timings = fs
|
||||
.readFileSync(BASEFOLDER + "/frames.all.clean", "utf8")
|
||||
.split("\n")
|
||||
.map((a) => a.replace(/[Ran:'\.]?/gm, "").trim())
|
||||
.filter((a) => parseInt(a, 10))
|
||||
.filter((a) => a.length > 0 && VALID_TIMES.includes(BigInt(parseInt(a, 10))))
|
||||
.map((num) => BigInt(num));
|
||||
.map(a => a.replace(/[Ran:'\.]?/gm, "").trim())
|
||||
.filter(a => parseInt(a, 10))
|
||||
.filter(a => a.length > 0 && VALID_TIMES.includes(BigInt(parseInt(a, 10))))
|
||||
.map(num => BigInt(num));
|
||||
|
||||
timings.sort();
|
||||
|
||||
@@ -47,7 +45,7 @@ const report = {
|
||||
name: PACKAGE_NAME,
|
||||
version: require(PACKAGE_NAME + "/package.json").version,
|
||||
},
|
||||
timestamps: timings.map((a) => Number(a)),
|
||||
timestamps: timings.map(a => Number(a)),
|
||||
frameTimes: frameTime,
|
||||
percentileMs: {
|
||||
50: percentile(50, frameTime) / 10,
|
||||
@@ -67,9 +65,7 @@ fs.writeFileSync(
|
||||
"." +
|
||||
process.env.SLEEP_INTERVAL +
|
||||
"ms." +
|
||||
`${process.platform}-${
|
||||
process.arch === "arm64" ? "aarch64" : process.arch
|
||||
}` +
|
||||
`${process.platform}-${process.arch === "arm64" ? "aarch64" : process.arch}` +
|
||||
".json",
|
||||
),
|
||||
JSON.stringify(report, null, 2),
|
||||
@@ -99,9 +95,5 @@ console.log(
|
||||
timings.length,
|
||||
"/",
|
||||
TOTAL_FRAMES,
|
||||
"(" +
|
||||
Math.round(
|
||||
Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100,
|
||||
) +
|
||||
"%)",
|
||||
"(" + Math.round(Math.max(Math.min(1.0, timings.length / TOTAL_FRAMES), 0) * 100) + "%)",
|
||||
);
|
||||
|
||||
@@ -3,10 +3,7 @@ import classNames from "classnames";
|
||||
import ReactDOM from "react-dom";
|
||||
|
||||
const Base = ({}) => {
|
||||
const name =
|
||||
typeof location !== "undefined"
|
||||
? decodeURIComponent(location.search.substring(1))
|
||||
: null;
|
||||
const name = typeof location !== "undefined" ? decodeURIComponent(location.search.substring(1)) : null;
|
||||
return <Main productName={name} />;
|
||||
};
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ export const Main = (props: { productName: string; cssInJS?: string }) => {
|
||||
<header>
|
||||
<div className="Title">CSS HMR Stress Test!</div>
|
||||
<p className="Description">
|
||||
This page visually tests how quickly a bundler can update{" "}
|
||||
{props.cssInJS ? "CSS-in-JS" : "CSS"} over Hot Module Reloading.
|
||||
This page visually tests how quickly a bundler can update {props.cssInJS ? "CSS-in-JS" : "CSS"} over Hot
|
||||
Module Reloading.
|
||||
</p>
|
||||
</header>
|
||||
<main className="main">
|
||||
@@ -19,9 +19,7 @@ export const Main = (props: { productName: string; cssInJS?: string }) => {
|
||||
<div className="ProgressBar-container">
|
||||
<div className="ProgressBar"></div>
|
||||
</div>
|
||||
<div className="SectionLabel">
|
||||
The progress bar should move from left to right smoothly.
|
||||
</div>
|
||||
<div className="SectionLabel">The progress bar should move from left to right smoothly.</div>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
@@ -42,21 +40,15 @@ export const Main = (props: { productName: string; cssInJS?: string }) => {
|
||||
<div className="Spinner"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="SectionLabel">
|
||||
The spinners should rotate & change color smoothly.
|
||||
</div>
|
||||
<div className="SectionLabel">The spinners should rotate & change color smoothly.</div>
|
||||
</section>
|
||||
</main>
|
||||
<footer>
|
||||
<div className="SectionLabel FooterLabel">
|
||||
There are no CSS animations on this page.
|
||||
</div>
|
||||
<div className="SectionLabel FooterLabel">There are no CSS animations on this page.</div>
|
||||
|
||||
<div className="Bundler-container">
|
||||
<div className="Bundler">{props.productName}</div>
|
||||
<div className="Bundler-updateRate">
|
||||
{props.cssInJS ? "CSS-in-JS framework: " + props.cssInJS : ""}
|
||||
</div>
|
||||
<div className="Bundler-updateRate">{props.cssInJS ? "CSS-in-JS framework: " + props.cssInJS : ""}</div>
|
||||
</div>
|
||||
</footer>
|
||||
</>
|
||||
|
||||
4
bench/install/.eslintrc.js
Normal file
4
bench/install/.eslintrc.js
Normal file
@@ -0,0 +1,4 @@
|
||||
/** @type {import('eslint').Linter.Config} */
|
||||
module.exports = {
|
||||
extends: ["@remix-run/eslint-config", "@remix-run/eslint-config/node"],
|
||||
};
|
||||
10
bench/install/.gitignore
vendored
Normal file
10
bench/install/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
node_modules
|
||||
|
||||
/.cache
|
||||
/build
|
||||
/public/build
|
||||
.env
|
||||
package-lock.json
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
bun.lockb
|
||||
18
bench/install/README.md
Normal file
18
bench/install/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# `install` benchmark
|
||||
|
||||
Requires [`hyperfine`](https://github.com/sharkdp/hyperfine)
|
||||
|
||||
```
|
||||
$ hyperfine --prepare 'rm -rf node_modules' --warmup 1 --runs 3 'bun install' 'pnpm install' 'yarn' 'npm install'
|
||||
```
|
||||
|
||||
To check that the app is working as expected:
|
||||
|
||||
```
|
||||
$ bun run dev
|
||||
$ npm run dev
|
||||
$ yarn dev
|
||||
$ pnpm dev
|
||||
```
|
||||
|
||||
Then visit [http://localhost:3000](http://localhost:3000).
|
||||
18
bench/install/app/entry.client.tsx
Normal file
18
bench/install/app/entry.client.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
/**
|
||||
* By default, Remix will handle hydrating your app on the client for you.
|
||||
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨
|
||||
* For more information, see https://remix.run/docs/en/main/file-conventions/entry.client
|
||||
*/
|
||||
|
||||
import { RemixBrowser } from "@remix-run/react";
|
||||
import { startTransition, StrictMode } from "react";
|
||||
import { hydrateRoot } from "react-dom/client";
|
||||
|
||||
startTransition(() => {
|
||||
hydrateRoot(
|
||||
document,
|
||||
<StrictMode>
|
||||
<RemixBrowser />
|
||||
</StrictMode>,
|
||||
);
|
||||
});
|
||||
101
bench/install/app/entry.server.tsx
Normal file
101
bench/install/app/entry.server.tsx
Normal file
@@ -0,0 +1,101 @@
|
||||
/**
|
||||
* By default, Remix will handle generating the HTTP Response for you.
|
||||
* You are free to delete this file if you'd like to, but if you ever want it revealed again, you can run `npx remix reveal` ✨
|
||||
* For more information, see https://remix.run/docs/en/main/file-conventions/entry.server
|
||||
*/
|
||||
|
||||
import { PassThrough } from "node:stream";
|
||||
import type { EntryContext } from "@remix-run/node";
|
||||
import { Response } from "@remix-run/node";
|
||||
import { RemixServer } from "@remix-run/react";
|
||||
import isbot from "isbot";
|
||||
import { renderToPipeableStream } from "react-dom/server";
|
||||
|
||||
const ABORT_DELAY = 5_000;
|
||||
|
||||
export default function handleRequest(
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext,
|
||||
) {
|
||||
return isbot(request.headers.get("user-agent"))
|
||||
? handleBotRequest(request, responseStatusCode, responseHeaders, remixContext)
|
||||
: handleBrowserRequest(request, responseStatusCode, responseHeaders, remixContext);
|
||||
}
|
||||
|
||||
function handleBotRequest(
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext,
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const { pipe, abort } = renderToPipeableStream(
|
||||
<RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} />,
|
||||
{
|
||||
onAllReady() {
|
||||
const body = new PassThrough();
|
||||
|
||||
responseHeaders.set("Content-Type", "text/html");
|
||||
|
||||
resolve(
|
||||
new Response(body, {
|
||||
headers: responseHeaders,
|
||||
status: responseStatusCode,
|
||||
}),
|
||||
);
|
||||
|
||||
pipe(body);
|
||||
},
|
||||
onShellError(error: unknown) {
|
||||
reject(error);
|
||||
},
|
||||
onError(error: unknown) {
|
||||
responseStatusCode = 500;
|
||||
console.error(error);
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
setTimeout(abort, ABORT_DELAY);
|
||||
});
|
||||
}
|
||||
|
||||
function handleBrowserRequest(
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext,
|
||||
) {
|
||||
return new Promise((resolve, reject) => {
|
||||
const { pipe, abort } = renderToPipeableStream(
|
||||
<RemixServer context={remixContext} url={request.url} abortDelay={ABORT_DELAY} />,
|
||||
{
|
||||
onShellReady() {
|
||||
const body = new PassThrough();
|
||||
|
||||
responseHeaders.set("Content-Type", "text/html");
|
||||
|
||||
resolve(
|
||||
new Response(body, {
|
||||
headers: responseHeaders,
|
||||
status: responseStatusCode,
|
||||
}),
|
||||
);
|
||||
|
||||
pipe(body);
|
||||
},
|
||||
onShellError(error: unknown) {
|
||||
reject(error);
|
||||
},
|
||||
onError(error: unknown) {
|
||||
console.error(error);
|
||||
responseStatusCode = 500;
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
setTimeout(abort, ABORT_DELAY);
|
||||
});
|
||||
}
|
||||
20
bench/install/app/root.tsx
Normal file
20
bench/install/app/root.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import { Links, LiveReload, Meta, Outlet, Scripts, ScrollRestoration } from "@remix-run/react";
|
||||
|
||||
export default function App() {
|
||||
return (
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charSet="utf-8" />
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1" />
|
||||
<Meta />
|
||||
<Links />
|
||||
</head>
|
||||
<body>
|
||||
<Outlet />
|
||||
<ScrollRestoration />
|
||||
<Scripts />
|
||||
<LiveReload />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
30
bench/install/app/routes/_index.tsx
Normal file
30
bench/install/app/routes/_index.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { V2_MetaFunction } from "@remix-run/node";
|
||||
|
||||
export const meta: V2_MetaFunction = () => {
|
||||
return [{ title: "New Remix App" }];
|
||||
};
|
||||
|
||||
export default function Index() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
<h1>Welcome to Remix</h1>
|
||||
<ul>
|
||||
<li>
|
||||
<a target="_blank" href="https://remix.run/tutorials/blog" rel="noreferrer">
|
||||
15m Quickstart Blog Tutorial
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="https://remix.run/tutorials/jokes" rel="noreferrer">
|
||||
Deep Dive Jokes App Tutorial
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="https://remix.run/docs" rel="noreferrer">
|
||||
Remix Docs
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
31
bench/install/package.json
Normal file
31
bench/install/package.json
Normal file
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"private": true,
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"build": "remix build",
|
||||
"dev": "remix dev",
|
||||
"start": "remix-serve build",
|
||||
"typecheck": "tsc",
|
||||
"clean": "rm -rf node_modules",
|
||||
"bench": "hyperfine --prepare 'rm -rf node_modules' --warmup 1 --runs 3 'bun install' 'pnpm install' 'yarn' 'npm install'"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/node": "^1.15.0",
|
||||
"@remix-run/react": "^1.15.0",
|
||||
"@remix-run/serve": "^1.15.0",
|
||||
"isbot": "^3.6.5",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@remix-run/dev": "^1.15.0",
|
||||
"@remix-run/eslint-config": "^1.15.0",
|
||||
"@types/react": "^18.0.25",
|
||||
"@types/react-dom": "^18.0.8",
|
||||
"eslint": "^8.27.0",
|
||||
"typescript": "^4.8.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
}
|
||||
}
|
||||
BIN
bench/install/public/favicon.ico
Normal file
BIN
bench/install/public/favicon.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
14
bench/install/remix.config.js
Normal file
14
bench/install/remix.config.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/** @type {import('@remix-run/dev').AppConfig} */
|
||||
module.exports = {
|
||||
ignoredRouteFiles: ["**/.*"],
|
||||
// appDirectory: "app",
|
||||
// assetsBuildDirectory: "public/build",
|
||||
// serverBuildPath: "build/index.js",
|
||||
// publicPath: "/build/",
|
||||
future: {
|
||||
v2_errorBoundary: true,
|
||||
v2_meta: true,
|
||||
v2_normalizeFormMethod: true,
|
||||
v2_routeConvention: true,
|
||||
},
|
||||
};
|
||||
2
bench/install/remix.env.d.ts
vendored
Normal file
2
bench/install/remix.env.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="@remix-run/dev" />
|
||||
/// <reference types="@remix-run/node" />
|
||||
22
bench/install/tsconfig.json
Normal file
22
bench/install/tsconfig.json
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
|
||||
"compilerOptions": {
|
||||
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
||||
"isolatedModules": true,
|
||||
"esModuleInterop": true,
|
||||
"jsx": "react-jsx",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"target": "ES2019",
|
||||
"strict": true,
|
||||
"allowJs": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"~/*": ["./app/*"]
|
||||
},
|
||||
|
||||
// Remix takes care of building everything in `remix build`.
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,8 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("JSON.stringify({hello: 'world'})", () =>
|
||||
JSON.stringify({ hello: "world" }),
|
||||
);
|
||||
bench("JSON.stringify({hello: 'world'})", () => JSON.stringify({ hello: "world" }));
|
||||
|
||||
const otherUint8Array = new Uint8Array(1024);
|
||||
bench("Uint8Array.from(otherUint8Array)", () =>
|
||||
Uint8Array.from(otherUint8Array),
|
||||
);
|
||||
bench("Uint8Array.from(otherUint8Array)", () => Uint8Array.from(otherUint8Array));
|
||||
|
||||
run();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
bench("console.log('hello')", () => console.log("hello"));
|
||||
bench("console.log({ hello: 'object' })", () =>
|
||||
console.log({ hello: "object" }),
|
||||
);
|
||||
bench("console.log({ hello: 'object' })", () => console.log({ hello: "object" }));
|
||||
await run();
|
||||
|
||||
@@ -47,11 +47,7 @@ fs.writeFileSync(
|
||||
output + `/file${count}.mjs`,
|
||||
`
|
||||
export const THE_END = true;
|
||||
${
|
||||
saveStack
|
||||
? `globalThis.evaluationOrder.push("${output}/file${count}.mjs");`
|
||||
: ""
|
||||
}
|
||||
${saveStack ? `globalThis.evaluationOrder.push("${output}/file${count}.mjs");` : ""}
|
||||
`,
|
||||
"utf8",
|
||||
);
|
||||
@@ -60,11 +56,7 @@ fs.writeFileSync(
|
||||
output + `/file${count}.js`,
|
||||
`
|
||||
module.exports.THE_END = true;
|
||||
${
|
||||
saveStack
|
||||
? `globalThis.evaluationOrder.push("${output}/file${count}.js");`
|
||||
: ""
|
||||
}
|
||||
${saveStack ? `globalThis.evaluationOrder.push("${output}/file${count}.js");` : ""}
|
||||
`,
|
||||
"utf8",
|
||||
);
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
import { bench, run } from "mitata";
|
||||
import { cpus, endianness, arch, uptime, networkInterfaces, getPriority, totalmem, freemem, homedir, hostname, loadavg, platform, release, setPriority, tmpdir, type, userInfo, version } from "node:os";
|
||||
import {
|
||||
cpus,
|
||||
endianness,
|
||||
arch,
|
||||
uptime,
|
||||
networkInterfaces,
|
||||
getPriority,
|
||||
totalmem,
|
||||
freemem,
|
||||
homedir,
|
||||
hostname,
|
||||
loadavg,
|
||||
platform,
|
||||
release,
|
||||
setPriority,
|
||||
tmpdir,
|
||||
type,
|
||||
userInfo,
|
||||
version,
|
||||
} from "node:os";
|
||||
|
||||
bench("cpus()", () => cpus());
|
||||
bench("networkInterfaces()", () => networkInterfaces());
|
||||
|
||||
@@ -1,5 +1,24 @@
|
||||
import { bench, run } from "mitata";
|
||||
import { cpus, endianness, arch, uptime, networkInterfaces, getPriority, totalmem, freemem, homedir, hostname, loadavg, platform, release, setPriority, tmpdir, type, userInfo, version } from "node:os";
|
||||
import {
|
||||
cpus,
|
||||
endianness,
|
||||
arch,
|
||||
uptime,
|
||||
networkInterfaces,
|
||||
getPriority,
|
||||
totalmem,
|
||||
freemem,
|
||||
homedir,
|
||||
hostname,
|
||||
loadavg,
|
||||
platform,
|
||||
release,
|
||||
setPriority,
|
||||
tmpdir,
|
||||
type,
|
||||
userInfo,
|
||||
version,
|
||||
} from "node:os";
|
||||
|
||||
bench("cpus()", () => cpus());
|
||||
bench("networkInterfaces()", () => networkInterfaces());
|
||||
|
||||
@@ -17,5 +17,6 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"fast-deep-equal": "^3.1.3"
|
||||
}
|
||||
},
|
||||
"prettier": "../.prettierrc.cjs"
|
||||
}
|
||||
|
||||
BIN
bench/react-hello-world/bun.lockb
Executable file
BIN
bench/react-hello-world/bun.lockb
Executable file
Binary file not shown.
16
bench/react-hello-world/package.json
Normal file
16
bench/react-hello-world/package.json
Normal file
@@ -0,0 +1,16 @@
|
||||
{
|
||||
"name": "react-hello-world",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"main": "react-hello-world.node.js",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "Colin McDonnell",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"react": "next",
|
||||
"react-dom": "next"
|
||||
}
|
||||
}
|
||||
@@ -18,8 +18,8 @@ const headers = {
|
||||
};
|
||||
|
||||
Deno.serve(
|
||||
async (req) => {
|
||||
async req => {
|
||||
return new Response(await renderToReadableStream(<App />), headers);
|
||||
},
|
||||
{ port: 8080 }
|
||||
{ port: 8080 },
|
||||
);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
// to run this:
|
||||
// bun --jsx-production react-hello-world.jsx
|
||||
// NODE_ENV=production bun --jsx-production react-hello-world.jsx
|
||||
|
||||
// This will become the official react-dom/server.bun build a little later
|
||||
// It will be the default when you import from "react-dom/server"
|
||||
// That will work via the "bun" package.json export condition (which bun already supports)
|
||||
import { renderToReadableStream } from "../../test/bun.js/react-dom-server.bun";
|
||||
// Make sure you're using react-dom@18.3.0 or later.
|
||||
// Currently that is available at react-dom@next (which is installed in this repository)
|
||||
import { renderToReadableStream } from "react-dom/server";
|
||||
const headers = {
|
||||
headers: {
|
||||
"Content-Type": "text/html",
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,9 +24,7 @@ http
|
||||
onShellError(error) {
|
||||
// Something errored before we could complete the shell so we emit an alternative shell.
|
||||
res.statusCode = 500;
|
||||
res.send(
|
||||
'<!doctype html><p>Loading...</p><script src="clientrender.js"></script>'
|
||||
);
|
||||
res.send('<!doctype html><p>Loading...</p><script src="clientrender.js"></script>');
|
||||
},
|
||||
onAllReady() {
|
||||
// If you don't want streaming, use this instead of onShellReady.
|
||||
|
||||
Binary file not shown.
@@ -8,8 +8,6 @@ const transpiler = new Bun.Transpiler({
|
||||
console.time("Get exports");
|
||||
const ITERATIONS = parseInt(process.env.ITERATIONS || "1") || 1;
|
||||
for (let i = 0; i < ITERATIONS; i++) {
|
||||
const imports = transpiler.scanImports(
|
||||
readFileSync("remix-route.ts", "utf8")
|
||||
);
|
||||
const imports = transpiler.scanImports(readFileSync("remix-route.ts", "utf8"));
|
||||
}
|
||||
console.timeEnd("Get exports");
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// https://github.com/oven-sh/bun/issues/1096
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
const identity = (x) => x;
|
||||
const identity = x => x;
|
||||
|
||||
for (let i = 0; i < 20; i++) {
|
||||
var array = new Array(i);
|
||||
@@ -22,35 +22,15 @@ bench("inline Array.map x 6", () => [1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 7", () => [1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 8", () => [1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 9", () => [1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 10", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 11", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 12", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 13", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 14", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 15", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 16", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 17", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 18", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 19", () =>
|
||||
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity)
|
||||
);
|
||||
bench("inline Array.map x 10", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 11", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 12", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 13", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 14", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 15", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 16", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 17", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 18", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
bench("inline Array.map x 19", () => [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1].map(identity));
|
||||
|
||||
await run();
|
||||
|
||||
@@ -6,10 +6,7 @@ bench("deepEqual", () => {
|
||||
});
|
||||
|
||||
bench("deepStrictEqual", () => {
|
||||
assert.deepStrictEqual(
|
||||
{ foo: "123", beep: "boop" },
|
||||
{ foo: "123", beep: "boop" },
|
||||
);
|
||||
assert.deepStrictEqual({ foo: "123", beep: "boop" }, { foo: "123", beep: "boop" });
|
||||
});
|
||||
|
||||
await run();
|
||||
|
||||
@@ -19,13 +19,10 @@ bench("promise.nextTick", async function () {
|
||||
});
|
||||
|
||||
bench("await new Promise(resolve => resolve())", async function () {
|
||||
await new Promise((resolve) => resolve());
|
||||
await new Promise(resolve => resolve());
|
||||
});
|
||||
bench("Promise.all(Array.from({length: 100}, () => new Promise((resolve) => resolve())))", async function () {
|
||||
return Promise.all(Array.from({ length: 100 }, () => Promise.resolve(1)));
|
||||
});
|
||||
bench(
|
||||
"Promise.all(Array.from({length: 100}, () => new Promise((resolve) => resolve())))",
|
||||
async function () {
|
||||
return Promise.all(Array.from({ length: 100 }, () => Promise.resolve(1)));
|
||||
},
|
||||
);
|
||||
|
||||
await run();
|
||||
|
||||
@@ -1,9 +1,49 @@
|
||||
import { bench, run } from "mitata";
|
||||
|
||||
const N = parseInt(process.argv.slice(2).at(0) || "10", 10);
|
||||
var isBuffer = new Buffer(0);
|
||||
var isNOtBuffer = "not a buffer";
|
||||
|
||||
bench("new Buffer(0)", () => {
|
||||
return new Buffer(0);
|
||||
bench("Buffer.isBuffer(buffer)", () => {
|
||||
return Buffer.isBuffer(isBuffer);
|
||||
});
|
||||
|
||||
{
|
||||
var j = 0;
|
||||
j += 1;
|
||||
j += eval("'ok'");
|
||||
|
||||
bench("Buffer.isBuffer(string)", () => {
|
||||
return Buffer.isBuffer(j);
|
||||
});
|
||||
}
|
||||
|
||||
bench("Buffer.from('short string')", () => {
|
||||
return Buffer.from("short string");
|
||||
});
|
||||
|
||||
const loooong = "long string".repeat(9999).split("").join(" ");
|
||||
bench("Buffer.byteLength('long string'.repeat(9999))", () => {
|
||||
return Buffer.byteLength(loooong);
|
||||
});
|
||||
|
||||
var hundred = new ArrayBuffer(100);
|
||||
bench("Buffer.from(ArrayBuffer(100))", () => {
|
||||
return Buffer.from(hundred);
|
||||
});
|
||||
|
||||
var hundredArray = new Uint8Array(100);
|
||||
bench("Buffer.from(Uint8Array(100))", () => {
|
||||
return Buffer.from(hundredArray);
|
||||
});
|
||||
|
||||
var empty = new Uint8Array(0);
|
||||
bench("Buffer.from(Uint8Array(0))", () => {
|
||||
return Buffer.from(empty);
|
||||
});
|
||||
|
||||
bench("new Buffer(Uint8Array(0))", () => {
|
||||
return new Buffer(empty);
|
||||
});
|
||||
|
||||
bench(`new Buffer(${N})`, () => {
|
||||
@@ -26,4 +66,4 @@ bench("Buffer.alloc(24_000)", () => {
|
||||
return Buffer.alloc(24_000);
|
||||
});
|
||||
|
||||
await run();
|
||||
await run({});
|
||||
|
||||
@@ -23,9 +23,7 @@ time("Uint8Array[]", () => array[0]);
|
||||
console.log("");
|
||||
|
||||
time("Buffer.getBigInt64BE ", () => buf.readBigInt64BE(0));
|
||||
time("DataView.getBigInt64 (BE)", () =>
|
||||
view.getBigInt64(0, false).toString(10)
|
||||
);
|
||||
time("DataView.getBigInt64 (BE)", () => view.getBigInt64(0, false).toString(10));
|
||||
console.log("");
|
||||
|
||||
time("Buffer.readBigInt64LE ", () => buf.readBigInt64LE(0));
|
||||
|
||||
@@ -10,18 +10,13 @@ var time = (name, fn) => {
|
||||
console.timeEnd(name.padEnd('Buffer.write(string, "latin1")'.length));
|
||||
};
|
||||
|
||||
console.log(
|
||||
`Run ${new Intl.NumberFormat().format(INTERVAL)} times with a warmup:`,
|
||||
"\n"
|
||||
);
|
||||
console.log(`Run ${new Intl.NumberFormat().format(INTERVAL)} times with a warmup:`, "\n");
|
||||
|
||||
const stringToWrite = "hellooooohellooooo";
|
||||
|
||||
time('Buffer.write(string, "utf8")', () => buf.write(stringToWrite, "utf8"));
|
||||
time('Buffer.write(string, "ascii")', () => buf.write(stringToWrite, "ascii"));
|
||||
time('Buffer.write(string, "latin1")', () =>
|
||||
buf.write(stringToWrite, "latin1")
|
||||
);
|
||||
time('Buffer.write(string, "latin1")', () => buf.write(stringToWrite, "latin1"));
|
||||
time("Buffer.readBigInt64BE ", () => buf.readBigInt64BE(0));
|
||||
// time("DataView.getBigInt64 (BE)", () => view.getBigInt64(0, false));
|
||||
// console.log("");
|
||||
|
||||
BIN
bench/snippets/bun.lockb
Executable file
BIN
bench/snippets/bun.lockb
Executable file
Binary file not shown.
@@ -35,40 +35,26 @@ async function test(log) {
|
||||
{
|
||||
const a = performance.now();
|
||||
await tests.async(0);
|
||||
if (log)
|
||||
console.log(
|
||||
`async/await: ${(report.async = (performance.now() - a).toFixed(4))}ms`
|
||||
);
|
||||
if (log) console.log(`async/await: ${(report.async = (performance.now() - a).toFixed(4))}ms`);
|
||||
}
|
||||
|
||||
{
|
||||
const a = performance.now();
|
||||
tests.callback(0, function () {
|
||||
if (log)
|
||||
console.log(
|
||||
`callback: ${(report.callback = (performance.now() - a).toFixed(
|
||||
4
|
||||
))}ms`
|
||||
);
|
||||
if (log) console.log(`callback: ${(report.callback = (performance.now() - a).toFixed(4))}ms`);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
const a = performance.now();
|
||||
await tests.then(0);
|
||||
if (log)
|
||||
console.log(
|
||||
`then: ${(report.then = (performance.now() - a).toFixed(4))}ms`
|
||||
);
|
||||
if (log) console.log(`then: ${(report.then = (performance.now() - a).toFixed(4))}ms`);
|
||||
}
|
||||
|
||||
{
|
||||
const a = performance.now();
|
||||
tests.sync(0);
|
||||
if (log)
|
||||
console.log(
|
||||
`sync: ${(report.sync = (performance.now() - a).toFixed(4))}ms`
|
||||
);
|
||||
if (log) console.log(`sync: ${(report.sync = (performance.now() - a).toFixed(4))}ms`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,33 +34,25 @@ function polyfillUninitialized(chunks) {
|
||||
|
||||
const chunkGroups = [
|
||||
[Uint8Array.from([123]), Uint8Array.from([456]), Uint8Array.from([789])],
|
||||
Array.from(readFileSync(import.meta.path)).map((a) => Uint8Array.from([a])),
|
||||
Array.from(readFileSync(import.meta.path)).map(a => Uint8Array.from([a])),
|
||||
[readFileSync(import.meta.path)],
|
||||
Array.from({ length: 42 }, () => readFileSync(import.meta.path)),
|
||||
Array.from({ length: 2 }, () =>
|
||||
new TextEncoder().encode(readFileSync(import.meta.path, "utf8").repeat(100))
|
||||
),
|
||||
Array.from({ length: 2 }, () => new TextEncoder().encode(readFileSync(import.meta.path, "utf8").repeat(100))),
|
||||
];
|
||||
|
||||
for (const chunks of chunkGroups) {
|
||||
group(
|
||||
`${chunks.reduce(
|
||||
(prev, curr, i, a) => prev + curr.byteLength,
|
||||
0
|
||||
)} bytes for ${chunks.length} chunks`,
|
||||
() => {
|
||||
bench("Bun.concatArrayBuffers", () => {
|
||||
Bun.concatArrayBuffers(chunks);
|
||||
});
|
||||
bench("Uint8Array.set", () => {
|
||||
polyfill(chunks);
|
||||
});
|
||||
group(`${chunks.reduce((prev, curr, i, a) => prev + curr.byteLength, 0)} bytes for ${chunks.length} chunks`, () => {
|
||||
bench("Bun.concatArrayBuffers", () => {
|
||||
Bun.concatArrayBuffers(chunks);
|
||||
});
|
||||
bench("Uint8Array.set", () => {
|
||||
polyfill(chunks);
|
||||
});
|
||||
|
||||
bench("Uint8Array.set (uninitialized memory)", () => {
|
||||
polyfillUninitialized(chunks);
|
||||
});
|
||||
}
|
||||
);
|
||||
bench("Uint8Array.set (uninitialized memory)", () => {
|
||||
polyfillUninitialized(chunks);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
await run();
|
||||
|
||||
@@ -9,8 +9,7 @@ const json = {
|
||||
url: "https://api.github.com/users/wongmjane",
|
||||
html_url: "https://github.com/wongmjane",
|
||||
followers_url: "https://api.github.com/users/wongmjane/followers",
|
||||
following_url:
|
||||
"https://api.github.com/users/wongmjane/following{/other_user}",
|
||||
following_url: "https://api.github.com/users/wongmjane/following{/other_user}",
|
||||
gists_url: "https://api.github.com/users/wongmjane/gists{/gist_id}",
|
||||
starred_url: "https://api.github.com/users/wongmjane/starred{/owner}{/repo}",
|
||||
subscriptions_url: "https://api.github.com/users/wongmjane/subscriptions",
|
||||
@@ -37,11 +36,7 @@ const json = {
|
||||
};
|
||||
|
||||
const inspect =
|
||||
"Bun" in globalThis
|
||||
? Bun.inspect
|
||||
: "Deno" in globalThis
|
||||
? Deno.inspect
|
||||
: (await import("util")).inspect;
|
||||
"Bun" in globalThis ? Bun.inspect : "Deno" in globalThis ? Deno.inspect : (await import("util")).inspect;
|
||||
bench("big json object", () => {
|
||||
console.error(json);
|
||||
});
|
||||
|
||||
@@ -21,8 +21,14 @@ bench('crypto.createHash("sha512")', () => {
|
||||
hasher.digest();
|
||||
});
|
||||
|
||||
bench('crypto.createHash("sha512")', () => {
|
||||
var hasher = crypto.createHash("sha512");
|
||||
bench('crypto.createHash("sha256")', () => {
|
||||
var hasher = crypto.createHash("sha256");
|
||||
hasher.update(foo);
|
||||
hasher.digest();
|
||||
});
|
||||
|
||||
bench('crypto.createHash("sha1")', () => {
|
||||
var hasher = crypto.createHash("sha1");
|
||||
hasher.update(foo);
|
||||
hasher.digest();
|
||||
});
|
||||
|
||||
@@ -259,15 +259,13 @@ const fixture = [
|
||||
equal: false,
|
||||
},
|
||||
{
|
||||
description:
|
||||
"objects with different `toString` functions returning same values are equal",
|
||||
description: "objects with different `toString` functions returning same values are equal",
|
||||
value1: { toString: () => "Hello world!" },
|
||||
value2: { toString: () => "Hello world!" },
|
||||
equal: true,
|
||||
},
|
||||
{
|
||||
description:
|
||||
"objects with `toString` functions returning different values are not equal",
|
||||
description: "objects with `toString` functions returning different values are not equal",
|
||||
value1: { toString: () => "Hello world!" },
|
||||
value2: { toString: () => "Hi!" },
|
||||
equal: false,
|
||||
@@ -311,13 +309,13 @@ const fixture = [
|
||||
{
|
||||
description: "equal arrays of objects",
|
||||
value1: [
|
||||
...Array.from({ length: 200000 }, (i) => ({
|
||||
...Array.from({ length: 200000 }, i => ({
|
||||
a: 1,
|
||||
b: 2,
|
||||
})),
|
||||
],
|
||||
value2: [
|
||||
...Array.from({ length: 200000 }, (i) => ({
|
||||
...Array.from({ length: 200000 }, i => ({
|
||||
a: 1,
|
||||
b: 2,
|
||||
})),
|
||||
@@ -495,9 +493,7 @@ for (let { tests, description } of fixture) {
|
||||
bench(equalsFn.name, () => {
|
||||
expected = equalsFn(value1, value2);
|
||||
if (expected !== equal) {
|
||||
throw new Error(
|
||||
`Expected ${expected} to be ${equal} for ${description}`,
|
||||
);
|
||||
throw new Error(`Expected ${expected} to be ${equal} for ${description}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -19,14 +19,7 @@ const properties = {
|
||||
writable: {
|
||||
get() {
|
||||
const w = this._writableState;
|
||||
return (
|
||||
!!w &&
|
||||
w.writable !== false &&
|
||||
!w.destroyed &&
|
||||
!w.errored &&
|
||||
!w.ending &&
|
||||
!w.ended
|
||||
);
|
||||
return !!w && w.writable !== false && !w.destroyed && !w.errored && !w.ending && !w.ended;
|
||||
},
|
||||
set(val) {
|
||||
if (this._writableState) {
|
||||
|
||||
@@ -7,7 +7,7 @@ bench("(cached) dns.lookup remote x 50", async () => {
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
await new Promise(resolve => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
@@ -25,7 +25,7 @@ bench("(cached in batch) dns.lookup remote x 50", async () => {
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
await new Promise(resolve => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
@@ -40,10 +40,9 @@ bench("(cached in batch) dns.lookup remote x 50", async () => {
|
||||
bench("dns.lookup remote x 50", async () => {
|
||||
var remain = 50;
|
||||
var done;
|
||||
const run = () =>
|
||||
lookup(Math.random().toString() + ".example.com").catch(() => {});
|
||||
const run = () => lookup(Math.random().toString() + ".example.com").catch(() => {});
|
||||
|
||||
await new Promise((resolve) => {
|
||||
await new Promise(resolve => {
|
||||
for (var i = 0; i < 50; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
@@ -58,10 +57,9 @@ bench("dns.lookup remote x 50", async () => {
|
||||
bench("dns.resolve remote x 50", async () => {
|
||||
var remain = 50;
|
||||
var done;
|
||||
const run = () =>
|
||||
resolve(Math.random().toString() + ".example.com").catch(() => {});
|
||||
const run = () => resolve(Math.random().toString() + ".example.com").catch(() => {});
|
||||
|
||||
await new Promise((resolve) => {
|
||||
await new Promise(resolve => {
|
||||
for (var i = 0; i < 50; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
|
||||
@@ -3,23 +3,16 @@ import { bench, run, group } from "mitata";
|
||||
|
||||
async function forEachBackend(name, fn) {
|
||||
group(name, () => {
|
||||
for (let backend of [
|
||||
"libc",
|
||||
"c-ares",
|
||||
process.platform === "darwin" ? "system" : "",
|
||||
].filter(Boolean))
|
||||
for (let backend of ["libc", "c-ares", process.platform === "darwin" ? "system" : ""].filter(Boolean))
|
||||
bench(backend, fn(backend));
|
||||
});
|
||||
}
|
||||
|
||||
forEachBackend("dns.lookup remote x 50", (backend) => async () => {
|
||||
const run = () =>
|
||||
dns
|
||||
.lookup(Math.random().toString(16) + ".example.com", { backend })
|
||||
.catch(() => {});
|
||||
forEachBackend("dns.lookup remote x 50", backend => async () => {
|
||||
const run = () => dns.lookup(Math.random().toString(16) + ".example.com", { backend }).catch(() => {});
|
||||
var remain = 16;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
await new Promise(resolve => {
|
||||
for (var i = 0; i < 16; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
@@ -31,7 +24,7 @@ forEachBackend("dns.lookup remote x 50", (backend) => async () => {
|
||||
});
|
||||
});
|
||||
|
||||
forEachBackend("(cached) dns.lookup remote x 50", (backend) => {
|
||||
forEachBackend("(cached) dns.lookup remote x 50", backend => {
|
||||
var tld = "example.com";
|
||||
const run = () => dns.lookup(tld, { backend }).catch(() => {});
|
||||
|
||||
@@ -39,7 +32,7 @@ forEachBackend("(cached) dns.lookup remote x 50", (backend) => {
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
await new Promise(resolve => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
@@ -52,25 +45,22 @@ forEachBackend("(cached) dns.lookup remote x 50", (backend) => {
|
||||
};
|
||||
});
|
||||
|
||||
forEachBackend(
|
||||
"(cached in batch) dns.lookup remote x 50",
|
||||
(backend) => async () => {
|
||||
var tld = Math.random().toString(16) + ".example.com";
|
||||
const run = () => dns.lookup(tld, { backend }).catch(() => {});
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise((resolve) => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
},
|
||||
);
|
||||
forEachBackend("(cached in batch) dns.lookup remote x 50", backend => async () => {
|
||||
var tld = Math.random().toString(16) + ".example.com";
|
||||
const run = () => dns.lookup(tld, { backend }).catch(() => {});
|
||||
const total = 50;
|
||||
var remain = total;
|
||||
var done;
|
||||
await new Promise(resolve => {
|
||||
for (var i = 0; i < total; i++)
|
||||
run().finally(() => {
|
||||
remain--;
|
||||
if (remain === 0) {
|
||||
done();
|
||||
}
|
||||
});
|
||||
done = resolve;
|
||||
});
|
||||
});
|
||||
|
||||
await run();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user