Compare commits

...

1092 Commits

Author SHA1 Message Date
Jarred Sumner
6a923026ca Use polling-based VM traps on Linux to avoid conflicting with Linux signals 2025-01-02 23:06:19 -08:00
Jarred Sumner
79430091a1 Add v8.writeHeapSnapshot (#16123) 2025-01-02 21:24:16 -08:00
Jarred Sumner
ab8fe1a6c3 Bump 2025-01-02 21:17:47 -08:00
Michael H
dda49d17f9 docs: fix #16116 (#16122) 2025-01-02 20:29:05 -08:00
Jarred Sumner
faec20080d Update nodejs-apis.md 2025-01-02 20:27:30 -08:00
Jarred Sumner
f834304c27 Support generating V8 Heap Snapshots (#16109) 2025-01-02 20:15:13 -08:00
Jarred Sumner
b59e7c7682 Add missing exception checks to JSPropertyIterator (#16121)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2025-01-02 18:55:38 -08:00
Yiheng
40724d29ac Update cache.md (#16028) 2025-01-02 18:24:03 -08:00
Dylan Conway
d9125143b7 lockfile: escape names in bun.lock (#16120) 2025-01-02 18:22:39 -08:00
Jarred Sumner
4dcfd686b4 Fix build 2025-01-02 16:22:58 -08:00
Jarred Sumner
012d70f42e Fix bug with PATH in Bun.spawn (#16067) 2025-01-02 16:03:42 -08:00
Dylan Conway
a85bd42989 Add short flag for --filter (#16058) 2025-01-02 15:53:45 -08:00
Chawye Hsu
d714943d87 fix(install): read bunfig install.cache.dir (#10699)
Signed-off-by: Chawye Hsu <su+git@chawyehsu.com>
2025-01-02 15:46:27 -08:00
Ciro Spaciari
ae18cc0ef3 fix(server) HEAD Requests followup (#16115) 2025-01-02 15:08:03 -08:00
Jarred Sumner
a8b3f732c5 Report memory size of performance.measure / performance.mark (#16094) 2025-01-01 19:23:13 -08:00
KOMIYA Atsushi
ee955591e2 Update defines to define in cc function documentation (#16097) 2025-01-01 19:07:18 -08:00
Ciro Spaciari
7a52ec55a5 fix(server) HEAD requests (#16099) 2025-01-01 19:06:08 -08:00
Johan Bergström
aa1b0c9c40 fix: avoid world-writable permissions for lockfiles (#16018) 2025-01-01 10:56:10 -08:00
Jarred Sumner
be959e111a Do not assert valid windows path in chdirOSPath because the SetCurrentDirectoryW function will validate the path 2024-12-31 21:08:07 -08:00
Jarred Sumner
19191659cf Avoid resolving substrings in bun:sqlite and Buffer.byteLength (#16092) 2024-12-31 19:48:33 -08:00
Jarred Sumner
30008ed0fc Bump WebKit again (#16091) 2024-12-31 18:17:56 -08:00
Jarred Sumner
e3a1d026f9 Fix crash in bake on load (#16021) 2024-12-31 17:16:12 -08:00
Jarred Sumner
02196cbf0e Avoid resolving substrings unnecessarily (#16090) 2024-12-31 17:06:49 -08:00
Jarred Sumner
1ae855223c Bump WebKit (#16068) 2024-12-31 14:48:54 -08:00
Dylan Conway
5058bd3913 handle bundle(d)Dependencies in bun install (#16055) 2024-12-31 13:40:55 -08:00
Don Isaac
b406509afd refactor: remove unused script execution context file (#16059) 2024-12-31 13:31:33 -08:00
Dylan Conway
82f9b13e08 docs: fix bun.lock section (#16088) 2024-12-31 11:40:28 -08:00
Dylan Conway
37e7f5ba8f transpiler: fix crash with malformed enums (#16084) 2024-12-31 09:09:09 -08:00
Navishkar Rao
babd8b6028 Update nextjs.md docs with starter example (#16072) 2024-12-30 22:26:19 -08:00
Don Isaac
ab52058439 fix(us): memory leak when getting root certificate (#16073) 2024-12-30 22:20:15 -08:00
Lars Volkheimer
e96dded366 fix formatting of Set in Bun.inspect() (#16013) 2024-12-30 13:44:40 -08:00
Jarred Sumner
76bfceae81 Support jsonb, idle_timeout, connection_timeout, max_lifetime timeouts in bun:sql. Add onopen and onclose callbacks. Fix missing "code" property appearing in errors. Add error codes for postgres. (#16045) 2024-12-30 13:25:01 -08:00
Dylan Conway
f0073bfa81 fix(install): free correct pointer in bun patch --commit (#16064) 2024-12-30 12:38:39 -08:00
Devanand Sharma
18ac7f9509 Add remove() and isRemoved in HTMLRewriterTypes.Doctype interface (#16031) 2024-12-28 22:57:25 -08:00
Ciro Spaciari
fe4176e403 feat(s3) s3 client (#15740)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-12-28 17:46:22 -08:00
Jarred Sumner
ed0980cf94 Make creating errors slightly faster (#16023) 2024-12-28 01:32:32 -08:00
Jarred Sumner
dd243a06a5 Log slow lifecycle scripts (#16027) 2024-12-28 01:31:30 -08:00
Jarred Sumner
7b06872abb Deflake fetch tests (#16000) 2024-12-27 14:07:41 -08:00
Don Isaac
d8e644fc25 fix(node/path): crash when joining long paths (#16019) 2024-12-27 17:58:21 +00:00
Meghan Denny
4bcc5b25d9 node: fix all of test-event-emitter (#16009) 2024-12-27 01:34:49 -08:00
Jarred Sumner
19675f474a Update .cursorignore 2024-12-26 11:48:30 -08:00
Jarred Sumner
bba998a611 Create .cursorignore 2024-12-26 11:48:11 -08:00
Jarred Sumner
145a7fd92e Better unicode identifier start / continue check (#15455) 2024-12-25 23:02:46 -08:00
Jarred Sumner
d4c0432a5f Refactor JS parser visitor step into individual functions to reduce stack space usage (#15993) 2024-12-25 23:02:05 -08:00
Jarred Sumner
379c79ee2e Fix typo 2024-12-25 22:35:52 -08:00
Jarred Sumner
2b2ca3275c Improve stack overflow, show more properties in Error objects (#15985)
Co-authored-by: Dave Caruso <me@paperdave.net>
2024-12-25 21:47:13 -08:00
Jarred Sumner
7317c7b4a2 Compress completions list to make zig build a little faster (#15992) 2024-12-25 18:04:46 -08:00
Jarred Sumner
608101c975 Add zlib microbenchmark
need to improve this
2024-12-24 04:20:24 -08:00
Jarred Sumner
52a568d2b2 Fix flaky zlib dictionary test (#15976) 2024-12-24 02:27:07 -08:00
Jarred Sumner
60cb505a98 Use JSObject instead of JSFunction in Bun.plugin (#15968) 2024-12-23 12:33:11 -08:00
Jarred Sumner
da54e81955 Support bundling HTML files and their js, css, and assets in Bun.build and bun build (#15940) 2024-12-23 11:04:38 -08:00
Jarred Sumner
774e30d383 Make originalLine and originalColumn getter calls not observable (#15951) 2024-12-23 03:40:51 -08:00
Jarred Sumner
c6b22d399f Fix showing source code that looks like export default "file-path" (#15957) 2024-12-23 03:40:00 -08:00
Jarred Sumner
1fa6d9e695 +2 passing node:events tests (#15952) 2024-12-23 01:45:13 -08:00
Jarred Sumner
4f8a6b33c4 +5 passing node:zlib tests (#15944) 2024-12-22 20:39:42 -08:00
Martin Amps
a6ad3b9be4 add --elide-lines override flag for workspace filtering (#15837) 2024-12-22 00:14:46 -08:00
github-actions[bot]
b63a6c83b4 deps: update libdeflate to v1.23 (#15934)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-12-21 21:28:17 -08:00
Don Isaac
14b44aeb49 fix(process): process.kill allows zero or negative pids (#15920) 2024-12-21 08:45:39 +00:00
Jarred Sumner
d6b9c444c1 Rename src/bundler.zig to src/transpiler.zig (#15921)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-21 00:59:37 -08:00
Don Isaac
3c37b7f806 fix(lexer): do not treat '#bun' in a url as a pragma (#15912)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-21 04:57:42 +00:00
Don Isaac
acb9fdfcf5 refactor: organize native glob code (#15914)
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-20 20:59:07 -08:00
Jarred Sumner
50eec0025b Add regression test for #15902 2024-12-20 19:28:13 -08:00
Jarred Sumner
ac3cd09a42 Bump 2024-12-20 17:54:39 -08:00
Dylan Conway
6e222c8523 fix #15902 (#15911) 2024-12-20 17:03:37 -08:00
Jarred Sumner
b8f28ed8af Bump 2024-12-20 03:44:55 -08:00
dave caruso
7b3554f90c feat(bundler): add --windows-icon, --windows-no-console, fix bun.exe's main icon (#15894)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-20 03:22:16 -08:00
Jarred Sumner
0c50b0fcec Fix potential runtime crash if transpiler generates invalid commonjs (#15898) 2024-12-20 02:12:08 -08:00
Jarred Sumner
bf9c6fdc00 Revert "fix(lexer): do not treat '#bun' in a url as a pragma" (#15899) 2024-12-20 01:31:48 -08:00
Don Isaac
1d9fbe7d67 fix(lexer): do not treat '#bun' in a url as a pragma (#15888)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-20 01:26:30 -08:00
Brian Kim
a8893dcae5 Fix macro imports (#15833) 2024-12-20 08:34:45 +00:00
dave caruso
8a4852b8b0 fix: pass homedir test (#15811)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-12-20 00:36:59 -08:00
Dylan Conway
45ca9e08c3 fix(install): peer/dev/optional = false lockfile fix (#15874)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-20 00:34:21 -08:00
Jarred Sumner
e3fed49082 Implement expect().toHaveBeenCalledOnce() (#15871)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-20 00:23:55 -08:00
Dylan Conway
9164760a5a fix pnpm.test.ts (#15897) 2024-12-19 23:52:50 -08:00
Dylan Conway
747828965e fix(install): sort tree dependencies by behavior and name (#15895) 2024-12-19 23:14:33 -08:00
Jarred Sumner
35679b3178 Update node_util_binding.zig 2024-12-19 17:34:38 -08:00
Don Isaac
960b2b2c11 perf(node:util): fast path for extractedSplitNewLines (#15838)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-19 23:42:18 +00:00
Don Isaac
f546a9b605 chore: add usage messages to check-node.sh (#15885)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-19 22:32:25 +00:00
Ashcon Partovi
3cbcd43f9a ci: Enable merge queue, disable soft failing tests 2024-12-19 11:18:13 -08:00
Jarred Sumner
b254e69322 Fix svelte testing guide 2024-12-19 03:44:46 -08:00
Jarred Sumner
5dcfc6f10f Update svelte-test.md 2024-12-19 03:17:02 -08:00
Jarred Sumner
d9b2396948 Update svelte-test.md 2024-12-19 03:16:06 -08:00
Jarred Sumner
e21050dc6f Update svelte-test.md 2024-12-19 03:09:21 -08:00
Jarred Sumner
276da2dbf5 Create svelte-test.md 2024-12-19 03:09:10 -08:00
Jarred Sumner
b539ca32ea Make "use strict" become CommonJS if we don't know whether it's ESM or CJS (#15868) 2024-12-18 23:23:50 -08:00
Jarred Sumner
ebc2eb5c5b Support colors array in util.styleText (#15872) 2024-12-18 23:23:42 -08:00
Jarred Sumner
10990f5213 Fixes #3554 (#15870) 2024-12-18 22:54:11 -08:00
Jarred Sumner
42f23f0966 PR feedback from #15865 2024-12-18 19:42:33 -08:00
Jarred Sumner
ac6723eab7 +13 passing node:vm tests (#15865) 2024-12-18 19:41:37 -08:00
Michael H
8e20d02b9b update registry scope guide (.npmrc is supported) (#15866) 2024-12-18 19:28:23 -08:00
dave caruso
41924211f2 add throw: true in Bun.build, to be made default in 1.2 (#15861) 2024-12-18 19:27:59 -08:00
Michael H
5d2b72aa3b don't make inline sourcemap in normal vscode terminal (#15862) 2024-12-18 18:30:39 -08:00
Don Isaac
e66a347158 fix(module-loader): use a more descriptive crash message (#15831)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-18 14:10:46 -08:00
Jarred Sumner
b5b51004e8 Bump WebKit (#15828)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-12-17 20:59:10 -08:00
Dylan Conway
2272b852ba fix(install): npm version to git resolution package-lock.json migration (#15810) 2024-12-17 19:59:23 -08:00
Michael H
df5f95b19e vscode: allow trailing comma in bun.lock (#15747) 2024-12-17 18:05:30 -08:00
190n
59e06b0df5 fix(napi): set lossless parameter in napi_get_value_bigint_{int64,uint64}, and trim leading zeroes in napi_create_bigint_words (#15804) 2024-12-17 17:38:12 -08:00
Dylan Conway
430c1dd583 add install.saveTextLockfile to bunfig.toml (#15827) 2024-12-17 16:52:04 -08:00
Jarred Sumner
ad1738d23c Fix process.on from non-mainthread (#15825) 2024-12-17 16:51:19 -08:00
Jarred Sumner
b7efaa5b19 Bump 2024-12-17 15:30:18 -08:00
Jarred Sumner
1d48561709 Update plugins.md 2024-12-17 01:49:02 -08:00
Jarred Sumner
f2e0d606b6 Update plugins.md 2024-12-17 01:34:17 -08:00
Jarred Sumner
385868f504 Update plugins.md 2024-12-17 01:34:00 -08:00
Jarred Sumner
eecbeb32ec Move bundler plugin docs 2024-12-17 01:31:14 -08:00
Jarred Sumner
903d8bfa4a Be more careful about setting the rlimit max 2024-12-17 01:15:24 -08:00
Don Isaac
9524e1c86a fix: Bun.deepMatch on circular objects causing segfault (#15672)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-16 22:33:34 -08:00
dave caruso
77acfa23a7 pass all upstream node:os tests, all supported node:async_hooks tests (#15802) 2024-12-16 22:22:54 -08:00
Jarred Sumner
9d3b461a25 CI: Remove unnecessary config 2024-12-16 20:38:05 -08:00
Jarred Sumner
9d63ee0edf CI: test concurrency group 2024-12-16 20:33:56 -08:00
Jarred Sumner
a3090fc204 CI: cancel previous canary build 2024-12-16 20:33:09 -08:00
Jarred Sumner
32c1fdf205 Rename estimateDirectMemoryUsageOf to estimateShallowMemoryUsageOf 2024-12-16 20:18:04 -08:00
Jarred Sumner
aada6f930f Fix heap snapshots memory usage stats. Introduce estimateDirectMemoryUsageOf function in "bun:jsc" (#15790) 2024-12-16 20:16:23 -08:00
Zack Radisic
3906d02e2c CSS fixes (#15806) 2024-12-16 19:40:53 -08:00
pfg
f276484f25 Add lldb scripts for zig & jsc (#15807) 2024-12-16 18:31:41 -08:00
Jarred Sumner
4bef96e8d1 Prevent unnecessary postinstall script from causing bun install to hang in unreliable networks 2024-12-16 18:19:43 -08:00
Michael H
f2d955f686 vscode extension: use new debug terminal provider (#15801)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-16 17:29:12 -08:00
Ashcon Partovi
e8b85cff40 ci: Retry and detect flaky tests (#15798) 2024-12-16 17:04:33 -08:00
Dylan Conway
d5f1f2f8ad Use the same hoisting logic for text lockfile (#15778) 2024-12-16 16:37:46 -08:00
Michael H
67e4aec990 attempt to fix debugger (#15788)
Co-authored-by: RiskyMH <RiskyMH@users.noreply.github.com>
2024-12-16 16:34:55 -08:00
Jarred Sumner
540a0a89ab Fix text input with ink (#15800) 2024-12-16 16:33:15 -08:00
190n
4eae3a90e8 fix(napi): Make napi_wrap work on regular objects (#15622)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-16 15:54:39 -08:00
Jarred Sumner
9604733ee1 ✂️ 2024-12-16 13:51:45 -08:00
Sam
7633f3cc35 docs: dns.prefetch doesn't require port anymore (#15792) 2024-12-16 06:52:49 -08:00
Michael H
1fa0dee5e9 document npm:<package-name> in install docs (#15754) 2024-12-15 07:19:34 -08:00
Jarred Sumner
80b0b88315 Deflake doesnt_crash.test.ts 2024-12-15 06:54:34 -08:00
github-actions[bot]
6a24a06741 deps: update c-ares to v1.34.4 (#15773)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-12-15 04:38:39 -08:00
Jarred Sumner
8a64038fae Deflake require.cache test 2024-12-15 00:55:18 -08:00
Jarred Sumner
65f5156589 Deflake process test 2024-12-15 00:47:59 -08:00
Brian Donovan
00a8392656 docs(bun-native-plugin-rs): fix typos (#15764) 2024-12-14 23:50:03 -08:00
Jarred Sumner
c218bffd94 Add "bin" field to bun.lock (#15763)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-12-14 22:52:17 -08:00
Jarred Sumner
3ce6ffa6be Make git dependencies faster + further optimize bun install (#15771) 2024-12-14 19:42:23 -08:00
Jarred Sumner
5326a998c7 Don't open node_modules 1,618 times (#15762) 2024-12-14 04:48:57 -08:00
Jarred Sumner
0d97c8157f Add debugger to entitlements plist 2024-12-14 01:57:08 -08:00
Jarred Sumner
ebc33327d3 Delete incorrect debug assertion 2024-12-14 01:56:55 -08:00
Dylan Conway
3df39f4bb7 bun.lock: fix --frozen-lockfile and resolving extra dependencies (#15748) 2024-12-13 22:40:12 -08:00
Jarred Sumner
c7020c2edc Make --expose gc work in nodetests 2024-12-13 22:30:26 -08:00
Meghan Denny
ac12438f69 node: fix test-zlib-from-gzip-with-trailing-garbage.js (#15757) 2024-12-13 21:51:02 -08:00
Jarred Sumner
1e19672841 fix clangd 2024-12-13 21:20:43 -08:00
Jarred Sumner
20f9cf0047 Fix flaky signal handlers on posix (#15751) 2024-12-13 20:13:56 -08:00
Don Isaac
bd1c5e9876 feat: add JSObject constructors (#15742)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-12 22:04:19 -08:00
Don Isaac
bbb56acdf7 test(ws): do not create temporary .sock files in root repo directory (#15670)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-12 21:39:30 -08:00
Jarred Sumner
f64ca29c0e Fix symbols test. Bump Webkit. (#15741) 2024-12-12 20:53:02 -08:00
Dylan Conway
8b3b1442fd bun.lock workspace sorting and comma bugfix (#15739) 2024-12-12 19:33:44 -08:00
Jarred Sumner
e72692801a [ci] Reduce number of environment variables we send (#15730) 2024-12-12 17:48:53 -08:00
Dylan Conway
e146734596 bun.lock fixes (#15724) 2024-12-12 16:45:26 -08:00
Jarred Sumner
7ded578547 [publish images] 2024-12-12 03:22:45 -08:00
Dylan Conway
71af1950fb bump webkit (#15328)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Ben Grant <ben@bun.sh>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-12-12 03:21:56 -08:00
Jarred Sumner
7991be86a3 Fix build 2024-12-12 02:18:25 -08:00
Jarred Sumner
6f50f51528 Deflake a test 2024-12-12 02:07:29 -08:00
Jarred Sumner
2bdf33cac8 Remove silly hack 2024-12-12 01:42:03 -08:00
Jarred Sumner
b3628a526d ✂️ 2024-12-12 01:39:34 -08:00
pfg
1b5cb891c8 More passing console tests (#15676)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-12 01:37:10 -08:00
Don Isaac
fe1e3be104 test(node): add parallel/test-path-resolve.js (#15707)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-12 01:36:36 -08:00
dave caruso
79dc13ca79 pass all string decoder tests (#15723)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-12 01:35:08 -08:00
Jarred Sumner
2ccdf0122c Fix edgecase with socketpair() impacting shell and spawn (#15725) 2024-12-12 01:23:40 -08:00
Zack Radisic
fddc28d608 CSS moar fixes (#15719) 2024-12-11 21:45:41 -08:00
Meghan Denny
834b6436c6 fix canary 2024-12-11 20:06:42 -08:00
Zack Radisic
113b62be82 Native plugin follow up (#15632)
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-11 17:51:21 -08:00
pfg
2e0f229722 test(events): 66% -> 94% (#15716) 2024-12-11 17:43:19 -08:00
Don Isaac
08e2cf3761 test: mock 'node:test' module in node test harness (#15696)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-11 17:40:44 -08:00
pfg
0e8f075191 Pass node querystring tests (#15695) 2024-12-11 17:39:46 -08:00
Ashcon Partovi
667821c53a ci: Fix canary releases (#15713) 2024-12-11 09:47:17 -08:00
Dylan Conway
b55ca429c7 Implement text-based lockfile (#15705) 2024-12-11 05:05:49 -08:00
Don Isaac
78445c543e refactor: set default for name in ErrorCode.ts (#15699)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-11 01:07:57 -08:00
Don Isaac
24d73e948a test(node): add passing path parse format test (#15703)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-11 00:34:58 -08:00
Jarred Sumner
5cfa4cc0af ✂️ 2024-12-11 00:34:19 -08:00
Don Isaac
0bc57eebcb test(deno): use expect.toBeGreaterThanorEqual on failing deno perf … (#15700)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-10 22:05:46 -08:00
Meghan Denny
455de2a449 deps: update boringssl (#15677) 2024-12-10 20:33:36 -08:00
Meghan Denny
81bc01d477 fix test-event-emitter-method-names.js on windows (#15692) 2024-12-10 16:33:57 -08:00
snwy
d21444a681 test: 100% punycode (#15691) 2024-12-10 15:38:48 -08:00
Don Isaac
2d5ea4993f fix(codegen): better error messages for internals using module.exports (#15687) 2024-12-10 15:10:21 -08:00
dave caruso
b39632c921 feat: new binding generator (#15638) 2024-12-10 12:43:17 -08:00
Jarred Sumner
38325aa41c Introduce env option in Bun.build() and bun build to let you inject FOO_PUBLIC_*-style env vars (#15678) 2024-12-10 01:09:46 -08:00
Jarred Sumner
969bab3848 [build images] 2024-12-10 00:54:04 -08:00
Jarred Sumner
5bd4972d5b Add passing node tests (#15675) 2024-12-10 00:02:09 -08:00
Meghan Denny
68780faee2 fix windows build 2024-12-09 22:30:44 -08:00
Jarred Sumner
0bbc18fd19 Fix rare crash in bun install (#15651) 2024-12-09 20:59:29 -08:00
Meghan Denny
53318c8b13 ci: run re-enable node tests on all platforms (#15572) 2024-12-09 19:08:30 -08:00
Jarred Sumner
abe69901b2 make the helper quieter 2024-12-09 17:42:40 -08:00
Jarred Sumner
c0cf0414a0 Add helper for running node tests 2024-12-09 17:37:53 -08:00
Natt Nguyen
3dc3527171 fix: testing library docs (#15667) 2024-12-09 16:29:34 -08:00
Don Isaac
af4f1c7d39 test: fix case to allow bun-debug (#15660)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-08 23:48:43 -08:00
github-actions[bot]
2c1dea818c deps: update sqlite to 3.470.200 (#15652)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-12-08 02:16:41 -08:00
Kai Tamkun
cc125b475f Fix missing "readable" events (#15629) 2024-12-06 23:59:47 -08:00
Don Isaac
cbbf88f3a6 refactor: remove unused main_api.zig file (#15635)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-06 21:01:25 -08:00
Don Isaac
8064a55a48 test(bake): fix double free (#15634)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-06 20:06:26 -08:00
Jarred Sumner
0531d6756c Ci is doing too much 2024-12-06 19:28:28 -08:00
Ciro Spaciari
6135b3dec9 fix(CI) deflaky node-http.test.ts (#15625) 2024-12-06 19:16:59 -08:00
Don Isaac
b08dd8795e test(web): fix setTimeout refresh test (#15630)
Co-authored-by: Don Isaac <don@bun.sh>
2024-12-06 19:14:07 -08:00
Ciro Spaciari
c1eba5886f fix(net) signal should destroy the connection and propagate the error properly (#15624) 2024-12-06 16:10:33 -08:00
Ciro Spaciari
fcca2cc398 fix(fetch) fix redirect + Connection: close (#15623) 2024-12-06 15:06:11 -08:00
Yuto Ogino
dd32e6b416 Fix zsh auto-completion for package.json scripts with name containing colons (#15619) 2024-12-06 10:53:43 -08:00
Jarred Sumner
b453360dff Fixes #15480 (#15611) 2024-12-05 21:15:21 -08:00
pfg
1476e4c958 implement toThrowErrorMatchingSnapshot, toThrowErrorMatchingInlineSnapshot (#15607) 2024-12-05 19:07:18 -08:00
Ashcon Partovi
eacf89e5bf ci: Fix CPU count on build runners 2024-12-05 14:20:05 -08:00
Ashcon Partovi
fa6ac405a4 ci: Add bootstrap.ps1 and automate Windows build images (#15606) 2024-12-05 15:16:37 -07:00
pfg
4c8cbecb08 Support flag parameter in readFileSync (#15595)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-05 13:41:44 -08:00
Michael H
00b7d6479b bun repl disable inspector/debugger (#15594) 2024-12-05 13:41:21 -08:00
pfg
bcf023c829 Implement expect().toMatchInlineSnapshot() (#15570) 2024-12-05 13:07:10 -08:00
Jarred Sumner
b7b1ca8ebe Fixes https://github.com/oven-sh/bun/issues/15307 2024-12-05 02:39:34 -08:00
Jarred Sumner
784bc4e012 Introduce high-performance native addon API in Bun.build, starting with build.onBeforeParse hook (#14971)
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
2024-12-04 22:35:43 -08:00
Ciro Spaciari
dd5c40dab7 fix(node:http) fix node:http chunked encoding on server and add chunked encoding support on the client (#15579)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-04 17:58:21 -08:00
190n
3a4a9ae4e9 Add v8::api_internal::FromJustIsNothing (#15583)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-12-04 17:57:40 -08:00
Jarred Sumner
9d1a35b658 Fixes https://github.com/oven-sh/bun/issues/15556 (#15582)
Co-authored-by: Andres Gutierrez <andresgutierrez535@gmail.com>
2024-12-04 17:57:05 -08:00
Meghan Denny
61cc9c3947 Revert "ci: Add bootstrap.ps1 and automate Windows build images" (#15591) 2024-12-04 17:07:35 -08:00
Ashcon Partovi
e904a181d8 ci: Add bootstrap.ps1 and automate Windows build images (#15466)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-12-04 17:33:00 -07:00
Jarred Sumner
55a0bdc68d deflake process.test.js 2024-12-04 13:52:37 -08:00
Meghan Denny
55454f7910 [publish images] 2024-12-04 13:46:17 -08:00
Jarred Sumner
e4aeb761e4 Ensure we always drain the dependency list in runTasks() (#15511) 2024-12-04 12:40:11 -08:00
pfg
f9efe94b85 Fixes ^C on bun vite (#15545) 2024-12-04 12:39:55 -08:00
Robert Shuford
7eb8a3feae Fixes #14433 - global .npmrc not using auth (#15539) 2024-12-04 12:37:18 -08:00
Dylan Conway
d7ed9c673e add a --config test for bun install (#15546) 2024-12-04 12:36:10 -08:00
Ashcon Partovi
b4dce96c40 ci: Publish musl releases to npm 2024-12-04 10:19:15 -08:00
Meghan Denny
52ef8b1778 ci: make annotations always link to file content by commit (#15573) 2024-12-04 01:30:26 -08:00
dave caruso
baff3c900e bake: fix the big regressions (#15544)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-12-03 22:15:59 -08:00
Meghan Denny
23299dadf6 ci: run node tests directly instead of translated files (#15565)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-12-03 22:10:50 -08:00
Jarred Sumner
0d5e4e162b spawnSync shouldn't throw (#15561)
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-12-03 19:26:36 -08:00
Don Isaac
d27594ecf4 fix(deps/boringssl): re-enable BIO_new_mem_buf (#15559)
Co-authored-by: Don Isaac <don@bun.sh>
Co-authored-by: DonIsaac <DonIsaac@users.noreply.github.com>
2024-12-03 16:11:42 -08:00
Ciro Spaciari
a2e2d114e9 fix(net/tls) fix backpressure pause on socket (#15543) 2024-12-03 12:53:48 -08:00
Kai Tamkun
da3d64b1ef Remove a duplicate if statement (#15555) 2024-12-03 12:33:27 -08:00
Jarred Sumner
ce64e04b16 Reduce memory usage of WebSocket server (#15553) 2024-12-03 12:33:04 -08:00
Dylan Conway
55473cb64a fix(node:crypto): use options from createHash(alg, options) (#15547) 2024-12-03 12:32:41 -08:00
Meghan Denny
752441d911 package.json: put :local builds into their own folder (#15540) 2024-12-03 12:22:46 -08:00
Leah Lundqvist
da5d4d791c docs: add .env.test to guides/runtime/set-env for consistency with do… (#15542) 2024-12-02 15:01:08 -08:00
Dylan Conway
6d453be7d9 fix 14540 (#15498) 2024-12-02 14:57:49 -08:00
Meghan Denny
2d441d868b zig: make throw use JSError (#15444) 2024-12-02 14:19:18 -08:00
Michael H
56ad4cc4a6 simplify vscode extension title (#15519) 2024-12-02 06:29:07 -08:00
github-actions[bot]
d2acb2eac0 deps: update libdeflate to v1.22 (#15505)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-30 07:26:45 -08:00
github-actions[bot]
de7eafbdd1 deps: update lshpack to v2.3.3 (#15501)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-29 20:13:47 -08:00
github-actions[bot]
4114986c3e deps: update c-ares to v1.34.3 (#15502)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-29 19:10:10 -08:00
dave caruso
8aa451c2dc bake(dev): plugins in dev server, with other fixes (#15467)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-29 19:07:56 -08:00
Michael H
497cef9759 bun upgrade --help document --stable option (#15472)
Co-authored-by: RiskyMH <RiskyMH@users.noreply.github.com>
2024-11-29 18:02:18 -08:00
imide
dd57b95546 Add musl related documentation to installation.md (#15500) 2024-11-29 18:01:44 -08:00
github-actions[bot]
ea7c4986d7 deps: update lolhtml to 4f8becea13a0021c8b71abd2dcc5899384973b66 (#15462)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-29 04:20:10 -08:00
Jarred Sumner
6c7edf2dbe bump 2024-11-29 04:10:01 -08:00
Jarred Sumner
bf2f153f5c Check for unix:// instead of unix: 2024-11-28 22:07:06 -08:00
Jarred Sumner
f64a4c4ace Fix debugger connection issue on Windows 2024-11-28 22:05:58 -08:00
Jarred Sumner
0216431c98 Clean up debugger waiting logic (#15469) 2024-11-28 01:34:31 -08:00
Jarred Sumner
ae289c4858 use using 2024-11-28 00:40:47 -08:00
Jarred Sumner
5d1609fe5c Fixes #15470 2024-11-28 00:40:17 -08:00
Ciro Spaciari
471fe7b886 fix(net/tls) fix reusePort, allowHalfOpen, FIN before reconnect (#15452)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-27 21:30:30 -08:00
Alistair Smith
08222eda71 fix: Connect with 1 socket to new env var but still work with js debug terminal (#15458) 2024-11-27 20:47:23 -08:00
github-actions[bot]
6f8c5959d0 deps: update sqlite to 3.470.100 (#15465)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-11-27 20:39:38 -08:00
Jarred Sumner
40d5e745c9 Stagger the updates 2024-11-27 19:04:08 -08:00
Jarred Sumner
225bfd54fa Shorter branch names 2024-11-27 18:42:04 -08:00
Jarred Sumner
a6ca8c40d4 Add sqlite3 auto updater script 2024-11-27 18:36:41 -08:00
Jarred Sumner
b52ad226a5 Update actions 2024-11-27 18:08:23 -08:00
Jarred Sumner
5f8f805db9 Update update-libarchive.yml 2024-11-27 17:38:57 -08:00
Jarred Sumner
37c98bebd6 Update update-libarchive.yml 2024-11-27 17:36:32 -08:00
Jarred Sumner
bd01df19c1 github actions 2024-11-27 17:34:28 -08:00
Kai Tamkun
7fd16ebffa Fix incorrect public TS class field name minification (#15411) 2024-11-27 14:06:09 -08:00
Dennis Dudek
1bb211df56 bustDirCache on FileSystemRouter.reload & fix of dir_cache keys in windows (#15091)
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-27 12:21:32 -08:00
cdfzo
bdd0b89f16 docs: fix broken windows contributing guide url (#15451) 2024-11-27 13:01:39 -07:00
Jarred Sumner
841f593b12 Auto-update c-ares, libarchive, libdeflate, lolhtml, lshpack weekly (#15442) 2024-11-26 22:01:36 -08:00
Jarred Sumner
3afd19c73c Clean up .throwError (#15433) 2024-11-26 18:22:37 -08:00
Meghan Denny
b6a231add3 musl: fix test/js/bun/http/serve.test.ts (#15271)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-26 18:18:29 -08:00
Jarred Sumner
ca86bae5d5 Deflake next-build test (#15436) 2024-11-26 18:06:10 -08:00
Meghan Denny
215fdb4697 zig: make throwInvalidArgumentTypeValue use JSError (#15302)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-26 17:17:12 -08:00
snwy
578bdf1cd6 bake: params used when doing static site generation (#15430) 2024-11-26 16:58:14 -08:00
Ciro Spaciari
cf2fa30639 fix(fetch) fix deref + deinit (#15432) 2024-11-26 16:56:55 -08:00
Jarred Sumner
5b3c58bdf5 Update c-ares (#15435) 2024-11-26 16:55:53 -08:00
Michael H
0d6d4faa51 better printing for console.log types (#15404) 2024-11-26 14:27:39 -08:00
Meghan Denny
5e4642295a zig: eliminate errorUnionToCPP (#15416) 2024-11-26 14:11:48 -08:00
Kai Tamkun
68f026b3cd FFI: provide napi_env explicitly (#15431)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-26 13:54:24 -08:00
Meghan Denny
5e9563833d zig: fix missed compile error from merge 2024-11-26 13:35:32 -08:00
Nick Reilingh
6dd44cbeda Docs: cli/test.md - Completed GH Actions example (#15412) 2024-11-26 13:25:16 -08:00
Jarred Sumner
a9ce4d40c2 Add scratch*.{js,ts,tsx,mts,cts,mjs } to gitignore 2024-11-26 13:09:31 -08:00
Meghan Denny
663f00b62b zig: make throwOutOfMemory use JSError (#15413) 2024-11-26 12:58:43 -08:00
Jarred Sumner
f21fffd1bf Fix debugger printing exception 2024-11-25 19:57:08 -08:00
Jarred Sumner
d92d8dc886 Bump 2024-11-25 19:18:46 -08:00
Jarred Sumner
6d127ba3f4 Silence another debugger error 2024-11-25 19:13:56 -08:00
Jarred Sumner
c3d9e8c7af Fix crash in Bun v1.1.36 caused by VSCode extension update 2024-11-25 19:09:34 -08:00
Jarred Sumner
c25e744837 Silence debugger connection error 2024-11-25 19:02:56 -08:00
dave caruso
dc01a5d6a8 feat(DevServer): batch bundles & run them asynchronously (#15181)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-11-25 18:55:47 -08:00
Meghan Denny
c434b2c191 zig: make throwPretty use JSError (#15410) 2024-11-25 18:08:42 -08:00
Jarred Sumner
8ca0eb831d Clean up some error handling code (#15368)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-11-25 15:42:02 -08:00
Ashcon Partovi
b19f13f5c4 bun-vscode: Bump version [no ci] 2024-11-25 15:19:56 -08:00
Meghan Denny
bb3d570ad0 zig: assert there is an exception when .zero is returned (#15362)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-25 15:19:02 -08:00
Jarred Sumner
a6f37b398c Fix bug with --eval & --print (#15379) 2024-11-25 12:58:30 -08:00
Alistair Smith
39af2a0a56 Fix VSCode extension hanging (#15407) 2024-11-25 12:43:46 -08:00
Jarred Sumner
7f6bb30877 Fixes #15403 2024-11-25 04:59:04 -08:00
Jarred Sumner
812288eb72 [internal] Add problem matcher for Zig 2024-11-25 04:43:58 -08:00
Jarred Sumner
9cbe1ec300 Include docs/ folder in bun-types (#15398) 2024-11-25 00:12:28 -08:00
Jarred Sumner
4f8c1c9124 Does this make the tests less flaky (#15399) 2024-11-25 00:11:10 -08:00
Ashcon Partovi
468a392fd5 ci: Larger zig agents 2024-11-25 00:09:57 -07:00
Ashcon Partovi
f61f03fae3 cmake: Fix cross-compiling zig on alpine (#15400)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-11-25 00:07:08 -07:00
Ashcon Partovi
a468d09064 ci: Fix typo 2024-11-24 23:38:59 -07:00
Ashcon Partovi
898feb886f ci: Temporarily run zig build on ephemeral agents 2024-11-24 23:37:18 -07:00
Lua MacDougall
c5cd0e4575 Bun.serve incorrect file for error page template (#15397) 2024-11-24 22:04:54 -08:00
Jarred Sumner
f4a0fe40aa Fixes #8683 (#15389) 2024-11-24 22:03:54 -08:00
imide
2d2e329ee3 Update installation.md (#15392) 2024-11-24 16:53:39 -07:00
Christian Rotzoll
618d2cb3ac docs: clarify concurrency behavior in WAL mode (#15382) 2024-11-24 00:56:40 -08:00
Jarred Sumner
6c915fc1d0 Cherry-pick WebKit/WebKit#37039 (#15380) 2024-11-23 23:39:42 -08:00
Jarred Sumner
aa60ab3b65 Delete incorrect assertion 2024-11-23 04:35:41 -08:00
Alistair Smith
f855ae8618 VSCode in-editor error messages (readme updates) (#15325)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-22 22:36:15 -08:00
Jarred Sumner
514a47cb54 Slightly more complete undici polyfill (#15360) 2024-11-22 22:01:52 -08:00
Kai Tamkun
1a1cf0a4d7 Fix setRawMode return value on Windows (#15357) 2024-11-22 20:28:22 -08:00
advaith
9fbe64619b Remove outdated todo comment from Windows install script (#15358) 2024-11-22 20:25:38 -08:00
Ashcon Partovi
642e0ba73c cmake: Remove unused code that causes issues with commit messages 2024-11-22 17:33:42 -08:00
Ciro Spaciari
19d7a5fe53 fix(CI) make prisma avoid env url because of CI and rely on getSecret (#15352) 2024-11-22 15:23:39 -08:00
Ciro Spaciari
c04a2d1dfc fix regression on http2-wrapper caused by node.js compatibility improvements on net (#15318) 2024-11-22 15:22:35 -08:00
Meghan Denny
82cb82d828 pm: add some missing npm_ env vars (#14786)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-22 15:13:32 -08:00
Ciro Spaciari
4ae982be4e fix(CI) mark inspect test as todo and comment why we mark this as todo (#15354) 2024-11-22 15:02:26 -08:00
Jarred Sumner
2d65063571 Stub performance.markResourceTiming, add PerformanceResourceTiming, PerformanceServerTiming (#15341) 2024-11-22 14:14:05 -08:00
Grigory
746cf2cf01 feat(resolver): add support for self-referencing (#15284)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-22 04:48:02 -08:00
Jarred Sumner
9c1fde0132 Rewrite most of napi_threadsafe_function (#15309)
Co-authored-by: Ben Grant <ben@bun.sh>
2024-11-22 04:44:52 -08:00
Jarred Sumner
f8f76a6fe0 CSS fixes & fuzzing (#15312) 2024-11-22 04:41:10 -08:00
Alistair Smith
4117af6e46 feat(vscode-extension) error reporting, qol (#15261)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-11-22 02:55:21 -08:00
Jarred Sumner
5bcaf32ba3 Fix lockfile print crash (#15332) 2024-11-22 02:07:11 -08:00
Jarred Sumner
d01bfb5aa2 Ensure test with errors before JS execution exit with code 1 (#15321) 2024-11-22 01:33:58 -08:00
pfg
78b495aff5 fix \uFFFF printing regression (#15330)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-21 22:01:27 -08:00
Ciro Spaciari
6adb3954fe fix(ReadableStream) flush as much we can before ending the stream (#15324) 2024-11-21 20:16:43 -08:00
Jarred Sumner
b152fbefcd Remove a test.only 2024-11-21 17:49:54 -08:00
Ciro Spaciari
8c0c97a273 fix(ws) ping without parameters (#15319) 2024-11-21 17:48:50 -08:00
pfg
95fcee8b76 Fix expect toMatchSnapshot not working for some strings (#15183) 2024-11-21 17:46:45 -08:00
Meghan Denny
c3f63bcdc4 zig: make throwInvalidArguments use JSError (#15305) 2024-11-21 16:19:13 -08:00
Jarred Sumner
2283ed098f Remove Amazon Linux 2023 tests for now 2024-11-21 02:52:56 -08:00
Michael H
43dcb8fce1 docs: --bail [n] -> --bail=[n] (#15301) 2024-11-20 21:46:57 -07:00
Ciro Spaciari
0eb6a4c55e fix(Bun.file) throw OOM if read is too big (#15253) 2024-11-20 19:56:00 -08:00
Pham Minh Triet
144db9ca52 Fix typo in 15276.test.ts (#15304) 2024-11-20 19:11:12 -08:00
Jarred Sumner
a6a4ca1e49 fix(install): ensure aliases hash map is initialized (#15280)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-20 18:52:34 -08:00
Meghan Denny
314b4d9b44 fix fuzzy-wuzzy test (#15297) 2024-11-20 17:21:27 -08:00
Meghan Denny
0e3e33072b zig: rename CallFrame.arguments to .arguments_old to free up decl name (#15296) 2024-11-20 16:18:56 -08:00
Ciro Spaciari
3681aa9f0a fix(root_cert) use a more reliable source for the latest cert (#15262) 2024-11-20 15:57:35 -08:00
Meghan Denny
c9d0fd51a9 zig: make throwTODO use JSError (#15264)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-20 15:16:51 -08:00
Meghan Denny
4fe8b71437 ci: bootstrap.sh: musl download of bun no longer has to be special-cased (#15265) 2024-11-20 13:31:06 -08:00
Meghan Denny
1efab7f42d zig: JSValue: make .get and .toSliceOrNull use JSError (#15270) 2024-11-20 13:26:41 -08:00
Meghan Denny
61a3f08595 bindings: make throwInvalidArgumentTypeValue print the value like the real ERR_INVALID_ARG_TYPE (#14804) 2024-11-19 22:35:25 -08:00
Meghan Denny
363595fd31 bunjs: print received value when Bun.write is passed a bad argument (#14805) 2024-11-19 22:34:41 -08:00
Meghan Denny
173f67d81e zig: make throwError use JSError (#15267) 2024-11-19 22:21:02 -08:00
Meghan Denny
05d5ab7489 ci: disable testing on debian 10 2024-11-19 20:32:08 -08:00
Meghan Denny
b7bd5a4cf5 zig: remove noop JSGlobalObject.ptr() (#15268) 2024-11-19 19:45:40 -08:00
Ashcon Partovi
ab4da13785 ci: Disable changed files detection until bugs are fixed 2024-11-19 20:44:06 -07:00
Meghan Denny
ab3cb68f66 zig: make throwNotEnoughArguments use JSError (#15266) 2024-11-19 19:07:14 -08:00
Meghan Denny
795f14c1d1 zig: align getTruthy to use JSError (#15199) 2024-11-19 18:46:08 -08:00
Ashcon Partovi
708ed00705 ci: Expand automated build images to Debian, Ubuntu, and Amazon Linux (#15250) 2024-11-19 19:31:15 -07:00
Jarred Sumner
ff4eccc3b4 bump 2024-11-19 15:53:26 -08:00
Ashcon Partovi
ededc168cf Bun v1.1.36 [release] 2024-11-19 14:28:20 -08:00
Ashcon Partovi
46c750fc12 Bun v1.1.36 [release] 2024-11-19 14:27:46 -08:00
Meghan Denny
fc94db1efb ci: changedFiles can be undefined 2024-11-19 02:23:54 -08:00
Meghan Denny
958e531cc5 ci: always build images when core ci files change (#15229) 2024-11-19 02:19:56 -08:00
Meghan Denny
206d2edf12 docker:alpine: update to 3.20 and use bun musl build (#15241) 2024-11-19 00:57:40 -08:00
Meghan Denny
ecb0098b89 us_bun_verify_error_t: ensure c struct matches zig extern (#15244) 2024-11-19 00:52:38 -08:00
Meghan Denny
ba767aa5ba Revert "fix(tls) fix type matching" (#15243) 2024-11-19 00:08:25 -08:00
Kai Tamkun
46515d4865 Call Bun__onExit + std.os.windows.kernel32.ExitProcess to exit on Windows (#15237)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-11-18 22:58:19 -08:00
Jarred Sumner
3ef35d746a Implement junit test reporter (#15205)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-18 20:50:42 -08:00
Ashcon Partovi
daece6a0ed Revert "cmake: Set explicit rustc target"
This reverts commit cba3bda8ec.
2024-11-18 20:04:55 -08:00
Jarred Sumner
adaee07138 [Bun.sql] Support TLS (#15217)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-18 19:38:23 -08:00
pfg
8a0666acd1 Fix setTimeout with node:util.promisify (#15230) 2024-11-18 19:29:55 -08:00
pfg
fd1d6b10d4 Fix docs on todo tests (#15233) 2024-11-18 19:28:28 -08:00
Ciro Spaciari
d19c18580b fix(tls) fix type matching (#15224) 2024-11-18 19:23:27 -08:00
Ashcon Partovi
f8e9adeb64 ci: Do not check changed files on main 2024-11-18 18:52:02 -08:00
Zack Radisic
3c95d5d011 Fix bundler crash with onLoad plugins on copy-file loaders used on entrypoints (#15231) 2024-11-18 18:50:01 -08:00
Jarred Sumner
9ad3471fb0 Support Headers & URLSearchParams in expect().toEqual() (#15195)
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-11-18 18:49:29 -08:00
Ashcon Partovi
cba3bda8ec cmake: Set explicit rustc target 2024-11-18 18:33:28 -08:00
Ashcon Partovi
5b1808b90b Revert "Ensure that lolhtml builds the target platform"
This reverts commit b023bb805b.
2024-11-18 18:08:54 -08:00
Ashcon Partovi
b023bb805b Ensure that lolhtml builds the target platform 2024-11-18 17:59:01 -08:00
Dennis Dudek
98bb5999a3 Fixed Responses to OPTIONS Requests ignore Body (#15108) 2024-11-18 17:55:50 -08:00
Pham Minh Triet
d5a118e25f Fix(doc): update cluster.md (#15214) 2024-11-18 03:04:36 -08:00
Ciro Spaciari
1911fa1e75 fix(HttpParser) always check if content length is valid before calling requestHandler (#15179) 2024-11-16 19:41:59 -08:00
Meghan Denny
6dbf1bff4f musl: fix test/js/node/process/process.test.js (#15185) 2024-11-16 02:57:20 -08:00
Jarred Sumner
a5a0539f26 Fixes #15177 (#15180) 2024-11-16 02:18:13 -08:00
Meghan Denny
3393b0e1d3 musl: fix third_party/prisma.test.ts (#15186) 2024-11-16 01:44:53 -08:00
Dylan Conway
910efec0b7 fix auto-install on windows when symlinks aren't available (#15182) 2024-11-16 00:43:12 -08:00
Meghan Denny
dafd8156b0 ci: skip running tests on main branch 2024-11-15 22:18:55 -08:00
Meghan Denny
befb269b2d zig: align fromJS methods to using JSError (#15165) 2024-11-15 22:14:18 -08:00
Ashcon Partovi
39d8ade27c ci: musl builds (#15154)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-11-15 21:01:55 -08:00
Meghan Denny
4fedc41545 musl: fix 'bun upgrade' (#15178) 2024-11-15 20:58:23 -08:00
dave caruso
15f2bbb33a docs: remove contributing instructions involving winget (#15176) 2024-11-15 13:06:51 -08:00
Jarred Sumner
4ddb63e7e2 Try linker script (#15158) 2024-11-15 13:02:10 -08:00
Grigory
3791146476 docs(contributing): group os-specific code tabs (#15173) 2024-11-15 12:50:28 -08:00
ippsav
910e479d29 Fix node:net not handling path in listen (#15162)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-15 10:35:14 -08:00
Meghan Denny
266e033d6f node:https: fix prototype chain of Agent (#15160)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-14 19:03:16 -08:00
Ashcon Partovi
9a6f033206 ci: Fix changed files detection on forks 2024-11-14 18:34:13 -08:00
Meghan Denny
2810f39802 zig: make all JS constructors use JSError (#15146)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-11-14 16:36:01 -08:00
Michael H
3170b88058 fix vscode debugger (#14995) 2024-11-14 14:24:18 -08:00
Jarred Sumner
357581c61a Shrink Bun's binary by 3.5 MB (#15121) 2024-11-14 06:02:15 -08:00
pfg
d8987ccdb8 Remove assertion in js printer triggering for unicode comments (#15143) 2024-11-14 00:14:43 -08:00
Meghan Denny
fdd8d35845 allow zig js host functions to return JSError (#15120) 2024-11-13 21:11:56 -08:00
dave caruso
32ddf343ee bake: csr, streaming ssr, serve integration, safer jsvalue functions, &more (#14900)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-13 18:19:12 -08:00
Meghan Denny
bceb0a2327 ci: fix release script (#15129) 2024-11-13 18:29:14 -07:00
Meghan Denny
9b0cdf01f9 cpp: Bun::toStringRef: return dead when exception has been thrown (#15127)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-13 17:03:59 -08:00
Meghan Denny
35513a9d6d zig: remove JSValue.isEmpty (#15128) 2024-11-13 16:04:13 -08:00
Meghan Denny
f8979b05b1 rid nearly all use of ExceptionRef in zig (#15100)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-11-13 15:23:52 -08:00
ippsav
ec91e91fda Pass missing signal code for child_process.spawnSync (#15137) 2024-11-13 15:07:43 -08:00
Meghan Denny
956853f036 test: dont overwrite root package.json when running bun-ipc-inherit.test.ts (#15126) 2024-11-13 00:14:57 -08:00
Dylan Conway
c5df329772 #15059 follow-up (#15118) 2024-11-12 18:17:35 -08:00
Ciro Spaciari
e945146fde fix(bundler) fix pretty path resolution (#15119) 2024-11-12 18:16:13 -08:00
Ciro Spaciari
873b0a7540 fix(socket) Support named pipes on Windows using forward slashes (#15112) 2024-11-12 16:09:43 -08:00
Dennis Dudek
c785ab921b ci: Fix detection of changed files (#15114)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-11-12 15:27:27 -07:00
Meghan Denny
797958082c musl patches [v4] (#15066) 2024-11-11 19:23:58 -08:00
Jarred Sumner
2b9abc20da Use linux syscall interface more in I/O (#15067) 2024-11-11 14:47:04 -08:00
Jarred Sumner
d713001e35 Fixes #14982 2024-11-11 14:40:11 -08:00
Jarred Sumner
b49f6d143e Postgres client - more progress (#15086) 2024-11-11 14:40:02 -08:00
pfg
4cf9851747 Bump runtime transpiler cache version for #15009 (#15094) 2024-11-11 14:38:17 -08:00
pfg
56f7c8887b Fix unicode imports, unicode-escaped variable names, and printClauseAlias not working for utf-8 (#15009) 2024-11-11 13:27:42 -08:00
Ciro Spaciari
62cabe9003 fix(tests) new grpc certs (#15090) 2024-11-11 13:00:58 -08:00
Jarred Sumner
781a392baa Add micro-optimization to fs.readFile (#15076) 2024-11-11 10:35:17 -08:00
Jarred Sumner
d879f4370d Update hashing.md 2024-11-09 02:27:50 -08:00
Jarred Sumner
ae6e23ab28 Update hashing.md 2024-11-09 02:25:18 -08:00
Jarred Sumner
7a9165555d Update hashing.md 2024-11-09 02:19:24 -08:00
Michael H
b54137174b Bench updates (#15029)
Co-authored-by: RiskyMH <RiskyMH@users.noreply.github.com>
2024-11-08 23:15:24 -08:00
Dylan Conway
635789944b update 2024-11-08 21:14:42 -08:00
Jarred Sumner
a1c4f667d9 Support ${configDir} in tsconfig.json (#15063)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-11-08 17:08:54 -08:00
Zack Radisic
07dc1ae547 .defer(), .onStart(), and some small CSS changes (#15041) 2024-11-08 16:38:30 -08:00
Dylan Conway
8f5eab3c84 fix(install): package-lock.json migration and non-existent cafile fixes (#15059) 2024-11-08 14:34:44 -08:00
Jarred Sumner
6ec03b8b05 Add to documentation 2024-11-07 22:54:08 -08:00
Ciro Spaciari
183c661c40 net compatibility improvements (#14933)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-11-07 22:03:53 -08:00
Meghan Denny
c2e7643aa9 musl patches [v3] (#15031) 2024-11-07 21:31:32 -08:00
Jarred Sumner
376b1b4f97 Support preload option in Worker (#15045) 2024-11-07 21:30:51 -08:00
Jarred Sumner
27067d2a6d Allow using Proxy and module namespace objects in APIs (#15043) 2024-11-07 19:45:29 -08:00
Jarred Sumner
1e932ff38b [VSCode extension] Add [eval with bun] code lens on untitled, unsaved scratch JavaScript files (#14983) 2024-11-07 12:30:38 -08:00
Meghan Denny
a116b2281e musl patches [v2] (#15028) 2024-11-06 23:55:23 -08:00
Dylan Conway
66ba6ba061 fix 14957 (#15025) 2024-11-06 19:41:39 -08:00
Jarred Sumner
8d4bb080a3 Implement console.group (#15026) 2024-11-06 19:40:58 -08:00
Ashcon Partovi
bef50a9b9b ci: misc fixes and test runner changes (#15024) 2024-11-06 18:15:55 -07:00
Jarred Sumner
56b57012ed Bump! 2024-11-06 15:05:23 -08:00
Tim Ermilov
c39ae74d3e Fix importing of ES modules from data URIs (#14959) 2024-11-06 15:00:24 -08:00
Christophe Eymard
fc071d3362 remove checks for self closing tags (#14990) 2024-11-06 14:58:31 -08:00
Jarred Sumner
1a9d20e50a Support debugging builtin modules (#15018) 2024-11-06 14:57:35 -08:00
Jarred Sumner
8d8a6bc5c3 Fix prototypical inheritance issue in node:zlib and add a $toClass helper (#15015) 2024-11-06 14:56:10 -08:00
Jarred Sumner
076d1d3d36 Never try using epoll_pwait2 on old linux kernels (#14980) 2024-11-06 03:42:24 -08:00
Jarred Sumner
484c3de861 Show if napi_module_register or dlopen was called in crash reports (#15008) 2024-11-05 20:57:55 -08:00
Meghan Denny
27a1b2413b patches to allow linux-musl to bootstrap (#14994) 2024-11-05 17:22:05 -08:00
Amit Dhamu
3950873272 Fix typo for configuring specific registry (#15001) 2024-11-05 08:11:57 -08:00
pfg
6fb73f2011 Visually center logo in readme (#14969) 2024-11-04 15:28:16 -07:00
pfg
497fa59bf0 Fix #14865 (#14953) 2024-11-02 17:13:31 -07:00
Jarred Sumner
5e5e7c60f1 Fix release build 2024-11-01 20:41:20 -07:00
Ciro Spaciari
85fd471d9d fix(net) fix bytesWritten drain (#14949) 2024-11-01 19:43:42 -07:00
Jarred Sumner
6914c5e32c Fixes #13816 (#13906)
Co-authored-by: pfg <pfg@pfg.pw>
Co-authored-by: Ryan Gonzalez <git@refi64.dev>
Co-authored-by: Ben Grant <ben@bun.sh>
Co-authored-by: Dave Caruso <me@paperdave.net>
2024-11-01 18:38:01 -07:00
Jarred Sumner
ce2afac827 Align "encoding" option in node fs with node (#14937) 2024-11-01 18:16:04 -07:00
Ciro Spaciari
5236d974b5 revert 2024-11-01 17:25:59 -07:00
Ciro Spaciari
6e448619d0 fix drain event, drain must be called only after internal buffer is drained 2024-11-01 17:23:00 -07:00
Jarred Sumner
c89a958299 Fixes #11754 (#14948) 2024-11-01 15:35:28 -07:00
Jarred Sumner
d75488124d Inline process.versions.bun in bun build --compile (#14940) 2024-11-01 14:45:19 -07:00
Ashcon Partovi
4d269995ad Run tests from npm packages, elysia to start (#14932) 2024-11-01 11:57:47 -07:00
190n
71fdb59918 Fix napi property methods on non-objects (#14935) 2024-10-31 21:02:26 -07:00
Dylan Conway
62881ee36b Redact secrets in bunfig.toml and npmrc logs (#14919) 2024-10-31 18:44:24 -07:00
Dylan Conway
6933208790 fix(install): only globally link requested packages (#12506)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-31 18:21:04 -07:00
Jarred Sumner
b1e9e3b31b Add bytesWritten property to Bun.Socket, fix encoding issue in node:net (#14516)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-10-31 17:54:07 -07:00
Jarred Sumner
7035a1107e Fixes #14918 (#14921) 2024-10-31 14:26:19 -07:00
Ashcon Partovi
353d44f1ae ci: If only tests change, use artifacts from last successful build (#14927) 2024-10-31 12:50:09 -07:00
Jarred Sumner
4b8ca51b87 Clean up some code in node validators (#14897) 2024-10-31 12:28:07 -07:00
Ciro Spaciari
f8d5b2e6e2 Fix module resolution cache keys (#14901)
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-10-30 22:06:21 -07:00
190n
9647291d73 Implement NAPI type tagging (#14915) 2024-10-30 19:57:48 -07:00
Jarred Sumner
eaa088ba55 Fix missing symbol errors and add a test (#14907)
Co-authored-by: Jarred Sumner <jarred@bun.sh>
2024-10-30 19:55:42 -07:00
Gerd Jungbluth
955cc6265b fix(docs): add missing character in drizzle guide (#14911) 2024-10-30 08:42:38 -07:00
Dylan Conway
489890deb1 fix(install): check cached package.jsons (#14899) 2024-10-29 18:55:52 -07:00
pfg
d7710c6c67 Fix additional arguments when running a package.json script (#14895)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-29 18:55:32 -07:00
Jarred Sumner
9f70f68f00 EventEmitter.name should be "EventEmitter" instead of "EventEmitter2" (#14898) 2024-10-29 18:42:24 -07:00
Jarred Sumner
240b2a539f Introduce Bun.randomUUIDv7 (#14858)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-10-29 16:39:09 -07:00
Jarred Sumner
b9e5420571 Add https://github.com/uNetworking/uWebSockets/pull/1792 (#14864) 2024-10-29 12:56:25 -07:00
Jarred Sumner
b5a73130ad Reduce memory usage in long-running processes (#14885) 2024-10-29 12:56:10 -07:00
Jarred Sumner
d5f9978007 Fix missing symbol error on llvm 18 2024-10-29 00:08:29 -07:00
pfg
698e87aa67 Fix #14187 (#14884) 2024-10-28 18:11:03 -07:00
Zack Radisic
5502278f3e CSS: More stuff and tests (#14832)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-27 13:49:25 -07:00
Jarred Sumner
f005e8c057 Fix HTTP spec issues by upgrading uWS version (#14853) 2024-10-27 12:34:45 -07:00
dave caruso
e93c5ad993 feat(bake): css, production build, dev separateSSRGraph=false (#14622)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-10-27 01:57:36 -07:00
Meghan Denny
5237869101 bun-install-registry.test.ts: remove ini format hint here (#14803) 2024-10-26 16:51:19 -07:00
Jarred Sumner
2456d70ac7 Fixes #14716 (#14834) 2024-10-26 15:15:13 -07:00
Meghan Denny
50d80a805d pm: fix weird package.json formatting after install (#14801) 2024-10-26 01:36:25 -07:00
Meghan Denny
2d9a73fc07 test: fix expected value of 'should perform bin-linking across multiple dependencies' (#14833) 2024-10-26 01:02:24 -07:00
Jarred Sumner
d0b3802a79 github actions 2024-10-25 23:50:12 -07:00
Jarred Sumner
7053212566 Update associate-issue-with-sentry.ts 2024-10-25 23:47:15 -07:00
Jarred Sumner
4f5660a6f7 Add sentry id to crash report comment 2024-10-25 23:40:27 -07:00
Dylan Conway
87279392cf fix 9395 (#14815) 2024-10-25 19:58:45 -07:00
Bjorn Beishline
7f5860331e Fixed compilation issues with no outdir (#14717)
Co-authored-by: Meghan Denny <meghan@bun.sh>
2024-10-25 18:43:58 -07:00
Dylan Conway
b895738156 fix(install): migrate package-lock.json with dependency on root package (#14811)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-25 01:32:17 -07:00
Dylan Conway
61534c7efe Remove warning for unused registry options from npmrc (#14813) 2024-10-25 01:31:39 -07:00
Jarred Sumner
ec4c9f8f84 Update mimalloc (#14814) 2024-10-25 01:31:24 -07:00
Jarred Sumner
35a64d8585 Bump WebKit (#14812) 2024-10-25 01:31:12 -07:00
Minsoo Choo
eb6995e09b Update SvelteKit usage guide (#14777) 2024-10-25 00:04:32 -07:00
Meghan Denny
1391e5269b Revert "ci: merge clang-format and clang-tidy into single pipeline" (#14809) 2024-10-25 00:04:13 -07:00
Dylan Conway
9621b641a1 update test/bun.lockb (#14746) 2024-10-25 00:03:52 -07:00
Dylan Conway
5eaa7301eb fix(install): patches with bin in package.json (#14807) 2024-10-25 00:03:19 -07:00
Arthur
f21870a06c chore(console): updated jsdoc table (#14792) 2024-10-24 21:20:46 -07:00
Don Isaac
0e4006eefd ci: merge clang-format and clang-tidy into single pipeline (#14798) 2024-10-24 15:26:05 -07:00
Dylan Conway
9643a924e1 bump 2024-10-24 14:24:08 -07:00
Dylan Conway
247456b675 fix(install): continue install if optional postinstall fails (#14783) 2024-10-23 21:58:53 -07:00
Meghan Denny
6f60523e6c " -> ' (#14776)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-23 19:21:36 -07:00
Jarred Sumner
2de2e9f600 48 -> 64 2024-10-23 18:27:02 -07:00
Ciro Spaciari
29bf8a505d fix(tests) pq -> pg + populate before (#14748) 2024-10-23 18:01:06 -07:00
Jarred Sumner
93d115f9b7 Reduce default max network connection limit from 256 to 48 in bun install (#14755) 2024-10-23 15:34:16 -07:00
Ashcon Partovi
74e440d58a ci: Set prioritization based on fork, main branch, or queue 2024-10-23 09:16:48 -07:00
Ashcon Partovi
aa4dde976d ci: Fix pipeline script when on main branch 2024-10-23 09:03:06 -07:00
Ashcon Partovi
eb0e9b9bde ci: Skip builds when only docs are changed (#14751) 2024-10-23 08:54:53 -07:00
Liran Tal
a656cc1b70 docs: fix missing code highlight in spawn.md (#14761) 2024-10-23 01:01:21 -07:00
Ashcon Partovi
4044ff740d ci: add scripts for building macOS images (#14743) 2024-10-22 16:07:12 -07:00
Ashcon Partovi
b9240f6ec7 cmake: only enable LTO when release + linux + ci 2024-10-22 13:10:58 -07:00
Eckhardt (Kaizen) Dreyer
3db0191409 fix(install): Skip optional dependencies if false in bunfig.toml (#14629) 2024-10-22 11:55:10 -07:00
Oliver Medhurst
00b055566e contributing: fix fedora llvm install steps (#14726) 2024-10-22 11:40:46 -07:00
snwy
517cdc1392 fix jsx symbol collisions when importing own variables with same names (#14343)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-22 00:17:18 -07:00
Pham Minh Triet
8b4b55725e Fix(doc): update Next.js guide (#14730) 2024-10-22 00:16:15 -07:00
Jarred Sumner
38d39109b3 Fix assertion failure 2024-10-21 21:46:17 -07:00
Jarred Sumner
ec29311c7a Bump 2024-10-21 18:05:10 -07:00
Ciro Spaciari
fe8d0079ec tls(Server) fix connectionListener and make alpnProtocol more compatible with node.js (#14695)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-10-21 01:58:14 +00:00
Jarred Sumner
8063e9d6b8 Fixes #14411 (#14691) 2024-10-20 22:02:44 +00:00
Vaggelis Papadogiannakis
ae8de1926e Update instructions to run a bun application via pm2 with the use… (#14704) 2024-10-20 15:06:45 -07:00
Minsoo Choo
b9b94de5ed icu required on openSUSE for local webkit build (#14690) 2024-10-20 01:08:42 -07:00
Jarred Sumner
070e5804ad Implement crypto.hash() (#14683) 2024-10-19 12:14:23 -07:00
Jarred Sumner
67b4478137 Fixes #14333 (#14679) 2024-10-19 01:14:13 -07:00
Jarred Sumner
522c9fa22d Clarify some of this 2024-10-19 00:26:30 -07:00
Jarred Sumner
4b63ffeceb Clarify node-fallbacks 2024-10-19 00:23:57 -07:00
Pham Minh Triet
fe45b1e9b9 Fix(doc): SNI typo (#14508) 2024-10-18 22:37:57 -07:00
Jarred Sumner
d41ca824dd Bump 2024-10-18 22:32:42 -07:00
Meghan Denny
663331c56f fix regression in BunJSGlobalObjectDebuggable from most recent webkit upgrade (#14675) 2024-10-18 22:31:39 -07:00
Meghan Denny
64d0b626b9 Bun.color: fill out missing options and examples for outputFormat (#14656)
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
2024-10-18 22:29:53 -07:00
Dylan Conway
e5c00ab4b4 fix(CryptoHasher): throw error if update or digest are called after digest (#14677) 2024-10-19 02:21:41 +00:00
Meghan Denny
4f2d924db3 Bun.color: match accepted outputFormat options to error (#14657) 2024-10-19 00:34:56 +00:00
Ashcon Partovi
bf8a75a63f Revert "Remove soft_fail from Buildkite since merge queue is enabled"
This reverts commit 253cc15a9f.
2024-10-18 16:04:58 -07:00
Ashcon Partovi
253cc15a9f Remove soft_fail from Buildkite since merge queue is enabled 2024-10-18 13:28:24 -07:00
Meghan Denny
fbf4b30e70 bun-types: add missing options to DigestEncoding (#14654) 2024-10-18 19:17:10 +00:00
Dylan Conway
f3b658d9f7 fix double free with invalid TLSOptions (#14648) 2024-10-18 05:16:21 +00:00
Ciro Spaciari
b652136cf7 update docs (#14620) 2024-10-18 01:26:50 +00:00
Ashcon Partovi
8376b82371 Fix merge queue (#14646) 2024-10-18 01:22:35 +00:00
Ashcon Partovi
7bb39023b8 Merge queue (#14639) 2024-10-18 01:14:42 +00:00
Meghan Denny
850cdb0587 vscode: set the launch configs' cwd to the root (#14643) 2024-10-17 16:24:10 -07:00
Ciro Spaciari
2f2a24f625 bench: fix grpc and scripts (#14638) 2024-10-17 13:30:47 -07:00
Dylan Conway
e448c4cc3b fs.mkdir empty string bugfix (#14510) 2024-10-16 18:55:49 -07:00
Ciro Spaciari
2d0b557ff7 add grpc-js bench (#14601) 2024-10-16 11:11:53 -07:00
Meghan Denny
15f5ba3e26 jest: print received value when expect().toThrow() doesnt throw (#14608) 2024-10-16 11:11:26 -07:00
refi64
1385f9f686 cmake: force the c-ares libdir to always be 'lib' (#14602) 2024-10-16 10:13:20 -07:00
Ciro Spaciari
07ccec0fd8 H2 fixes (#14606) 2024-10-16 09:06:56 -07:00
Dylan Conway
7283453eed use memset_patternN in Buffer.fill (#14599) 2024-10-15 21:16:57 -07:00
Ciro Spaciari
1a08cfcd6b fix h2 tests failures (#14598) 2024-10-15 18:36:23 -07:00
Meghan Denny
06e733cc64 ci: run clang-format on .h files too (#14597)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-10-15 16:54:49 -07:00
Ciro Spaciari
409e674526 feat(node:http2) Implement HTTP2 server support (#14286)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-15 16:28:21 -07:00
Meghan Denny
d15eadaa2c tsconfig.json: update excludes (#14578) 2024-10-15 15:39:09 -07:00
dave caruso
5532e1af10 feat(bake): hot-reloading error modal (#14573) 2024-10-15 00:02:58 -07:00
Meghan Denny
68e6304c73 node:child_process: 'ineherit' stdio should make getters be null (#14576) 2024-10-14 23:41:34 -07:00
Meghan Denny
709cd95c30 test: use isWindows from harness (#14577) 2024-10-14 21:19:09 -07:00
Meghan Denny
3830b0c499 more passing node buffer tests (#14371) 2024-10-14 20:22:14 -07:00
Meghan Denny
291b59eb19 bun-types: small fixes (#12794) 2024-10-14 20:15:03 -07:00
190n
035f97ba13 WIP: nuke EventSource as it doesn't work anyway (#14421) 2024-10-14 19:55:06 -07:00
huseeiin
fef9555f82 fix typo. constributors -> contributors (#14531) 2024-10-14 19:50:17 -07:00
Meghan Denny
ae0106b651 delete legacy node test runner (#14572) 2024-10-14 17:31:34 -07:00
Meghan Denny
355dc56db0 scripts/runner.node.mjs: print list of failing tests when run locally (#14571) 2024-10-14 17:22:06 -07:00
Jarred Sumner
5fc53353fb Allow disabling keep-alive (#14569)
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2024-10-14 16:58:42 -07:00
dave caruso
d2fe1ce1c8 feat(bake): handle bundle errors, re-assemble full client payloads, initial error modal (#14504) 2024-10-14 16:49:38 -07:00
Jarred Sumner
29d287261b Fix several bugs when printing exceptions from Error.captureStackTrace (#14548) 2024-10-14 13:43:06 -07:00
Sebastian
6dbd679c06 docs: fix typo (#14565) 2024-10-14 13:29:28 -07:00
Meghan Denny
a5006a13a8 fetch-tcp-stress.test.ts: todo failing on macos ci (#14514) 2024-10-14 12:48:42 -07:00
Meghan Denny
bebf762bcf streams.test.js: todo failing macos test (#14513) 2024-10-14 12:48:04 -07:00
Minsoo Choo
e6ea389e4e Next.js dev server now runs on Bun (#14566) 2024-10-14 12:11:30 -07:00
Timo Sand
47ff4748bd Remove duplicate in import-json.md (#14521) 2024-10-13 15:34:38 +11:00
Don Isaac
09b031d044 fix(parser): uncaught mismatch between JSX opening/closing tags (#14528) 2024-10-12 19:49:45 -07:00
Zack Radisic
6b8fd718c2 Various CSS stuff (#14499)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-12 07:00:20 -07:00
Jarred Sumner
9ed3858e40 Some types and docs 2024-10-12 06:19:46 -07:00
Dylan Conway
6cf9c41d1f fix(install): ensure read permissions when extracting files (#14511) 2024-10-12 02:37:51 -07:00
Dylan Conway
183a8f61d8 fix bun-build-api.test.ts (#14503) 2024-10-12 00:48:22 -07:00
Jarred Sumner
85fbd1e273 we really need a merge queue 2024-10-11 21:51:40 -07:00
Mathieu Schroeter
9744684b10 Attempt to add support for iterate() with SQLite statements (#14361) 2024-10-11 21:42:59 -07:00
Jarred Sumner
43a5c4a044 Implement Bun.inspect.table (#14486) 2024-10-11 21:35:49 -07:00
Dylan Conway
d3323c84bb fix(publish): missing bins bugfix (#14488)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-11 21:28:47 -07:00
Jarred Sumner
f870293d30 Add timeout warning (#14478) 2024-10-11 21:20:55 -07:00
Jarred Sumner
4c26a257ac Fixes #14398 (#14401) 2024-10-11 21:18:07 -07:00
Jarred Sumner
c77fc5daa0 Implement --drop (#14492)
Co-authored-by: dave caruso <me@paperdave.net>
2024-10-11 20:52:23 -07:00
Dylan Conway
bbb41beadc bump webkit (#14497) 2024-10-11 19:44:53 -07:00
Meghan Denny
3f92ec8af3 fix label in 3-typescript-bug-report.yml (#14502) 2024-10-11 19:39:30 -07:00
Dylan Conway
5fd0a61ae2 CA support for bun install (#14416) 2024-10-11 13:16:26 -07:00
Meghan Denny
9fe6e25372 pm: fix assertion failure when printing lockfile summary after adding git transitive dependency (#14461)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-11 03:43:37 -07:00
190n
50e9be0dc7 Fix napi_value<=>integer conversions and napi_create_empty_array (#14479) 2024-10-10 23:50:39 -07:00
pfg
ba9db6cdb6 Fix console.table for numeric keys (#14484) 2024-10-10 23:50:02 -07:00
Meghan Denny
25fcbed8d1 enhance Buffer.from to support (de)serialization roundtrip (#14201)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-10 22:08:16 -07:00
Meghan Denny
170fafbca9 fix fs-non-number-arguments-throw.test.js (#14312) 2024-10-10 22:07:41 -07:00
Meghan Denny
874c9dbb24 fix fs-open.test.js (#14311) 2024-10-10 22:04:33 -07:00
Jarred Sumner
05f53dc70f Fixes #14464 (#14473) 2024-10-10 21:50:03 -07:00
Meghan Denny
584a8ceb84 enable iterator-helpers in webkit (#14455) 2024-10-10 15:47:59 -07:00
Michael H
05f68d79c8 docs: --conditions flag (#14463) 2024-10-10 04:04:58 -07:00
huseeiin
e650ee7967 Update bun.d.ts (#14429) 2024-10-10 02:35:53 -07:00
190n
50bb5fa1f6 Fix napi_throw_*/napi_create_*_error (#14446) 2024-10-10 02:35:38 -07:00
Dylan Conway
3452f50c96 update webkit (#14449) 2024-10-10 02:35:23 -07:00
snwy
ff476313a8 'let' statements before using statements are now properly converted into 'var' statements (#14260) 2024-10-09 19:14:22 -07:00
Jarred Sumner
def454d859 Bump 2024-10-09 18:20:19 -07:00
Grigory
73537de184 docs(bundler): add missing codetabs closing tag (#14443) 2024-10-09 15:13:42 -07:00
Meghan Denny
1bccd62784 actions: update help text for 'needs repro' label (#14428) 2024-10-09 10:44:31 -07:00
Jarred Sumner
c608a724a6 Update installation.md 2024-10-09 02:36:24 -07:00
Meghan Denny
ca6013acef move .clang-format up a folder so it affects all our c/cpp files (#14400)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-10-08 23:04:05 -07:00
snwy
05e1832c68 remove function hoisting from _parse (#14419) 2024-10-08 18:04:18 -07:00
Jarred Sumner
7a6d17bb99 chore: Make hash formatter reusable (#14372)
Co-authored-by: dave caruso <me@paperdave.net>
2024-10-08 13:30:17 -07:00
Ashcon Partovi
05fb367c5f Move generated files to codegen/ directory (#14392) 2024-10-08 10:32:16 -07:00
versecafe
7996d06b8f --footer esbuild & rollup style! (#14396)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-10-08 02:32:37 -07:00
Jarred Sumner
a234e067a5 Make .get() ignore Object.prototype instead of using getOwn (#14322) 2024-10-08 00:34:31 -07:00
Meghan Denny
c20901fd4e Update 7-install-crash-report.yml (#14394) 2024-10-07 20:45:30 -07:00
Meghan Denny
0d5eb73db0 test: add missing vm.runInContext stubs (#14341) 2024-10-07 20:38:31 -07:00
Kiwi
87c3b2f8d3 Update lockfile.md - fix typo (#14385) 2024-10-07 20:23:45 -07:00
Meghan Denny
1ce2d0e9f5 fix fs-read-empty-buffer.test.js (#14316) 2024-10-07 19:03:30 -07:00
Meghan Denny
c41ff9da93 fix fs-promises-file-handle-write.test.js (#14315) 2024-10-07 18:26:43 -07:00
190n
b0b38b42ba Return undefined from napi_get_property when property does not exist (#14366) 2024-10-07 18:05:31 -07:00
versecafe
62da730060 add banner, .d.ts, cli, make sourcemap compat, and add tests + docs (#14370) 2024-10-07 18:05:06 -07:00
Dylan Conway
c071415664 add bun pm whoami (#14387) 2024-10-07 17:36:14 -07:00
dave caruso
fc85a2dc92 feat(bake): add dependencies to IncrementalGraph (#14368) 2024-10-07 14:18:26 -07:00
Meghan Denny
c5b1c9e302 ci: shorten label names (#14314) 2024-10-07 11:56:37 -07:00
Jarred Sumner
65a6803093 Fixes #14345 (#14374) 2024-10-05 06:00:17 -07:00
Jarred Sumner
6ca68cab65 Update JSType (#14373) 2024-10-05 03:37:24 -07:00
Jarred Sumner
6645eafa08 do not use std.debug.print 2024-10-05 01:16:45 -07:00
Jarred Sumner
29e1ba044d Make this log better 2024-10-05 00:00:19 -07:00
Dylan Conway
fd15e22d64 comment 2024-10-04 23:38:39 -07:00
Dylan Conway
b2cb3603e2 fix(publish): ignore npm-notice when x-local-cache exists (#14352) 2024-10-04 23:36:34 -07:00
Dylan Conway
a15244a4c9 update webkit (#14364) 2024-10-04 22:32:48 -07:00
Zack Radisic
a01f9d8e1b Integrate CSS with bundler (#14281)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Zack Radisic <zackradisic@Mac.attlocal.net>
Co-authored-by: zackradisic <zackradisic@users.noreply.github.com>
Co-authored-by: Zack Radisic <zackradisic@Zacks-MBP.attlocal.net>
2024-10-04 20:23:10 -07:00
lewismiddleton
3ab3dec34d fix(docs): typo in bundler/index.md (#13370) 2024-10-04 20:21:04 -07:00
Dylan Conway
794e416642 Update CONTRIBUTING.md 2024-10-04 18:54:20 -07:00
Mathias
7885742345 fix segfault when decorating computed property #10887 (#14304) 2024-10-04 18:14:20 -07:00
versecafe
7063116c61 add missing docs for new bun pm commands (#14347) 2024-10-04 15:30:30 -07:00
Meghan Denny
4a5ec261ef node: add more passing tests (#14317) 2024-10-04 11:33:46 -07:00
Ashcon Partovi
e3f4c9fd0b ci: Fix analysis commands (#14356) 2024-10-04 09:13:23 -07:00
Dylan Conway
f307d2a6ef test(publish): ci names in user-agent (#14328) 2024-10-04 00:15:22 -07:00
dave caruso
adc86c773b chore: rename kit -> bake (#14335) 2024-10-03 15:34:53 -07:00
Dylan Conway
15427134e1 update 2024-10-03 15:11:44 -07:00
Dylan Conway
808e58cc4d update 2024-10-03 14:50:23 -07:00
Eric Liu
a375ea94ef docs: fix typo in bun publish (#14334) 2024-10-03 14:03:30 -07:00
Dylan Conway
39b1c0111e add docs for bun publish (#14327) 2024-10-03 03:41:11 -07:00
Jarred Sumner
eda608d629 Tweak how we do symbol versioning for glibc (#14272) 2024-10-03 02:42:28 -07:00
Meghan Denny
9446fd60c9 fix Buffer method aliases not being equal to each other (#14198) 2024-10-03 02:31:23 -07:00
Meghan Denny
8e5255d753 node:stream: fix setDefaultHighWaterMark (#14305) 2024-10-03 02:15:39 -07:00
Meghan Denny
13ca4544f2 enhance INVALID_ARG_TYPE and cleanup some node:buffer error handling (#14200) 2024-10-03 02:13:14 -07:00
Jarred Sumner
4d4dd1c180 Refactor node:module (#14227) 2024-10-03 00:54:56 -07:00
dave caruso
dd6554294e bake: release to canary only (#14258)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
2024-10-03 00:52:14 -07:00
Dylan Conway
50ed09654f publish help text 2024-10-02 22:57:34 -07:00
190n
0a54c24bd3 Allow throwing exceptions from napi_async_complete_callback (#14302)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-10-02 22:35:45 -07:00
versecafe
b39f49a5b9 remove bun pack in favor of bun pm pack (#14319) 2024-10-02 22:32:42 -07:00
snwy
e8fec640d8 hoisting of exports when there is top level using (#14313) 2024-10-02 22:32:04 -07:00
Ciro Spaciari
25abe67d43 update root certificates to NSS 3.104 (#14276) 2024-10-02 22:29:32 -07:00
Jarred Sumner
5f135a21b3 Update writing.md 2024-10-02 22:28:14 -07:00
Jarred Sumner
b88ed18245 On test timeout, kill any spawned processes (#14310) 2024-10-02 20:55:59 -07:00
Dylan Conway
f374ae6db1 add bun publish (#14215) 2024-10-02 20:47:22 -07:00
Jarred Sumner
94a656bc4f Support bundling .node files in ESM & CJS when targeting Node.js (#14294)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-10-02 20:15:29 -07:00
190n
54e177e2f9 Rename internal NapiHandleScope push/pop methods to open/close (#14300) 2024-10-02 15:05:38 -07:00
Meghan Denny
39342e34b1 node: define missing constants (#14211) 2024-10-02 14:35:16 -07:00
Mathias
e1cd7e510e Update CONTRIBUTING.md, fix #14225 (#14303) 2024-10-02 13:44:54 -07:00
Meghan Denny
54a225953b use bun.String.static instead of ZigString when immediately converting to JSValue (#14169) 2024-10-02 13:02:48 -07:00
Meghan Denny
419229d950 add ERR_BUFFER_OUT_OF_BOUNDS to internal/errors (#14195) 2024-10-02 07:59:24 -07:00
Meghan Denny
b8a2a11c6f lazy load these requires so that node:cluster imports faster (#14291) 2024-10-02 02:30:19 -07:00
Meghan Denny
25083a4252 pm: print command name to stdout (#14266) 2024-10-02 02:24:37 -07:00
dave caruso
87424390e1 fix 14248 (#14277) 2024-10-02 02:23:54 -07:00
Dylan Conway
92e66691fa fix bun getcompletes index out of bounds (#14289) 2024-10-02 02:23:36 -07:00
Meghan Denny
edebd6faa3 windows: watcher: that line wasnt meant to go to stdout (#14288) 2024-10-02 00:26:20 -07:00
Meghan Denny
531d78aa97 BunProcess: dont use for-loop for isSignalName (#14285) 2024-10-01 23:42:52 -07:00
Meghan Denny
e831bbf4ca node: implement more validators in native code (#14177)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-10-01 21:55:05 -07:00
dave caruso
9870314ff6 fix 13394 (#14278) 2024-10-01 21:27:50 -07:00
Meghan Denny
e44d10cf17 node: lowercase primitive expectations of ERR_INVALID_ARG_TYPE (#14284) 2024-10-01 20:37:13 -07:00
Ashcon Partovi
db0750e90c cmake: Fix version detection 2024-10-01 15:48:13 -07:00
Ashcon Partovi
98e09efd02 cmake: Improve command detection (#14166) 2024-10-01 15:37:57 -07:00
Ashcon Partovi
944f342072 Revert "Remove old clang-tidy workflow"
This reverts commit 16917f7922.
2024-10-01 15:32:18 -07:00
Ashcon Partovi
16917f7922 Remove old clang-tidy workflow 2024-10-01 15:31:42 -07:00
Ashcon Partovi
27a157b6c1 Improve command detection in CMake 2024-10-01 13:50:15 -07:00
Jarred Sumner
07fd814629 Update index.md 2024-10-01 04:32:02 -07:00
Jarred Sumner
e348fef1c6 Update index.md 2024-10-01 04:26:19 -07:00
Jarred Sumner
68b910cbd9 Update index.md 2024-10-01 04:25:30 -07:00
Meghan Denny
e2f20d794f clang-format: add InsertNewlineAtEOF (#14267)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-10-01 03:49:10 -07:00
Jarred Sumner
faa524bf67 Fix missing va_end call 2024-10-01 02:06:56 -07:00
Meghan Denny
016ebf7b9b cmake: only run prettier explicitly (#14228) 2024-09-30 23:43:29 -07:00
Jarred Sumner
2f7ff95e5c Introduce bytecode caching, polish "cjs" bundler output format (#14232)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-09-30 22:37:42 -07:00
Meghan Denny
857a472033 ci: fix build error (#14262) 2024-09-30 22:20:21 -07:00
Jarred Sumner
7720d23da1 Make v8 stack trace parser code more careful (#14205) 2024-09-30 19:09:14 -07:00
Dylan Conway
ecc3e5e187 fix 14250 (#14256) 2024-09-30 19:08:13 -07:00
snwy
dcaaeecfa3 allow importing of files with top level awaits in bundler (#14218)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-30 16:50:50 -07:00
dave caruso
9ab51983b8 chore: make watcher use an anyopaque pointer context (#14224) 2024-09-28 01:44:55 -07:00
Jarred Sumner
af82a446df Support hmac in Bun.CryptoHasher (#14210) 2024-09-27 23:33:22 -07:00
190n
dd12715071 Propagate exceptions in napi_run_script (#14222) 2024-09-27 22:27:57 -07:00
dave caruso
514d37b3d2 kit: implement server components dev server (#14025) 2024-09-27 20:53:39 -07:00
Jarred Sumner
d09df1af47 Deflake a test 2024-09-27 14:22:59 -07:00
Meghan Denny
05afe42f31 fix Buffer.fill with a non-null empty fill including uninitialized bytes (#14199) 2024-09-27 02:50:32 -07:00
Meghan Denny
123b5219e0 include code in detached buffer error for Buffer.isUtf8 and Buffer.isAscii (#14197) 2024-09-27 02:49:38 -07:00
Meghan Denny
7113206a7d fix MAX_STRING_LENGTH constant value (#14196) 2024-09-27 02:48:04 -07:00
Andres Kalle
89fc3ef34d types: clarified parameter name (#14209) 2024-09-27 02:09:37 -07:00
Meghan Denny
392a58b0ed remove duplicate root.h includes (#14194) 2024-09-26 22:01:05 -07:00
Ciro Spaciari
02fb802b25 add req.json leak test (#14191) 2024-09-26 22:00:40 -07:00
Meghan Denny
69d33bb1d0 fix small leak in node:process.execArgv getter (#14154) 2024-09-26 17:10:14 -07:00
190n
4e51f7d85b Refactoring and bug fixes in the V8 API (#13754)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-26 16:54:37 -07:00
Robert Shuford
5e97fb8d97 Support reading from $HOME/.npmrc (#13990) 2024-09-26 14:41:28 -07:00
Meghan Denny
d42c032eec cleanup some error handling in BunProcess (#14178) 2024-09-26 14:20:35 -07:00
Jarred Sumner
afe974a175 Update color.md 2024-09-26 13:47:09 -07:00
Zack Radisic
274e5a2022 CSS Parser (#14122)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-26 13:39:26 -07:00
Jarred Sumner
18822b9f45 Support AbortSignal in Bun.spawn (#14180) 2024-09-26 10:54:54 -07:00
Meghan Denny
7b058e24ff fix memory leak in Bun.shellEscape return value (#14130) 2024-09-25 18:13:28 -07:00
Meghan Denny
ec7078a006 dont leak the address string in UDPSocket.addressToString (#14127) 2024-09-25 18:12:32 -07:00
snwy
af12ff104a fix utf8 handling when importing json (#14168) 2024-09-25 17:50:11 -07:00
Meghan Denny
80db770521 rework node:zlib to match internal js api and properly support async writes (#14079)
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-09-25 15:55:53 -07:00
Meghan Denny
c4c3019cb0 no need to cache protocol in NewServer when its statically known (#14128) 2024-09-25 14:47:50 -07:00
Ashcon Partovi
1f0f666210 Fix zig build again (#14165) 2024-09-25 13:02:56 -07:00
Ashcon Partovi
73f90c3359 Remove unused .docker directory 2024-09-25 12:43:47 -07:00
Ashcon Partovi
291a50aff5 Fix zig build (#14163) 2024-09-25 12:42:47 -07:00
Ashcon Partovi
128c658f91 Use ephemeral vendor path for now 2024-09-25 11:19:42 -07:00
Ashcon Partovi
a87341b239 Fix download zig script 2024-09-25 10:55:22 -07:00
Ashcon Partovi
3ab990e615 cmake: Fix zig build issue 2024-09-25 10:45:43 -07:00
Ashcon Partovi
ecf5d79e01 bun run clang-tidy (#14162) 2024-09-25 10:31:38 -07:00
Ashcon Partovi
b9a56a6087 cmake: Add target to download Node.js headers 2024-09-25 09:39:06 -07:00
Jarred Sumner
5722ae8d04 Make prototype pollution attacks harder in most Bun APIs that accept objects (#14119) 2024-09-25 01:16:29 -07:00
Meghan Denny
2856267fda add missing defers to JSBundler.Plugin.hasAnyMatches (#14129) 2024-09-25 01:15:32 -07:00
Meghan Denny
da70c891df dont leak the message when node:util.getSystemErrorName is passed an invalid code (#14126) 2024-09-25 01:13:22 -07:00
Wilmer Paulino
6f27b5559d Switch RSA asymmetric sign implementation to BoringSSL (#14125) 2024-09-25 01:12:50 -07:00
Ashcon Partovi
117e1b3883 bun run prettier (#14153)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-09-24 22:46:18 -07:00
Ashcon Partovi
1e1025ca37 bun run zig-format (#14152) 2024-09-24 22:10:12 -07:00
Ashcon Partovi
30dc72c17b bun run clang-format (#14148)
Co-authored-by: Electroid <Electroid@users.noreply.github.com>
2024-09-24 20:39:29 -07:00
Jarred Sumner
17d719fa4e Make server.stop return a Promise that fulfills when all opened connections are closed (#14120) 2024-09-24 14:07:29 -07:00
Meghan Denny
0ac2a7da0a dont leak return value in crash_handler jsGetFeaturesAsVLQ (#14131) 2024-09-24 12:26:58 -07:00
Dylan Conway
9d23ce16ec fix(install): relative paths to tarballs in workspaces (#14121) 2024-09-23 22:44:24 -07:00
Ashcon Partovi
7d94c59545 Publish VSCode extension 2024-09-23 16:05:12 -07:00
Meghan Denny
33075394a4 cpp: always return empty JSValue value after throwing exception (#13935)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-09-23 13:53:08 -07:00
Jarred Sumner
ff9560c82a Fix unbalanced ref count involving file descriptors passed to Bun.connect (#14107) 2024-09-23 10:28:50 -07:00
Jarred Sumner
2f8c20ef82 Implement --registry CLI flag in bun install (#14090) 2024-09-22 21:27:33 -07:00
Jarred Sumner
d05070dbfd Fix regression from #13414 (#14092) 2024-09-22 16:02:49 -07:00
Jarred Sumner
1244907a92 Bump 2024-09-22 02:53:21 -07:00
Jarred Sumner
81e5ee26bd Don't re-create the FIFO in streams every time (#14088) 2024-09-22 02:13:11 -07:00
Jarred Sumner
27e7aa7923 Update from-npm-install-to-bun-install.md 2024-09-22 00:33:41 -07:00
Jarred Sumner
f89623aa5e Update from-npm-install-to-bun-install.md 2024-09-22 00:31:01 -07:00
Jarred Sumner
3cc51ceb98 Update from-npm-install-to-bun-install.md 2024-09-22 00:30:08 -07:00
Jarred Sumner
e944bb3638 Update from-npm-install-to-bun-install.md 2024-09-22 00:29:23 -07:00
Jarred Sumner
797750ef42 Update from-npm-install-to-bun-install.md 2024-09-22 00:27:47 -07:00
Jarred Sumner
c267d76f05 Update from-npm-install-to-bun-install.md 2024-09-22 00:25:47 -07:00
Jarred Sumner
c5c1e8ff3a Update from-npm-install-to-bun-install.md 2024-09-22 00:24:56 -07:00
Jarred Sumner
1eab8ec107 Update from-npm-install-to-bun-install.md 2024-09-22 00:23:44 -07:00
Jarred Sumner
60d8c8ad4c Update from-npm-install-to-bun-install.md 2024-09-22 00:17:41 -07:00
Jarred Sumner
dba108f8c4 Update from-npm-install-to-bun-install.md 2024-09-21 23:32:34 -07:00
Jarred Sumner
18251e1b60 Create from-npm-install-to-bun-install.md 2024-09-21 23:29:16 -07:00
Xmarmalade
0bc21b3ddf docs: add ccache for Windows System Dependencies (#14080) 2024-09-21 01:35:01 -07:00
Jarred Sumner
c298b23c45 Fix process.cwd on windows (#14081) 2024-09-21 01:32:23 -07:00
snwy
722e3fa481 fix for windows debug support (#14048)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-21 00:20:33 -07:00
Jarred Sumner
3fc092d23f Fix ci issue 2024-09-20 22:13:16 -07:00
Jarred Sumner
6e0847ca49 Fix searching for lld in $PATH on Linux 2024-09-20 22:09:21 -07:00
Jarred Sumner
7a190de2f1 Fix upload-s3.ts script 2024-09-20 21:34:50 -07:00
Dylan Conway
57a1d7b4ee update 2024-09-20 20:38:52 -07:00
Dylan Conway
3e0e99176a udpate 2024-09-20 20:37:49 -07:00
Ashcon Partovi
fabb18208b Revert "Upload features.json"
This reverts commit 4f02152690.
2024-09-20 18:57:20 -07:00
Ashcon Partovi
4f02152690 Upload features.json 2024-09-20 16:51:16 -07:00
Jarred Sumner
64f4831059 Clarify WASI not WASM 2024-09-20 16:41:49 -07:00
Jarred Sumner
f9a8bed5c2 Make require.cache inspectable (#14072) 2024-09-20 15:27:10 -07:00
190n
08a77267da Keep event loop alive when refConcurrently has been called (#14068) 2024-09-20 14:57:55 -07:00
Jarred Sumner
73c553b25a Update ffi.d.ts 2024-09-20 00:07:26 -07:00
Jarred Sumner
6d43b36622 Allow TCP connections for BUN_INSPECT_NOTIFY (#14056) 2024-09-19 23:55:06 -07:00
Jarred Sumner
8dfa2abb53 Update nav.ts 2024-09-19 23:26:05 -07:00
Ciro Spaciari
d80d9f450c fix(node:http) improve agent support (#13780)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-19 23:04:36 -07:00
Jarred Sumner
ab07cf444d Bump 2024-09-19 21:52:39 -07:00
Jarred Sumner
f263436911 Experiment: Add buffer type and inline pointer (#14036) 2024-09-19 21:26:50 -07:00
Dylan Conway
e938791f77 fix(Bun.build): handle non-object plugins (#14050) 2024-09-19 19:37:28 -07:00
Dylan Conway
cff7b9843d fix 14037 (#14047) 2024-09-19 15:25:38 -07:00
Kevin Gibbons
260a0d16eb docs: Add new methods to binary-data.md (#14044) 2024-09-19 13:36:08 -07:00
Dylan Conway
47e4b826fa fix snapshot regression (#14031) 2024-09-19 13:27:42 -07:00
Jarred Sumner
6415296e96 Support napi inside of bun:ffi (#14028) 2024-09-19 03:19:08 -07:00
dave caruso
866a6d9180 fix(bundler): disable moving identifiers (#14033) 2024-09-19 03:18:16 -07:00
Jarred Sumner
181b8722e2 Enable cc test (#14026) 2024-09-18 21:55:49 -07:00
Jarred Sumner
572bcf0097 Fixes #14014 (#14023) 2024-09-18 19:06:33 -07:00
Dylan Conway
cf4e9cb69e disable most DOMJIT (#14005) 2024-09-17 21:43:38 -07:00
Jarred Sumner
6d98bccd8b TinyCC: -framework support, __attribute__(deprecated(string)) in enum, fix dlsym issue (#13993)
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2024-09-17 15:50:02 -07:00
Dylan Conway
c74ec5ab18 compare major 2024-09-17 10:54:46 -07:00
Dylan Conway
3d68a9483f fix cloning dependencies 2024-09-16 12:18:53 -07:00
Jarred Sumner
b66d622c56 Bump WebKit (#13970) 2024-09-15 04:37:23 -04:00
190n
163e76ef96 Fix memory corruption in napi_open_escapable_handle_scope (#13955)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-15 01:39:18 -04:00
Jarred Sumner
14c63229a1 Revert "various node:buffer fixes" (#13971) 2024-09-14 23:41:33 -04:00
Jarred Sumner
f4391e7023 Support compiling and running C from JavaScript (#13403) 2024-09-14 04:57:44 -04:00
snwy
b9a5e4410f forward IPC to child process if running package script (#13934)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-14 04:40:00 -04:00
Meghan Denny
3c2e798eab various node:buffer fixes (#13757)
Co-authored-by: nektro <nektro@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-14 04:09:20 -04:00
Mattias Leino
a60d5211ca Add documentation for using bun with Testing Library (#13960) 2024-09-14 02:24:10 -04:00
Meghan Denny
ac53310fe9 misc node:zlib fixes [v2] (#13958) 2024-09-14 02:01:04 -04:00
Jarred Sumner
d9d4cff303 Micro-optimize path.resolve(), path.resolve("") (#13930) 2024-09-14 01:42:49 -04:00
Dylan Conway
5af782344f fix(watch): use case insensitive path comparison (#13909)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-14 01:41:33 -04:00
Dylan Conway
7ef0f04acd fix #13942 (#13943) 2024-09-14 01:22:28 -04:00
Meghan Denny
8b1c53dd36 Fix debug builds on macOS arm64 (#13952)
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
2024-09-13 16:01:17 -07:00
Ashcon Partovi
44841d8924 Fix clang-cl flag: /O0 -> /Od 2024-09-13 16:00:16 -07:00
Dylan Conway
3c0327df3a debug libraries 2024-09-13 15:58:22 -07:00
Dylan Conway
e5e8861fde debug icu 2024-09-13 15:57:58 -07:00
Dylan Conway
620b7b101e update webkit (#13931) 2024-09-13 02:43:22 -07:00
Jarred Sumner
34e4447aea Update some paths 2024-09-13 00:40:49 -07:00
190n
3aef88842e Make setInterval leak test not flaky (#13929) 2024-09-12 18:57:06 -07:00
Ashcon Partovi
76191bed44 Various fixes for CMake (#13928) 2024-09-12 18:08:59 -07:00
190n
b146449ed5 Increase timeouts for shell-hang.test.ts (#13932) 2024-09-12 17:23:33 -07:00
dave caruso
c2c2048072 framework api: init / work in progress (#13215)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-12 16:44:03 -07:00
Jarred Sumner
ff6f8bd2d1 Update path-resolve.mjs 2024-09-12 15:00:52 -07:00
Ciro Spaciari
b1ca81a10d fix(node:net, node:tls) add named pipe support on node:net and node:tls modules (#13838) 2024-09-12 14:06:45 -07:00
Jarred Sumner
d9b851e426 Don't panic when a package.json manifest registry api name doesn't match the local name (#13907) 2024-09-12 14:05:45 -07:00
Jarred Sumner
872c7f0d91 Why is path slow (#13908) 2024-09-12 14:05:16 -07:00
Jarred Sumner
0a6594395c Add a couple uv symbols (#13808)
Co-authored-by: Ben Grant <ben@bun.sh>
2024-09-12 00:13:49 -07:00
snwy
043dfa4cc9 fix .env loader printing to stderr when running bun bun.lockb (#13905)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-12 00:10:03 -07:00
Jarred Sumner
173f465fbe ✂️ dead code 2024-09-11 22:04:32 -07:00
Jarred Sumner
51adc273a6 Add message on crash with old CPU (#13886) 2024-09-11 20:14:17 -07:00
190n
522493afa8 Attempt to fix spawn-streaming-stdin.test.ts on Windows (#13860) 2024-09-11 20:14:10 -07:00
Jarred Sumner
c48997050d Avoid creating a Napi handle scope within a finalizer (#13870)
Co-authored-by: Ben Grant <ben@bun.sh>
2024-09-11 20:05:44 -07:00
Jarred Sumner
2064876a7d Fix crash in socket.upgradeTLS (#13884) 2024-09-11 20:05:06 -07:00
snwy
c3197948c4 fixes --conditions for bun test (#13902) 2024-09-11 18:04:21 -07:00
Ashcon Partovi
f5b7a6708d Move dependencies from src/deps/ to vendor/ (#13901) 2024-09-11 17:46:03 -07:00
190n
b33d6b1416 Fix ReadFileUV not reading to the end of a non-regular file on Windows (#13900) 2024-09-11 17:33:01 -07:00
190n
f6841a06c5 Make NAPI garbage collection tests faster (#13898) 2024-09-11 16:59:03 -07:00
Dylan Conway
749632f125 fix(spawn): update cwd before searching for executable to run (#13845)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-09-11 16:58:24 -07:00
Jarred Sumner
de9557b19e Fix edgecase with "os" and "cpu" in bun install (#13848)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-11 16:47:38 -07:00
Jarred Sumner
ed8e6115bb Fix using decimal numbers for file descriptors (#13881) 2024-09-11 15:52:53 -07:00
Jarred Sumner
0378e5a277 Update launch.json 2024-09-11 15:41:41 -07:00
Jarred Sumner
3689978b98 Update clangd 2024-09-11 15:14:59 -07:00
Ashcon Partovi
3939e16664 Fix build.mjs (#13893) 2024-09-11 09:45:42 -07:00
Ashcon Partovi
03285f2490 Reapply "Update build.mjs"
This reverts commit 03d7d9aadd.
2024-09-11 08:25:24 -07:00
Ashcon Partovi
19ef3eecd0 Reapply "Make configure faster with local WebKit build"
This reverts commit a832954c94.
2024-09-11 08:25:05 -07:00
Ashcon Partovi
d39e422b20 Reapply "Convert build scripts to CMake (#13427)"
This reverts commit 374bb15db6.
2024-09-11 08:24:50 -07:00
Dylan Conway
3e904303ac fix hot/hot.test.ts, hot/watch.test.ts, and watch/watch.test.ts (#13876)
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-09-11 01:24:46 -07:00
Jarred Sumner
97baeb80f0 Move EventLoopTask into a separate file because it causes clangd to crash (#13875) 2024-09-11 00:24:48 -07:00
Dylan Conway
4a58a97fa0 fix sleep tests in bun-install-registry.test.ts (#13874) 2024-09-10 22:28:57 -07:00
Dylan Conway
7e705b9d40 fix expo.test.ts (#13872) 2024-09-10 20:52:29 -07:00
Jarred Sumner
1f1e4a08d8 Update nodejs-apis.md 2024-09-10 20:40:34 -07:00
Jarred Sumner
58c74e1a75 Update nodejs-apis.md 2024-09-10 20:35:35 -07:00
Jarred Sumner
d483535693 Update nodejs-apis.md 2024-09-10 20:32:00 -07:00
Dylan Conway
374bb15db6 Revert "Convert build scripts to CMake (#13427)"
This reverts commit 354df17d16.
2024-09-10 19:57:19 -07:00
Dylan Conway
a832954c94 Revert "Make configure faster with local WebKit build"
This reverts commit 1694ca0e89.
2024-09-10 19:56:37 -07:00
Dylan Conway
03d7d9aadd Revert "Update build.mjs"
This reverts commit 24bb8d95b0.
2024-09-10 19:56:36 -07:00
Dylan Conway
ff9b003a9b Revert "Fix permissions on Zig download"
This reverts commit fb5ebe5ceb.
2024-09-10 19:56:34 -07:00
Jarred Sumner
ac17735cac Retry after chmod when cp fails 2024-09-10 19:30:13 -07:00
Ashcon Partovi
fb5ebe5ceb Fix permissions on Zig download 2024-09-10 19:01:09 -07:00
Jarred Sumner
24bb8d95b0 Update build.mjs 2024-09-10 18:54:52 -07:00
Ashcon Partovi
1694ca0e89 Make configure faster with local WebKit build 2024-09-10 17:40:12 -07:00
Ashcon Partovi
354df17d16 Convert build scripts to CMake (#13427) 2024-09-10 17:01:40 -07:00
Jarred Sumner
8d7d58606b Add generator for $ERR_* as fake private globals (#13843)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-10 16:07:22 -07:00
Jarred Sumner
d7f9346f67 Fix broken link 2024-09-10 15:22:08 -07:00
Jarred Sumner
80cb9e77bc Use absolute links in docs 2024-09-10 15:11:16 -07:00
Lev
036e030342 Add the missing 'linked' option to --sourcemap in bun build --help (#13855) 2024-09-10 04:08:52 -07:00
190n
2071507a1b Fix flaky process.cpuUsage tests (#13842) 2024-09-10 02:38:40 -07:00
Jarred Sumner
c7b874447f Add missing timers.promises (#13834)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 17:17:52 -07:00
190n
282b92d6e1 Fix issues with NAPI tests (#13831)
Co-authored-by: 190n <190n@users.noreply.github.com>
2024-09-09 17:08:40 -07:00
Ciro Spaciari
2b50554596 fix(node:http) always set headersSent to true after end (#13794)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
2024-09-09 17:08:17 -07:00
Jarred Sumner
8f5d78f498 Fix default value for zlib options (#13800) 2024-09-09 17:06:41 -07:00
Jarred Sumner
ee2d666e8e Add missing perf_hooks constants (#13833)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 16:54:09 -07:00
Jarred Sumner
3e8a50ba57 workerData should default to null instead of undefined (#13835)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 16:48:12 -07:00
Jarred Sumner
945175961c Set process._exiting to false by default (#13832)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-09 16:45:24 -07:00
dave caruso
d38f937d3d fix(transpiler): remove react element inlining (#13694)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-09 15:03:13 -07:00
Jarred Sumner
07e4b5f3d3 Update run-lint-cpp.yml 2024-09-09 14:32:55 -07:00
Wilmer Paulino
a0939ca4f1 Switch asymmetric encryption implementation to BoringSSL (#13786) 2024-09-08 03:19:23 -07:00
Danny Kirkham
09cbb51c81 Fix typo in http.md (#13793) 2024-09-08 00:56:31 -07:00
Dylan Conway
50d2f76075 fix(pack): don't automatically include CHANGELOG when files is populated (#13789) 2024-09-08 00:56:21 -07:00
github-actions[bot]
09fb2d1db0 Bump to 1.1.27 (#13805)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-08 00:48:15 -07:00
Dylan Conway
267afa2934 implement bun pm pack (#13723)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: dylan-conway <dylan-conway@users.noreply.github.com>
2024-09-07 03:55:09 -07:00
Jarred Sumner
08103aa7ae Fix 2 memory leaks in zlib from #11770 (#13787) 2024-09-07 02:12:09 -07:00
190n
084734db64 Implement napi_handle_scope and napi_escapable_handle_scope (#13756) 2024-09-07 00:55:19 -07:00
Meghan Denny
de5809b45a windows: fix sometimes crash when FDImpl.uv() is called on stdio (#13719)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Dave Caruso <me@paperdave.net>
Co-authored-by: nektro <nektro@users.noreply.github.com>
2024-09-06 21:00:55 -07:00
Jarred Sumner
f0a4b9f96f Copy fix from #13756 into separate PR (#13783)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-06 20:16:20 -07:00
Meghan Denny
8cd515f533 node:zlib: move deflate and gzip into native code (#11770)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-06 18:49:19 -07:00
Jarred Sumner
1458fcca4a Run formatter 2024-09-06 18:13:08 -07:00
Jarred Sumner
4dbd246c49 Update 7-install-crash-report.yml 2024-09-06 18:01:03 -07:00
Jarred Sumner
17553e8ea3 Update 7-install-crash-report.yml 2024-09-06 18:00:14 -07:00
Jarred Sumner
2507ff515a Update 7-install-crash-report.yml 2024-09-06 17:58:58 -07:00
Ciro Spaciari
1011b44d78 fix(node:http) implement request.setTimeout and server.setTimeout (#13772)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-06 17:52:38 -07:00
Ashcon Partovi
cbb57e5c5b Fix bun run being terminated randomly in CI
This was basically a chaos monkey in our CI
2024-09-06 17:37:49 -07:00
Jarred Sumner
ed6554314e github actions 2024-09-06 17:28:19 -07:00
Jarred Sumner
bd38aaab36 Update sqlite3_local.h 2024-09-06 17:25:51 -07:00
Jarred Sumner
6fe2d99a51 Github actions 2024-09-06 17:18:28 -07:00
Jarred Sumner
e8c65a009f clang fmt github action (#13724) 2024-09-06 17:15:07 -07:00
Jarred Sumner
3f9ad7cefc Add a debug assertion 2024-09-06 16:58:08 -07:00
Jarred Sumner
69f97cecf0 Ensure shell keeps process alive while running (#13777) 2024-09-06 16:28:50 -07:00
Meghan Denny
ed7741a662 node:https: provide proper Agent definition (#11826)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-09-06 16:11:19 -07:00
Jarred Sumner
9adf42b373 Handle oom in Buffer.byteLength (#13746) 2024-09-06 14:38:55 -07:00
Jarred Sumner
d3bc0ca722 Add if workers spawned / terminated to crash reports (#13763) 2024-09-06 14:34:33 -07:00
Jarred Sumner
debaa2cc34 Fix CTRL + C behavior in bun run so it doesn't ^[[A (#13762) 2024-09-06 13:54:01 -07:00
Jarred Sumner
ea12db4084 Deflake a test 2024-09-06 13:49:26 -07:00
Meghan Denny
981f1d4a60 fix bad translation in child-process-exec-timeout-kill.test.js (#13765) 2024-09-06 13:26:57 -07:00
Pham Minh Triet
419277f691 fix small typo in semver.md (#13767) 2024-09-06 13:26:20 -07:00
190n
da2a5661af Increase randomIntegrityAuditRate from 0.05 to 1.0 in CI (#13775) 2024-09-06 13:03:23 -07:00
Ciro Spaciari
d8e2c24d70 fix(fetch) fix lifecycle of SSL Proxy, fix lifecycle of tls_props, fix handling chunked encoded redirects when proxing. (#13752) 2024-09-06 01:50:02 -07:00
マルコメ
6010c33137 Add .toml extension to .gitattributes (#13761) 2024-09-05 23:52:12 -07:00
Ciro Spaciari
36c5f843ec feat(tls) add duplex upgrade (#13718) 2024-09-05 19:37:31 -07:00
Jarred Sumner
d38fc909e3 Support ReadableStream in request.clone & response.clone() (#13744) 2024-09-05 17:55:59 -07:00
Solomon ogu
cd7f6a1589 fix: typo in docs and types for sqlite (#13727) 2024-09-04 15:46:05 -07:00
Jarred Sumner
a9cf463eeb Introduce fast path for buffered ReadableStream (#13704)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-09-04 04:16:47 -07:00
Jarred Sumner
f3da37e486 Fixes #13725 2024-09-04 03:26:11 -07:00
Jarred Sumner
ebe070487b github actions 2024-09-03 21:51:04 -07:00
Jarred Sumner
f4539431a0 Update format.yml 2024-09-03 21:44:29 -07:00
Jarred Sumner
c91afdb35c Github actions 2024-09-03 21:43:34 -07:00
Jarred Sumner
128d69dcbe Update format.yml 2024-09-03 21:34:52 -07:00
Jarred Sumner
cd6785771e run prettier and add back format action (#13722) 2024-09-03 21:32:52 -07:00
Jarred Sumner
5108e3e0d9 Add snapshot tests for dependency/version parsing (#13658) 2024-09-02 15:12:00 -07:00
Wilmer Paulino
bd3e62df40 Use JSMapIterator and JSSetIterator for deep equal comparisons (#13674) 2024-09-02 15:10:33 -07:00
Jarred Sumner
1668fde0a9 Support hot reloading when .css or any other imported file changes (#13665) 2024-09-02 15:07:25 -07:00
Jarred Sumner
12174e0577 Call cancel on ReadableStream when Bun.serve() response is aborted (#13687) 2024-09-02 09:40:03 -07:00
Jarred Sumner
c50f8d82d5 Remove outdated callout
Still very active! More stable though.
2024-09-02 05:07:05 -07:00
Jarred Sumner
d30767ea68 Fix crash when throwing an exception from napi (#13664) 2024-09-02 05:00:46 -07:00
Jarred Sumner
6b30c1b30d Add missing OOM exception check in Bun.escapeHTML (#13677) 2024-09-01 23:37:07 -07:00
Jarred Sumner
b64f1e15b5 Fixes #13629 (#13660) 2024-09-01 22:40:31 -07:00
Jarred Sumner
5f6015bb79 Fixes #13657 (#13667) 2024-09-01 18:21:34 -07:00
Jarred Sumner
f123814d87 Fix missing ERR_INVALID_ARG_TYPE in 2 buffer methods (#13617) 2024-09-01 04:40:14 -07:00
Jarred Sumner
ef4bcb314c Use -mmacos-version-min instead of -mmacosx-version-min (#13640) 2024-09-01 04:39:32 -07:00
Mohit Srivastava
fd2ad27b6f Change contributing docs to use llvm 18 on macos (#13651) 2024-09-01 00:31:45 -07:00
Jarred Sumner
03de99afcf Add tests for static routes + support server.reload for static routes (#13643) 2024-08-31 03:32:08 -07:00
Wilmer Paulino
9ba63eb522 Fix AES-GCM encryption of empty messages (#13646) 2024-08-31 02:29:16 -07:00
Ciro Spaciari
bac38b8967 fix(tls/fetch) Better SSLWrapper for http proxy and start of Duplex support on tls (#12750)
Co-authored-by: cirospaciari <cirospaciari@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 23:22:58 -07:00
Wilmer Paulino
76c4145f0e Return expected data when using Promises with crypto.generateKeyPair (#13600)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 20:14:47 -07:00
Ciro Spaciari
adb54f1849 fix(Server) handle requestIP after async call (#13532)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 19:13:53 -07:00
Jarred Sumner
0f4aa68575 Bump build.zig minimum to macOS 13 (#13639) 2024-08-30 19:12:53 -07:00
Jarred Sumner
6555248a04 Make the V8_UNIMPLEMENTED error include the function name (#13559)
Co-authored-by: 190n <ben@bun.sh>
2024-08-30 18:52:08 -07:00
Jarred Sumner
2f19b71e0f Bump WebKit again (#13641) 2024-08-30 18:18:29 -07:00
Jarred Sumner
9076b369f0 Fixes #4432 (#13597) 2024-08-30 18:01:32 -07:00
Ciro Spaciari
9cb203f229 update(root_certs) update certs (#13609) 2024-08-30 16:51:09 -07:00
Félix C. Morency
5650ed470c fix: lcov non-hit executable lines reporting (#13633) 2024-08-30 16:08:23 -07:00
Jarred Sumner
fc99dd27e3 Un-revert read .gitconfig (#13637)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-08-30 16:04:47 -07:00
Jarred Sumner
4d61637e8a Deflake bun-build-api test (#13636) 2024-08-30 14:59:47 -07:00
Michael H
aed0f58dfc bun install global package include -g flag in untrusted message (#13626) 2024-08-30 14:58:41 -07:00
Jarred Sumner
a37694cec2 Fix hypothetical race condition in Bun.build API (#13618) 2024-08-30 14:56:59 -07:00
Jarred Sumner
b52f9923e2 Delete macOS 10.5 support polyfills (#13635) 2024-08-30 14:47:31 -07:00
Jarred Sumner
1bed7a7fd1 Introduce static option in Bun.serve() (#13540) 2024-08-30 01:36:18 -07:00
Grigory
59eb5515c5 fix(nodevm): align behavior with node (#13590) 2024-08-30 01:34:18 -07:00
Jarred Sumner
682b3730a1 Revert "fix overriding sshCommand and askpass from gitconfig" (#13620) 2024-08-30 00:59:00 -07:00
Ciro Spaciari
bd3c258af4 fix(FormData, Bun.file()) FormData can append file slices, Bun.file(..).slice(..).text() works as expected (#13580)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-30 00:53:40 -07:00
Dylan Conway
9faaa9b982 fix overriding sshCommand and askpass from gitconfig (#13612) 2024-08-30 00:49:49 -07:00
Jarred Sumner
bd2eb40a39 Fix oom handling in Bun.file (#13603) 2024-08-29 18:54:33 -07:00
Dylan Conway
f3ed9eac4a fix(outdated): match scoped names with * (#13610) 2024-08-29 16:06:41 -07:00
Jarred Sumner
b55670ddb7 Fixes #10084 (#13601) 2024-08-29 11:02:34 -07:00
Ashcon Partovi
39eecc7757 Disable auto-labeler for now 2024-08-29 11:00:57 -07:00
Jarred Sumner
6faf657e32 Implement --max-http-header-size (#13577) 2024-08-29 00:38:47 -07:00
Jarred Sumner
e48369ddab Fixes #4443 (#13596) 2024-08-28 21:17:06 -07:00
Jarred Sumner
743f40b473 Make the panic message better when this assertion failure happens (#13579) 2024-08-28 19:07:22 -07:00
Jarred Sumner
b4e552dbeb WebKit upgrade (#13578) 2024-08-28 19:06:29 -07:00
Jarred Sumner
952d44b675 Fixes #13581 (#13583) 2024-08-28 13:54:57 -07:00
Jake Boone
8cb0b5db21 Fix alignment in bun outdated example grid (#13573) 2024-08-27 17:52:00 -07:00
Dylan Conway
1976e5bc00 fix #13563 and #12440 (#13575) 2024-08-27 17:46:16 -07:00
Jarred Sumner
f520715622 Update label-issue.ts 2024-08-27 14:13:21 -07:00
Jarred Sumner
a4264cef23 Update label-issue.ts 2024-08-27 03:56:06 -07:00
Jarred Sumner
09f002934c Update labeled.yml 2024-08-27 03:53:05 -07:00
Jarred Sumner
89dfe9beb6 Update label-issue.ts 2024-08-27 03:43:57 -07:00
Jarred Sumner
4ac415f58d Update labeled.yml 2024-08-27 03:39:13 -07:00
Jarred Sumner
acd8567fa0 Add issue labeler 2024-08-27 03:37:42 -07:00
Dylan Conway
ba2ea6fbb2 add --filter and package pattern arguments to bun outdated (#13557) 2024-08-27 00:18:27 -07:00
Pocky
36c621b6b1 docs: sync Statement.all and Statement.get docs with types (#13544) 2024-08-26 18:30:22 -07:00
Pocky
bab5fec95f Fix Date in SQLite Example Comment (#13558) 2024-08-26 18:29:34 -07:00
Jake Bailey
e6b30a90de Use more compatible screen clearing ANSI escape (#13553) 2024-08-26 18:17:31 -07:00
Jarred Sumner
fea302ee1d Add missing destroySoon (#13555) 2024-08-26 18:09:05 -07:00
Jarred Sumner
2ffcccc5b4 Fixes #5591 (#13541) 2024-08-26 16:09:48 -07:00
Ciro Spaciari
11d7a9d5e9 fix(randomInt) allow negatives and improve args validation (#13527) 2024-08-25 23:16:25 -07:00
Jarred Sumner
55cdf69415 Make the error better on Windows when you do Bun.file(path).writer() (#13536) 2024-08-25 22:29:52 -07:00
Jarred Sumner
ac8f9052a2 Deflake fs.test.ts (#13538) 2024-08-25 21:43:16 -07:00
Jarred Sumner
5a525d3042 Deflake test/js/web/fetch/fetch-tcp-stress.test.ts (#13537) 2024-08-25 21:24:36 -07:00
Ciro Spaciari
6fd06dd023 fix(Bun.serve) ensure timeout reset when we write data (#13525) 2024-08-25 20:27:49 -07:00
Ciro Spaciari
df9d18659c revert d8ac4c59ff 2024-08-25 19:43:24 -07:00
Ciro Spaciari
d8ac4c59ff deflaky 2024-08-25 19:35:35 -07:00
Ciro Spaciari
3309a8479c temporary disable this 2024-08-25 13:44:18 -07:00
Ashcon Partovi
3896b0e29f Fix build-bun.sh 2024-08-25 09:48:38 -07:00
Ashcon Partovi
c4f4d7c872 Fix build-bun.sh 2024-08-25 09:29:29 -07:00
Ashcon Partovi
ebdd678da5 Upload features.json to Buildkite 2024-08-25 09:19:42 -07:00
github-actions[bot]
7529cd76b5 Bump to 1.1.26 (#13504)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
2024-08-24 16:12:43 -07:00
Jarred Sumner
9eeef3f5df Update release.yml 2024-08-24 01:29:28 -07:00
Jarred Sumner
2b1a10629b Update upload-npm.ts 2024-08-24 01:22:33 -07:00
Jarred Sumner
0a37423baf Expose subscriberCount in WebSocket server (#13498) 2024-08-23 23:12:01 -07:00
Dylan Conway
1a9307da08 bun outdated docs (#13497)
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-08-23 23:11:52 -07:00
Jarred Sumner
b005ef43d4 Deflake fs.test.ts 2024-08-23 22:55:30 -07:00
Jarred Sumner
078fdd3787 Make the test runner work on older versions of Bun 2024-08-23 22:55:12 -07:00
Jarred Sumner
dc58c42453 Fix test harness in older versions 2024-08-23 22:48:49 -07:00
Jarred Sumner
b53c25e5f8 Redo napi cleanup hooks (#13487) 2024-08-23 21:09:56 -07:00
Jarred Sumner
e97c65fd1e Add 59 more node tests + copy node test fixtures (#13495) 2024-08-23 19:06:35 -07:00
Ciro Spaciari
5a108c5027 fix(fetch) always make sure that abort tracker is cleaned, revise ref count (#13459) 2024-08-23 17:08:57 -07:00
Jarred Sumner
0f1d5d5dab Align getMockName and mockName behavior with jest (#13494) 2024-08-23 15:46:04 -07:00
Dylan Conway
6415cc3e92 implement bun outdated (#13461)
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-08-23 02:15:13 -07:00
Jarred Sumner
8d34846d19 Bump 2024-08-23 01:13:55 -07:00
Jarred Sumner
781998cf00 You shouldn't need --only to only run test.only tests (#13465) 2024-08-23 00:06:57 -07:00
Jarred Sumner
02a75070fb Preserve "use strict"; directive in CommonJS modules at top of file (#13485) 2024-08-22 23:51:27 -07:00
Jarred Sumner
ac8db43485 Throw ERR_INVALID_THIS in DOM types (#13484) 2024-08-22 23:25:41 -07:00
Jarred Sumner
94ee538dc6 About 13% of node's test suite (#13468) 2024-08-22 18:00:25 -07:00
Dylan Conway
9cdda49485 fix(node:util): use Object.setPrototypeOf in inherits (#13480) 2024-08-22 17:58:00 -07:00
Jarred Sumner
2c84840222 Fix crash in buffer found in node tests (#13460) 2024-08-22 16:16:25 -07:00
Jarred Sumner
dafa9946e4 Disable DOMJIT for crypto.getRandomValues() (#13470) 2024-08-22 15:52:38 -07:00
Ciro Spaciari
74d5b93ffc fix(dns.resolveSrv) (#13478) 2024-08-22 15:36:22 -07:00
Jarred Sumner
886c31f0c5 Fix expect.assertions() and done callback (#13463) 2024-08-22 15:26:58 -07:00
Jarred Sumner
1bac09488d Copy some node tests (#13458) 2024-08-21 23:09:09 -07:00
Jarred Sumner
83a256013f Support asymmetric matchers in expect().toThrow (#13455) 2024-08-21 21:06:05 -07:00
Ciro Spaciari
384988f26c feat(Bun.serve idleTimeout) allow custom timeouts (#13453) 2024-08-21 18:13:03 -07:00
190n
fe62a61404 Fix V8 API memory management and implement more APIs (#13426) 2024-08-20 19:32:44 -07:00
Jarred Sumner
ef8fd12e43 Include "name" and lastModified when console.log'ing Blob or File (#13435) 2024-08-20 19:27:38 -07:00
Jarred Sumner
999324a50c Add standalone_executable to crash reporter feature list (#13431) 2024-08-20 19:25:45 -07:00
Ciro Spaciari
8ace981fbc fix(node:http/node:https) emit continue (#13434) 2024-08-20 17:10:21 -07:00
Jarred Sumner
02ff16d95c Support Worker, relative file paths in standalone executables, and partially directories (#13421) 2024-08-20 13:05:40 -07:00
Ciro Spaciari
1d188dbc55 fix(subprocess) use deref and use new (#13429) 2024-08-20 12:45:46 -07:00
Jarred Sumner
f16d802eb1 Implement V8::String::{Utf8Length, IsOneByte, ContainsOnlyOneByte, IsExternal, IsExternalTwoByte, IsExternalOneByte} (#13417) 2024-08-20 11:51:23 -07:00
Ciro Spaciari
eb8ed27a4a fix(ipc/subprocess) (#13414)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-20 05:19:23 -07:00
190n
5eb053fa3b Use bun instead of npm even for Node.js build in V8 tests (#13352)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-19 19:06:12 -07:00
Ciro Spaciari
f9af7be5ae fix(net) make sure to always end the connection when destroy is called (#13412) 2024-08-19 15:55:05 -07:00
Ciro Spaciari
1367e5e85a fix(ipc) fix closing edge case (#13413) 2024-08-19 15:53:36 -07:00
Jarred Sumner
d55b5cc169 Enable reusePort in Bun.serve() by default when using node:cluster (#13381) 2024-08-18 22:34:58 -07:00
Dylan Conway
fa2e00f109 fix freeing semver ranges (#13399) 2024-08-18 22:34:38 -07:00
Roman
9993d72fee docs: remove extra assignment (#13389) 2024-08-18 10:52:00 -07:00
Meghan Denny
fd75ca7585 implement node:cluster (#11492)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: nektro <nektro@users.noreply.github.com>
Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
2024-08-18 00:12:42 -07:00
Jarred Sumner
a53db001db Fixes #13343 (#13360) 2024-08-17 20:22:12 -07:00
Jarred Sumner
1a5c05adca Another attempt to fix aarch64 mock module test failure (#13356) 2024-08-17 18:10:35 -07:00
Zack Radisic
58d02e467f Fix shell backticks crash (#13375) 2024-08-17 18:07:03 -07:00
Ciro Spaciari
63596c3f8c fix(sockets) always uncork when closing (#13358)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-17 02:53:10 -07:00
Meghan Denny
996847bcad ci: disable bun-jsc.test.ts 'profile async' on windows for now (#13363) 2024-08-17 02:50:48 -07:00
Jarred Sumner
33c91fe3fa Bump WebKit (#13355) 2024-08-16 22:40:29 -07:00
Meghan Denny
7fd072f4af node:fs: use bun.assert to fix zig linter (#13353) 2024-08-16 18:23:45 -07:00
Ciro Spaciari
15a8e72790 fix(ws test) deflaky (#13348) 2024-08-16 16:15:12 -07:00
Jarred Sumner
64d77e33f6 Fixes #13331 (#13340) 2024-08-16 15:42:11 -07:00
190n
babc907bfe Support Unicode strings in V8 APIs (#13335) 2024-08-16 15:16:39 -07:00
190n
83c5d8a942 Support doubles in v8::Number (#13336)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-16 14:34:04 -07:00
MARCROCK22
5a8e98cec2 add missing Timer types and Bun.build sourcemap "linked" (#13349) 2024-08-16 14:26:44 -07:00
Meghan Denny
d4237b0757 node:fs: mode+flags message cleanup (#13332) 2024-08-15 23:19:25 -07:00
Jarred Sumner
766a9cf4f2 Fix some argument validation issues in fetch() (#13337) 2024-08-15 23:14:59 -07:00
Jarred Sumner
98a709fb1b Further clang-analyzer (#13324) 2024-08-15 15:01:36 -07:00
Meghan Denny
715ff7f323 node:fs: add additional error handling for flags and mode (#13321)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-15 13:13:11 -07:00
Jarred Sumner
df1744f0da Bump 2024-08-15 13:12:32 -07:00
Dylan Conway
5bd344281f fix(TextEncoder): domjit crash in encode (#13320)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-15 03:35:58 -07:00
Viktor L
b70458c3e4 Fix "bun exec" examples (#13318) 2024-08-15 00:31:29 -07:00
Jarred Sumner
3f686222d4 Micro-optimize Module._resolveFilename (#13322) 2024-08-14 23:36:46 -07:00
Jarred Sumner
36fc324523 Fixes #13311 (#13319) 2024-08-14 22:46:45 -07:00
Meghan Denny
a5bd94f582 node:net.Server listen handler should be bound to the server (#13290)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 19:00:57 -07:00
Jarred Sumner
4fae1b4475 Increase max concurrent connection count for connecting sockets (#13294) 2024-08-14 19:00:31 -07:00
Jarred Sumner
2fa60f2d12 Appease clang-tidy (#13312) 2024-08-14 19:00:20 -07:00
Jarred Sumner
6d79edaa15 Fixes https://github.com/oven-sh/bun/issues/13001 (#13313) 2024-08-14 18:11:10 -07:00
190n
dc2929d4e1 Start implementing internal V8 APIs (#12821)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 17:51:12 -07:00
Meghan Denny
5bc45e2721 node:net.Socket#{ref,unref} are supposed to return this (#13291)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 17:23:39 -07:00
Dylan Conway
fe7f5fa731 switch nodemailer test to mailgun (#13314) 2024-08-14 17:18:03 -07:00
Meghan Denny
30edb594a8 node:fs: use libuv callbacks instead of custom workpool for some operations on windows (#13278)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 14:57:25 -07:00
Ashcon Partovi
1961a9acc8 Fix using tmpdir for clean builds 2024-08-14 14:09:07 -07:00
Ashcon Partovi
9482a0afdf Fix CI cache not working on macOS & Linux 2024-08-14 14:02:29 -07:00
Ashcon Partovi
a1312066b3 Fix secrets in CI tests (#13306) 2024-08-14 11:13:09 -07:00
Jarred Sumner
85a3299115 CI fixes 2024-08-14 02:09:30 -07:00
Jarred Sumner
3ea71a9672 Update env.sh 2024-08-14 02:07:01 -07:00
Jarred Sumner
bf945f6dbb Update env.sh 2024-08-14 02:05:16 -07:00
Jarred Sumner
a366135bd2 Update runner.node.mjs 2024-08-14 01:53:27 -07:00
Ciro Spaciari
eec5abd0da fix(net) remove unnecessary closeNT call (#13282)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-14 01:51:40 -07:00
Jarred Sumner
cede04b019 Ensure secrets are set in CI (#13285) 2024-08-14 01:50:57 -07:00
Jarred Sumner
cf1863236a Do not skip tests due to missing credentials in CI. (#13284) 2024-08-13 22:44:52 -07:00
Jarred Sumner
bd3517197c Fix flaky process.cpuUsage test on linux (#13279) 2024-08-13 21:16:39 -07:00
Daniel M.
2c93e917a9 Fix typo (#13266) 2024-08-13 21:10:44 -07:00
Jarred Sumner
5e6b509100 Bump 2024-08-13 17:52:15 -07:00
Ciro Spaciari
c229da8d9a fix(expect) fix behavior of .not.throw when receiving a string (#13272) 2024-08-13 17:51:18 -07:00
Jarred Sumner
4304368fc0 Clean up error codes in napi somewhat (#13179) 2024-08-13 12:42:10 -07:00
Ciro Spaciari
460d6edbda fix(net/tls) we need to call end when we got FIN if allowHalfOpen is false (#13212)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-13 00:24:37 -07:00
Meghan Denny
9628ee76fc windows: fix fs-promises-writeFile-async-iterator.test.ts [v2] (#13164)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-13 00:24:23 -07:00
Jarred Sumner
9fd6a04460 Fix importing empty toml file at runtime (#13252) 2024-08-13 00:21:18 -07:00
Meghan Denny
a13a020d4c console: remove further uses of unbuffered_writer (#13257)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-13 00:09:23 -07:00
Jarred Sumner
3a245dd248 upgrade webkit (#13192)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-08-12 23:17:17 -07:00
Ciro Spaciari
b972ed6540 fix(IPC) make IPC on windows compatible with node.js (#13258) 2024-08-12 20:14:43 -07:00
Ciro Spaciari
dfa3a9a369 fix(sockets) fix connecting sockets not reporting close when context or the socket it self is closed manually (#13249) 2024-08-12 13:30:10 -07:00
Jarred Sumner
444766833c Fixes #13226 (#13234) 2024-08-11 01:18:40 -07:00
Jarred Sumner
f7d459eea5 Create text-decoder-stream.mjs 2024-08-10 17:09:51 -07:00
Jarred Sumner
7d018fb323 Update text-encoder-stream.mjs 2024-08-10 03:20:14 -07:00
Jarred Sumner
5f08478229 Update text-encoder-stream.mjs 2024-08-10 03:15:11 -07:00
Jarred Sumner
d861347dc5 Optimize TextEncoderStream, part 1 (#13222) 2024-08-10 02:13:36 -07:00
Meghan Denny
1eb5ecb563 ci: fix setInterval.test.js on windows (#13213) 2024-08-10 00:53:23 -07:00
Meghan Denny
6661ab6022 console: implement cutoff for large arrays (#13220) 2024-08-10 00:53:02 -07:00
dave caruso
23aa4f2959 fix(bundler): tagged templates can never be moved (#13193) 2024-08-09 19:32:23 -07:00
Dylan Conway
9302b42919 revert 84c91bf7e1 (#13214) 2024-08-09 19:28:08 -07:00
Ciro Spaciari
b9ead441c1 fix(sockets) add socket wrapper and refactor context ownership handling in socket.zig (#13176) 2024-08-09 18:34:17 -07:00
Ciro Spaciari
24dbef7713 fix(server) fix flushing (#13207) 2024-08-09 18:20:04 -07:00
Ciro Spaciari
28c40babd2 fix(ws) fix handling of messages (#13210)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-09 16:27:29 -07:00
Jarred Sumner
35465d3a29 Set -ffile-prefix-map (#13190) 2024-08-09 14:36:44 -07:00
Jarred Sumner
7aaf935711 Handle OOM better (#13142) 2024-08-09 00:43:54 -07:00
Dylan Conway
bfca627dfa fix node:vm and DOMJIT (#13185) 2024-08-09 00:33:49 -07:00
Jarred Sumner
22e37a5c8d Add more debug exception checks (#13188) 2024-08-08 22:49:26 -07:00
Jarred Sumner
960514364e Bump 2024-08-08 22:02:31 -07:00
Jarred Sumner
98078e7639 Fix leak when throwing exception in Response constructor (#13186) 2024-08-08 21:48:17 -07:00
Jarred Sumner
62d973f19f throw("Out of memory") -> throwOutOfMemory() (#13182) 2024-08-08 20:53:43 -07:00
Jarred Sumner
5cbb6926f5 Add test for file descriptor leaks in FileSink (#13181) 2024-08-08 18:33:41 -07:00
Ciro Spaciari
077ee55211 fix fast shutdown (#13156) 2024-08-08 15:54:54 -07:00
Jarred Sumner
adb31c0752 Fixes #12881 2024-08-08 15:01:55 -07:00
Meghan Denny
ab55477c2d vscode/launch.json: audit and tidy (#13162) 2024-08-08 14:27:36 -07:00
Meghan Denny
ef23b8e60c package.json: add build:windows:release script (#13163) 2024-08-08 14:27:01 -07:00
Jarred Sumner
e6528f81c9 Update stale.yaml 2024-08-08 13:27:18 -07:00
Jarred Sumner
1481cc2730 Update stale.yaml 2024-08-08 13:24:46 -07:00
Jarred Sumner
e6c87bddee Update stale.yaml 2024-08-08 13:20:31 -07:00
Jarred Sumner
f7b2e2a795 Add stale label 2024-08-08 13:18:21 -07:00
huseeiin
3aaa240233 Add bytes() to Blob (#13166) 2024-08-08 10:23:08 -07:00
Meghan Denny
9d74b5bdc8 crash_handler: support printing windows version (#13157) 2024-08-07 21:34:07 -07:00
Ashcon Partovi
d74a192345 Fix submodules script 2024-08-07 14:03:20 -07:00
Ashcon Partovi
76a3dc268d Skip canary release on release build 2024-08-07 13:56:46 -07:00
Ashcon Partovi
d2c821bbf6 Potential fix for dependencies script 2024-08-07 13:54:06 -07:00
Ashcon Partovi
ff334da585 Rebuild dependencies if release build 2024-08-07 13:46:41 -07:00
huseeiin
d96629e053 Better MDN reference (#13144) 2024-08-07 13:22:41 -07:00
Ciro Spaciari
c527058f14 implement NODE_EXTRA_CA_CERTS (#13150) 2024-08-07 13:21:52 -07:00
Ciro Spaciari
3efd445084 refactor(fetch) make handshake less confuse (#13145) 2024-08-07 13:20:05 -07:00
Ashcon Partovi
84c91bf7e1 Revert TextDecoderStream until next release (#13151) 2024-08-07 12:34:04 -07:00
Dylan Conway
9f7c6e34cb Add TextDecoderStream, TextEncoderStream, and TextDecoder.decode("", { stream: true}) (#13115) 2024-08-07 02:36:29 -07:00
Meghan Denny
d44969769f darwin: implement node:os.freemem() (#12870) 2024-08-07 02:31:45 -07:00
Meghan Denny
ff0f9d5f4d node:worker_threads: fix assertion when require is used with 'eval:true' (#13108) 2024-08-07 02:30:40 -07:00
Meghan Denny
c63c55cbb1 node:fs: fix assertion when chown is passed non-numbers (#13113) 2024-08-07 02:29:50 -07:00
Meghan Denny
6d09772a13 ci: build windows in ReleaseSafe (#13140) 2024-08-07 02:24:54 -07:00
Jarred Sumner
df33f2b2a2 Make getIfPropertyExists binding safer (#13134) 2024-08-06 19:23:01 -07:00
Ashcon Partovi
923303047f Fix S3 upload URL for canary assets 2024-08-06 18:51:06 -07:00
Jarred Sumner
3876ecfde8 Add test for calling websocket server publish/send methods repeatedly on closed sockets (#13131) 2024-08-06 16:22:21 -07:00
dave caruso
2680deb5d3 feat: bun build --compile --sourcemap (#13047) 2024-08-06 13:51:11 -07:00
Jarred Sumner
e1aadd0d7a Fix missing user-provided reason in fs.watch abort (#13118) 2024-08-06 00:37:17 -07:00
Jarred Sumner
7a6efad44e Skip creating JSValue for abort when it's not necessary in more cases (#13117) 2024-08-06 00:37:03 -07:00
dave caruso
4ed0c36063 fix(bundler): handle assigning to exports (#13119) 2024-08-06 00:33:32 -07:00
Meghan Denny
b75c605a75 node:http: fix assertion when request() is given options.headers thats non-object (#13112) 2024-08-05 23:54:51 -07:00
Jarred Sumner
7da9e7c45d Add test to #13082 and use WTF_MAKE_FAST_ALLOCATED (#13105)
Co-authored-by: FuPeiJiang <42662615+FuPeiJiang@users.noreply.github.com>
2024-08-05 22:07:49 -07:00
dave caruso
30d06dec47 fix(bundler): use visited enum value (#13101) 2024-08-05 18:35:04 -07:00
Ashcon Partovi
3674493aa4 Potential fix for canary artifacts missing 2024-08-05 17:49:12 -07:00
Jarred Sumner
cacbaba524 Make signal.abort() from native code fast (#13064) 2024-08-05 15:50:36 -07:00
Jarred Sumner
0d7d789ebd Implement aborted() in node:util and getEventListeners in node:events (#13100) 2024-08-05 15:47:52 -07:00
Jarred Sumner
1aa35089d6 Enable more sanitizers and fix mimalloc debug configuration (#13086) 2024-08-04 21:25:00 -07:00
Jarred Sumner
1de1745085 Bump LLVM 18 in C++ lint 2024-08-04 21:24:31 -07:00
Jarred Sumner
639e9a83d5 Add nullability annotations (#13048) 2024-08-04 21:16:41 -07:00
Jarred Sumner
9db3379cc5 Fix missing source code preview in Next.js dev server (#13073) 2024-08-04 20:13:27 -07:00
Jarred Sumner
c5c55c7ce4 Fixes #13049 (#13069) 2024-08-04 19:50:53 -07:00
Jarred Sumner
43326b0b2d Fixes #12894 (#13067) 2024-08-04 19:49:49 -07:00
Jarred Sumner
680f842948 Fix missing error log in Bun.serve (#13066) 2024-08-04 17:54:43 -07:00
Ciro Spaciari
363a4934d0 fix(server) (#13078) 2024-08-04 17:34:31 -07:00
Andrew Johnston
98f9e276b0 fix(build): retry webkit download on failure, resume download with curl (#13061)
Co-authored-by: Andrew Johnston <andrew@bun.sh>
2024-08-04 09:00:00 -07:00
guest271314
ce1286efef Try to fix formatting in rendered guides document (#13077) 2024-08-04 08:59:00 -07:00
guest271314
fd84ace83b Document Bun supports Import Attributes and JSON modules syntax (#13074) 2024-08-04 07:44:38 -07:00
Andrew Johnston
483af7c33c fix (worker-eval): fail worker with source when eval = false (#13062)
Co-authored-by: Andrew Johnston <andrew@bun.sh>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-08-03 23:49:36 -07:00
5050 changed files with 450355 additions and 131541 deletions

170
.buildkite/Dockerfile Normal file
View File

@@ -0,0 +1,170 @@
ARG LLVM_VERSION="18"
ARG REPORTED_LLVM_VERSION="18.1.8"
ARG OLD_BUN_VERSION="1.1.38"
ARG DEFAULT_CFLAGS="-mno-omit-leaf-frame-pointer -fno-omit-frame-pointer -ffunction-sections -fdata-sections -faddrsig -fno-unwind-tables -fno-asynchronous-unwind-tables"
ARG DEFAULT_CXXFLAGS="-flto=full -fwhole-program-vtables -fforce-emit-vtables"
ARG BUILDKITE_AGENT_TAGS="queue=linux,os=linux,arch=${TARGETARCH}"
FROM --platform=$BUILDPLATFORM ubuntu:20.04 as base-arm64
FROM --platform=$BUILDPLATFORM ubuntu:18.04 as base-amd64
FROM base-$TARGETARCH as base
ARG LLVM_VERSION
ARG OLD_BUN_VERSION
ARG TARGETARCH
ARG DEFAULT_CXXFLAGS
ARG DEFAULT_CFLAGS
ARG REPORTED_LLVM_VERSION
ENV DEBIAN_FRONTEND=noninteractive \
CI=true \
DOCKER=true
RUN echo "Acquire::Queue-Mode \"host\";" > /etc/apt/apt.conf.d/99-apt-queue-mode.conf \
&& echo "Acquire::Timeout \"120\";" >> /etc/apt/apt.conf.d/99-apt-timeout.conf \
&& echo "Acquire::Retries \"3\";" >> /etc/apt/apt.conf.d/99-apt-retries.conf \
&& echo "APT::Install-Recommends \"false\";" >> /etc/apt/apt.conf.d/99-apt-install-recommends.conf \
&& echo "APT::Install-Suggests \"false\";" >> /etc/apt/apt.conf.d/99-apt-install-suggests.conf
RUN apt-get update && apt-get install -y --no-install-recommends \
wget curl git python3 python3-pip ninja-build \
software-properties-common apt-transport-https \
ca-certificates gnupg lsb-release unzip \
libxml2-dev ruby ruby-dev bison gawk perl make golang \
&& add-apt-repository ppa:ubuntu-toolchain-r/test \
&& apt-get update \
&& apt-get install -y gcc-13 g++-13 libgcc-13-dev libstdc++-13-dev \
libasan6 libubsan1 libatomic1 libtsan0 liblsan0 \
libgfortran5 libc6-dev \
&& wget https://apt.llvm.org/llvm.sh \
&& chmod +x llvm.sh \
&& ./llvm.sh ${LLVM_VERSION} all \
&& rm llvm.sh
RUN --mount=type=tmpfs,target=/tmp \
cmake_version="3.30.5" && \
if [ "$TARGETARCH" = "arm64" ]; then \
cmake_url="https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-linux-aarch64.sh"; \
else \
cmake_url="https://github.com/Kitware/CMake/releases/download/v${cmake_version}/cmake-${cmake_version}-linux-x86_64.sh"; \
fi && \
wget -O /tmp/cmake.sh "$cmake_url" && \
sh /tmp/cmake.sh --skip-license --prefix=/usr
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-13 130 \
--slave /usr/bin/g++ g++ /usr/bin/g++-13 \
--slave /usr/bin/gcc-ar gcc-ar /usr/bin/gcc-ar-13 \
--slave /usr/bin/gcc-nm gcc-nm /usr/bin/gcc-nm-13 \
--slave /usr/bin/gcc-ranlib gcc-ranlib /usr/bin/gcc-ranlib-13
RUN echo "ARCH_PATH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64-linux-gnu" || echo "x86_64-linux-gnu")" >> /etc/environment \
&& echo "BUN_ARCH=$([ "$TARGETARCH" = "arm64" ] && echo "aarch64" || echo "x64")" >> /etc/environment
ENV LD_LIBRARY_PATH=/usr/lib/gcc/${ARCH_PATH}/13:/usr/lib/${ARCH_PATH} \
LIBRARY_PATH=/usr/lib/gcc/${ARCH_PATH}/13:/usr/lib/${ARCH_PATH} \
CPLUS_INCLUDE_PATH=/usr/include/c++/13:/usr/include/${ARCH_PATH}/c++/13 \
C_INCLUDE_PATH=/usr/lib/gcc/${ARCH_PATH}/13/include \
CFLAGS=${DEFAULT_CFLAGS} \
CXXFLAGS="${DEFAULT_CFLAGS} ${DEFAULT_CXXFLAGS}"
RUN if [ "$TARGETARCH" = "arm64" ]; then \
export ARCH_PATH="aarch64-linux-gnu"; \
else \
export ARCH_PATH="x86_64-linux-gnu"; \
fi \
&& mkdir -p /usr/lib/gcc/${ARCH_PATH}/13 \
&& ln -sf /usr/lib/${ARCH_PATH}/libstdc++.so.6 /usr/lib/gcc/${ARCH_PATH}/13/ \
&& echo "/usr/lib/gcc/${ARCH_PATH}/13" > /etc/ld.so.conf.d/gcc-13.conf \
&& echo "/usr/lib/${ARCH_PATH}" >> /etc/ld.so.conf.d/gcc-13.conf \
&& ldconfig
RUN for f in /usr/lib/llvm-${LLVM_VERSION}/bin/*; do ln -sf "$f" /usr/bin; done \
&& ln -sf /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang \
&& ln -sf /usr/bin/clang++-${LLVM_VERSION} /usr/bin/clang++ \
&& ln -sf /usr/bin/lld-${LLVM_VERSION} /usr/bin/lld \
&& ln -sf /usr/bin/lldb-${LLVM_VERSION} /usr/bin/lldb \
&& ln -sf /usr/bin/clangd-${LLVM_VERSION} /usr/bin/clangd \
&& ln -sf /usr/bin/llvm-ar-${LLVM_VERSION} /usr/bin/llvm-ar \
&& ln -sf /usr/bin/ld.lld /usr/bin/ld \
&& ln -sf /usr/bin/clang /usr/bin/cc \
&& ln -sf /usr/bin/clang++ /usr/bin/c++
ENV CC="clang" \
CXX="clang++" \
AR="llvm-ar-${LLVM_VERSION}" \
RANLIB="llvm-ranlib-${LLVM_VERSION}" \
LD="lld-${LLVM_VERSION}"
RUN --mount=type=tmpfs,target=/tmp \
bash -c '\
set -euxo pipefail && \
source /etc/environment && \
echo "Downloading bun-v${OLD_BUN_VERSION}/bun-linux-$BUN_ARCH.zip from https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/bun-v${OLD_BUN_VERSION}/bun-linux-$BUN_ARCH.zip" && \
curl -fsSL https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/bun-v${OLD_BUN_VERSION}/bun-linux-$BUN_ARCH.zip -o /tmp/bun.zip && \
unzip /tmp/bun.zip -d /tmp/bun && \
mv /tmp/bun/*/bun /usr/bin/bun && \
chmod +x /usr/bin/bun'
ENV LLVM_VERSION=${REPORTED_LLVM_VERSION}
WORKDIR /workspace
FROM --platform=$BUILDPLATFORM base as buildkite
ARG BUILDKITE_AGENT_TAGS
# Install Rust nightly
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& export PATH=$HOME/.cargo/bin:$PATH \
&& rustup install nightly \
&& rustup default nightly
RUN ARCH=$(if [ "$TARGETARCH" = "arm64" ]; then echo "arm64"; else echo "amd64"; fi) && \
echo "Downloading buildkite" && \
curl -fsSL "https://github.com/buildkite/agent/releases/download/v3.87.0/buildkite-agent-linux-${ARCH}-3.87.0.tar.gz" -o /tmp/buildkite-agent.tar.gz && \
mkdir -p /tmp/buildkite-agent && \
tar -xzf /tmp/buildkite-agent.tar.gz -C /tmp/buildkite-agent && \
mv /tmp/buildkite-agent/buildkite-agent /usr/bin/buildkite-agent
RUN mkdir -p /var/cache/buildkite-agent /var/log/buildkite-agent /var/run/buildkite-agent /etc/buildkite-agent /var/lib/buildkite-agent/cache/bun
COPY ../*/agent.mjs /var/bun/scripts/
ENV BUN_INSTALL_CACHE=/var/lib/buildkite-agent/cache/bun
ENV BUILDKITE_AGENT_TAGS=${BUILDKITE_AGENT_TAGS}
WORKDIR /var/bun/scripts
ENV PATH=/root/.cargo/bin:$PATH
CMD ["bun", "/var/bun/scripts/agent.mjs", "start"]
FROM --platform=$BUILDPLATFORM base as bun-build-linux-local
ARG LLVM_VERSION
WORKDIR /workspace/bun
COPY . /workspace/bun
# Install Rust nightly
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \
&& export PATH=$HOME/.cargo/bin:$PATH \
&& rustup install nightly \
&& rustup default nightly
ENV PATH=/root/.cargo/bin:$PATH
ENV LLVM_VERSION=${REPORTED_LLVM_VERSION}
RUN --mount=type=tmpfs,target=/workspace/bun/build \
ls -la \
&& bun run build:release \
&& mkdir -p /target \
&& cp -r /workspace/bun/build/release/bun /target/bun

View File

@@ -0,0 +1,122 @@
#!/usr/bin/env bash
set -euo pipefail
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "error: must run as root"
exit 1
fi
# Check OS compatibility
if ! command -v dnf &> /dev/null; then
echo "error: this script requires dnf (RHEL/Fedora/CentOS)"
exit 1
fi
# Ensure /tmp/agent.mjs, /tmp/Dockerfile are present
if [ ! -f /tmp/agent.mjs ] || [ ! -f /tmp/Dockerfile ]; then
# Print each missing file
if [ ! -f /tmp/agent.mjs ]; then
echo "error: /tmp/agent.mjs is missing"
fi
if [ ! -f /tmp/Dockerfile ]; then
echo "error: /tmp/Dockerfile is missing"
fi
exit 1
fi
# Install Docker
dnf update -y
dnf install -y docker
systemctl enable docker
systemctl start docker || {
echo "error: failed to start Docker"
exit 1
}
# Create builder
docker buildx create --name builder --driver docker-container --bootstrap --use || {
echo "error: failed to create Docker buildx builder"
exit 1
}
# Set up Docker to start on boot
cat << 'EOF' > /etc/systemd/system/buildkite-agent.service
[Unit]
Description=Buildkite Docker Container
After=docker.service network-online.target
Requires=docker.service network-online.target
[Service]
TimeoutStartSec=0
Restart=always
RestartSec=5
ExecStartPre=-/usr/bin/docker stop buildkite
ExecStartPre=-/usr/bin/docker rm buildkite
ExecStart=/usr/bin/docker run \
--name buildkite \
--restart=unless-stopped \
--network host \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp:/tmp \
buildkite:latest
[Install]
WantedBy=multi-user.target
EOF
echo "Building Buildkite image"
# Clean up any previous build artifacts
rm -rf /tmp/fakebun
mkdir -p /tmp/fakebun/scripts /tmp/fakebun/.buildkite
# Copy required files
cp /tmp/agent.mjs /tmp/fakebun/scripts/ || {
echo "error: failed to copy agent.mjs"
exit 1
}
cp /tmp/Dockerfile /tmp/fakebun/.buildkite/Dockerfile || {
echo "error: failed to copy Dockerfile"
exit 1
}
cd /tmp/fakebun || {
echo "error: failed to change directory"
exit 1
}
# Build the Buildkite image
docker buildx build \
--platform $(uname -m | sed 's/aarch64/linux\/arm64/;s/x86_64/linux\/amd64/') \
--tag buildkite:latest \
--target buildkite \
-f .buildkite/Dockerfile \
--load \
. || {
echo "error: Docker build failed"
exit 1
}
# Create container to ensure image is cached in AMI
docker container create \
--name buildkite \
--restart=unless-stopped \
buildkite:latest || {
echo "error: failed to create buildkite container"
exit 1
}
# Reload systemd to pick up new service
systemctl daemon-reload
# Enable the service, but don't start it yet
systemctl enable buildkite-agent || {
echo "error: failed to enable buildkite-agent service"
exit 1
}
echo "Bootstrap complete"
echo "To start the Buildkite agent, run: "
echo " systemctl start buildkite-agent"

View File

@@ -13,19 +13,4 @@ steps:
agents:
queue: "build-darwin"
command:
- ".buildkite/scripts/prepare-build.sh"
- if: "build.branch == 'main' && !build.pull_request.repository.fork"
label: ":github:"
agents:
queue: "test-darwin"
depends_on:
- "darwin-aarch64-build-bun"
- "darwin-x64-build-bun"
- "linux-aarch64-build-bun"
- "linux-x64-build-bun"
- "linux-x64-baseline-build-bun"
- "windows-x64-build-bun"
- "windows-x64-baseline-build-bun"
command:
- ".buildkite/scripts/upload-release.sh"
- "node .buildkite/ci.mjs"

View File

@@ -1,63 +0,0 @@
## CI
How does CI work?
### Building
Bun is built on macOS, Linux, and Windows. The process is split into the following steps, the first 3 of which are able to run in parallel:
#### 1. `build-deps`
Builds the static libaries in `src/deps` and outputs a directory: `build/bun-deps`.
- on Windows, this runs the script: [`scripts/all-dependencies.ps1`](scripts/all-dependencies.ps1)
- on macOS and Linux, this runs the script: [`scripts/all-dependencies.sh`](scripts/all-dependencies.sh)
#### 2. `build-zig`
Builds the Zig object file: `build/bun-zig.o`. Since `zig build` supports cross-compiling, this step is run on macOS aarch64 since we have observed it to be the fastest.
- on macOS and Linux, this runs the script: [`scripts/build-bun-zig.sh`](scripts/build-bun-zig.sh)
#### 3. `build-cpp`
Builds the C++ object file: `build/bun-cpp-objects.a`.
- on Windows, this runs the script: [`scripts/build-bun-cpp.ps1`](scripts/build-bun-cpp.ps1)
- on macOS and Linux, this runs the script: [`scripts/build-bun-cpp.sh`](scripts/build-bun-cpp.sh)
#### 4. `link` / `build-bun`
After the `build-deps`, `build-zig`, and `build-cpp` steps have completed, this step links the Zig object file and C++ object file into a single binary: `bun-<os>-<arch>.zip`.
- on Windows, this runs the script: [`scripts/buildkite-link-bun.ps1`](scripts/buildkite-link-bun.ps1)
- on macOS and Linux, this runs the script: [`scripts/buildkite-link-bun.sh`](scripts/buildkite-link-bun.sh)
To speed up the build, thare are two options:
- `--fast`: This disables the LTO (link-time optimization) step.
- without `--fast`: This runs the LTO step, which is the default. The binaries that are release to Github are always built with LTO.
### Testing
### FAQ
> How do I add a new CI agent?
> How do I add/modify system dependencies?
> How do I SSH into a CI agent?
### Known issues
These are things that we know about, but haven't fixed or optimized yet.
- There is no `scripts/build-bun-zig.ps1` for Windows.
- The `build-deps` step does not cache in CI, so it re-builds each time (though it does use ccache). It attempts to check the `BUN_DEPS_CACHE_DIR` environment variable, but for some reason it doesn't work.
- Windows and Linux machines sometimes take up to 1-2 minutes to start tests. This is because robobun is listening for when the job is scheduled to provision the VM. Instead, it can start provisioning during the link step, or keep a pool of idle VMs around (but it's unclear how more expensive this is).
- There are a limited number of macOS VMs. This is because they are expensive and manually provisioned, mostly through MacStadium. If wait times are too long we can just provision more, or buy some.
- To prevent idle machines, robobun periodically checks for idle machines and terminates them. Before doing this, it checks to see if the machine is connected as an agent to Buildkite. However, sometimes the machine picks up a job in-between this time, and the job is terminated.

1156
.buildkite/ci.mjs Executable file

File diff suppressed because it is too large Load Diff

View File

@@ -1,782 +0,0 @@
# Build and test Bun on macOS, Linux, and Windows.
# https://buildkite.com/docs/pipelines/defining-steps
#
# If a step has the `robobun: true` label, robobun will listen
# to webhooks from Buildkite and provision a VM to run the step.
#
# Changes to this file will be automatically uploaded on the next run
# for a particular commit.
#
# Future tests machines to be added:
# - macOS 12
# - Windows Server 2016 & 2019
# - Amazon Linux 2 & 2023
# - CentOS / RHEL / Fedora / other Linux distros
# - Docker containers
# - Rasberry Pi?
steps:
# macOS aarch64
- key: "darwin-aarch64"
group: ":darwin: aarch64"
steps:
- key: "darwin-aarch64-build-deps"
label: ":darwin: aarch64 - build-deps"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-deps.sh"
- key: "darwin-aarch64-build-zig"
label: ":darwin: aarch64 - build-zig"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-zig.sh darwin aarch64"
- key: "darwin-aarch64-build-cpp"
label: ":darwin: aarch64 - build-cpp"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-cpp.sh"
- key: "darwin-aarch64-build-bun"
label: ":darwin: aarch64 - build-bun"
depends_on:
- "darwin-aarch64-build-deps"
- "darwin-aarch64-build-zig"
- "darwin-aarch64-build-cpp"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-bun.sh"
- key: "darwin-aarch64-test-macos-14"
label: ":darwin: 14 aarch64 - test-bun"
if: "build.branch != 'main'"
parallelism: 3
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "darwin-aarch64-build-bun"
agents:
queue: "test-darwin"
os: "darwin"
arch: "aarch64"
release: "14"
command:
- "./scripts/runner.node.mjs --step darwin-aarch64-build-bun"
- key: "darwin-aarch64-test-macos-13"
label: ":darwin: 13 aarch64 - test-bun"
if: "build.branch != 'main'"
parallelism: 3
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "darwin-aarch64-build-bun"
agents:
queue: "test-darwin"
os: "darwin"
arch: "aarch64"
release: "13"
command:
- "./scripts/runner.node.mjs --step darwin-aarch64-build-bun"
# macOS x64
- key: "darwin-x64"
group: ":darwin: x64"
steps:
- key: "darwin-x64-build-deps"
label: ":darwin: x64 - build-deps"
agents:
queue: "build-darwin"
os: "darwin"
arch: "x64"
command:
- "./.buildkite/scripts/build-deps.sh"
- key: "darwin-x64-build-zig"
label: ":darwin: x64 - build-zig"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-zig.sh darwin x64"
- key: "darwin-x64-build-cpp"
label: ":darwin: x64 - build-cpp"
agents:
queue: "build-darwin"
os: "darwin"
arch: "x64"
command:
- "./.buildkite/scripts/build-cpp.sh"
- key: "darwin-x64-build-bun"
label: ":darwin: x64 - build-bun"
depends_on:
- "darwin-x64-build-deps"
- "darwin-x64-build-zig"
- "darwin-x64-build-cpp"
agents:
queue: "build-darwin"
os: "darwin"
arch: "x64"
command:
- "./.buildkite/scripts/build-bun.sh"
- key: "darwin-x64-test-macos-14"
label: ":darwin: 14 x64 - test-bun"
if: "build.branch != 'main'"
parallelism: 2
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "darwin-x64-build-bun"
agents:
queue: "test-darwin"
os: "darwin"
arch: "x64"
release: "14"
command:
- "./scripts/runner.node.mjs --step darwin-x64-build-bun"
- key: "darwin-x64-test-macos-13"
label: ":darwin: 13 x64 - test-bun"
if: "build.branch != 'main'"
parallelism: 2
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "darwin-x64-build-bun"
agents:
queue: "test-darwin"
os: "darwin"
arch: "x64"
release: "13"
command:
- "./scripts/runner.node.mjs --step darwin-x64-build-bun"
# Linux aarch64
- key: "linux-aarch64"
group: ":linux: aarch64"
steps:
- key: "linux-aarch64-build-deps"
label: ":linux: aarch64 - build-deps"
agents:
queue: "build-linux"
os: "linux"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-deps.sh"
- key: "linux-aarch64-build-zig"
label: ":linux: aarch64 - build-zig"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-zig.sh linux aarch64"
- key: "linux-aarch64-build-cpp"
label: ":linux: aarch64 - build-cpp"
agents:
queue: "build-linux"
os: "linux"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-cpp.sh"
- key: "linux-aarch64-build-bun"
label: ":linux: aarch64 - build-bun"
depends_on:
- "linux-aarch64-build-deps"
- "linux-aarch64-build-zig"
- "linux-aarch64-build-cpp"
agents:
queue: "build-linux"
os: "linux"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-bun.sh"
- key: "linux-aarch64-test-debian-12"
label: ":debian: 12 aarch64 - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-aarch64-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "aarch64"
distro: "debian"
release: "12"
command:
- "./scripts/runner.node.mjs --step linux-aarch64-build-bun"
- key: "linux-aarch64-test-ubuntu-2204"
label: ":ubuntu: 22.04 aarch64 - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-aarch64-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "aarch64"
distro: "ubuntu"
release: "22.04"
command:
- "./scripts/runner.node.mjs --step linux-aarch64-build-bun"
- key: "linux-aarch64-test-ubuntu-2004"
label: ":ubuntu: 20.04 aarch64 - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-aarch64-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "aarch64"
distro: "ubuntu"
release: "20.04"
command:
- "./scripts/runner.node.mjs --step linux-aarch64-build-bun"
# Linux x64
- key: "linux-x64"
group: ":linux: x64"
steps:
- key: "linux-x64-build-deps"
label: ":linux: x64 - build-deps"
agents:
queue: "build-linux"
os: "linux"
arch: "x64"
command:
- "./.buildkite/scripts/build-deps.sh"
- key: "linux-x64-build-zig"
label: ":linux: x64 - build-zig"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-zig.sh linux x64"
- key: "linux-x64-build-cpp"
label: ":linux: x64 - build-cpp"
agents:
queue: "build-linux"
os: "linux"
arch: "x64"
command:
- "./.buildkite/scripts/build-cpp.sh"
- key: "linux-x64-build-bun"
label: ":linux: x64 - build-bun"
depends_on:
- "linux-x64-build-deps"
- "linux-x64-build-zig"
- "linux-x64-build-cpp"
agents:
queue: "build-linux"
os: "linux"
arch: "x64"
command:
- "./.buildkite/scripts/build-bun.sh"
- key: "linux-x64-test-debian-12"
label: ":debian: 12 x64 - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-x64-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "x64"
distro: "debian"
release: "12"
command:
- "./scripts/runner.node.mjs --step linux-x64-build-bun"
- key: "linux-x64-test-ubuntu-2204"
label: ":ubuntu: 22.04 x64 - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-x64-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "x64"
distro: "ubuntu"
release: "22.04"
command:
- "./scripts/runner.node.mjs --step linux-x64-build-bun"
- key: "linux-x64-test-ubuntu-2004"
label: ":ubuntu: 20.04 x64 - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-x64-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "x64"
distro: "ubuntu"
release: "20.04"
command:
- "./scripts/runner.node.mjs --step linux-x64-build-bun"
# Linux x64-baseline
- key: "linux-x64-baseline"
group: ":linux: x64-baseline"
steps:
- key: "linux-x64-baseline-build-deps"
label: ":linux: x64-baseline - build-deps"
agents:
queue: "build-linux"
os: "linux"
arch: "x64"
command:
- "./.buildkite/scripts/build-deps.sh"
- key: "linux-x64-baseline-build-zig"
label: ":linux: x64-baseline - build-zig"
agents:
queue: "build-darwin"
os: "darwin"
arch: "aarch64"
command:
- "./.buildkite/scripts/build-zig.sh linux x64"
- key: "linux-x64-baseline-build-cpp"
label: ":linux: x64-baseline - build-cpp"
agents:
queue: "build-linux"
os: "linux"
arch: "x64"
command:
- "./.buildkite/scripts/build-cpp.sh"
- key: "linux-x64-baseline-build-bun"
label: ":linux: x64-baseline - build-bun"
depends_on:
- "linux-x64-baseline-build-deps"
- "linux-x64-baseline-build-zig"
- "linux-x64-baseline-build-cpp"
agents:
queue: "build-linux"
os: "linux"
arch: "x64"
command:
- "./.buildkite/scripts/build-bun.sh"
- key: "linux-x64-baseline-test-debian-12"
label: ":debian: 12 x64-baseline - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-x64-baseline-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "x64"
distro: "debian"
release: "12"
command:
- "./scripts/runner.node.mjs --step linux-x64-baseline-build-bun"
- key: "linux-x64-baseline-test-ubuntu-2204"
label: ":ubuntu: 22.04 x64-baseline - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-x64-baseline-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "x64"
distro: "ubuntu"
release: "22.04"
command:
- "./scripts/runner.node.mjs --step linux-x64-baseline-build-bun"
- key: "linux-x64-baseline-test-ubuntu-2004"
label: ":ubuntu: 20.04 x64-baseline - test-bun"
if: "build.branch != 'main'"
parallelism: 5
soft_fail:
- exit_status: 2
retry:
automatic:
- exit_status: 1
limit: 1
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "linux-x64-baseline-build-bun"
agents:
robobun: "true"
os: "linux"
arch: "x64"
distro: "ubuntu"
release: "20.04"
command:
- "./scripts/runner.node.mjs --step linux-x64-baseline-build-bun"
# Windows x64
- key: "windows-x64"
group: ":windows: x64"
steps:
- key: "windows-x64-build-deps"
label: ":windows: x64 - build-deps"
agents:
queue: "build-windows"
os: "windows"
arch: "x64"
artifact_paths:
- "build\\bun-deps\\*.lib"
env:
CCACHE_DISABLE: "1"
command:
- ".\\scripts\\all-dependencies.ps1"
- key: "windows-x64-build-zig"
label: ":windows: x64 - build-zig"
agents:
queue: "build-darwin"
os: "darwin" # cross-compile on Linux or Darwin
arch: "aarch64"
command:
- "./.buildkite/scripts/build-zig.sh windows x64"
- key: "windows-x64-build-cpp"
label: ":windows: x64 - build-cpp"
agents:
queue: "build-windows"
os: "windows"
arch: "x64"
artifact_paths:
# HACK: See scripts/build-bun-cpp.ps1
# - "build\\bun-cpp-objects.a"
- "build\\bun-cpp-objects.a.*"
env:
CCACHE_DISABLE: "1"
command:
- ".\\scripts\\build-bun-cpp.ps1"
- key: "windows-x64-build-bun"
label: ":windows: x64 - build-bun"
depends_on:
- "windows-x64-build-deps"
- "windows-x64-build-zig"
- "windows-x64-build-cpp"
agents:
queue: "build-windows"
os: "windows"
arch: "x64"
artifact_paths:
- "bun-windows-x64.zip"
- "bun-windows-x64-profile.zip"
- "features.json"
env:
CCACHE_DISABLE: "1"
command:
- ".\\scripts\\buildkite-link-bun.ps1"
- key: "windows-x64-test-bun"
label: ":windows: x64 - test-bun"
if: "build.branch != 'main'"
parallelism: 10
soft_fail:
- exit_status: 1
retry:
automatic:
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "windows-x64-build-bun"
agents:
robobun: "true"
os: "windows"
arch: "x64"
command:
- "node .\\scripts\\runner.node.mjs --step windows-x64-build-bun"
# Windows x64-baseline
- key: "windows-x64-baseline"
group: ":windows: x64-baseline"
steps:
- key: "windows-x64-baseline-build-deps"
label: ":windows: x64-baseline - build-deps"
agents:
queue: "build-windows"
os: "windows"
arch: "x64"
artifact_paths:
- "build\\bun-deps\\*.lib"
env:
CCACHE_DISABLE: "1"
USE_BASELINE_BUILD: "1"
command:
- ".\\scripts\\all-dependencies.ps1"
- key: "windows-x64-baseline-build-zig"
label: ":windows: x64-baseline - build-zig"
agents:
queue: "build-darwin"
os: "darwin" # cross-compile on Linux or Darwin
arch: "aarch64"
command:
- "./.buildkite/scripts/build-zig.sh windows x64"
- key: "windows-x64-baseline-build-cpp"
label: ":windows: x64-baseline - build-cpp"
agents:
queue: "build-windows"
os: "windows"
arch: "x64"
artifact_paths:
# HACK: See scripts/build-bun-cpp.ps1
# - "build\\bun-cpp-objects.a"
- "build\\bun-cpp-objects.a.*"
env:
CCACHE_DISABLE: "1"
USE_BASELINE_BUILD: "1"
command:
- ".\\scripts\\build-bun-cpp.ps1"
- key: "windows-x64-baseline-build-bun"
label: ":windows: x64-baseline - build-bun"
depends_on:
- "windows-x64-baseline-build-deps"
- "windows-x64-baseline-build-zig"
- "windows-x64-baseline-build-cpp"
agents:
queue: "build-windows"
os: "windows"
arch: "x64"
artifact_paths:
- "bun-windows-x64-baseline.zip"
- "bun-windows-x64-baseline-profile.zip"
- "features.json"
env:
CCACHE_DISABLE: "1"
USE_BASELINE_BUILD: "1"
command:
- ".\\scripts\\buildkite-link-bun.ps1 -Baseline $$True"
- key: "windows-x64-baseline-test-bun"
label: ":windows: x64-baseline - test-bun"
if: "build.branch != 'main'"
parallelism: 10
soft_fail:
- exit_status: 1
retry:
automatic:
- exit_status: -1
limit: 3
- exit_status: 255
limit: 3
- signal_reason: agent_stop
limit: 3
- signal: SIGTERM
limit: 3
depends_on:
- "windows-x64-baseline-build-bun"
agents:
robobun: "true"
os: "windows"
arch: "x64"
command:
- "node .\\scripts\\runner.node.mjs --step windows-x64-baseline-build-bun"

View File

@@ -1,55 +0,0 @@
#!/bin/bash
set -eo pipefail
source "$(dirname "$0")/env.sh"
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
cwd="$(pwd)"
mkdir -p build
source "$(dirname "$0")/download-artifact.sh" "build/bun-deps/**" --step "$BUILDKITE_GROUP_KEY-build-deps"
source "$(dirname "$0")/download-artifact.sh" "build/bun-zig.o" --step "$BUILDKITE_GROUP_KEY-build-zig"
source "$(dirname "$0")/download-artifact.sh" "build/bun-cpp-objects.a" --step "$BUILDKITE_GROUP_KEY-build-cpp" --split
cd build
run_command cmake .. "${CMAKE_FLAGS[@]}" \
-GNinja \
-DBUN_LINK_ONLY="1" \
-DNO_CONFIGURE_DEPENDS="1" \
-DBUN_ZIG_OBJ_DIR="$cwd/build" \
-DBUN_CPP_ARCHIVE="$cwd/build/bun-cpp-objects.a" \
-DBUN_DEPS_OUT_DIR="$cwd/build/bun-deps" \
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
-DCPU_TARGET="$CPU_TARGET" \
-DUSE_LTO="$USE_LTO" \
-DUSE_DEBUG_JSC="$USE_DEBUG_JSC" \
-DCANARY="$CANARY" \
-DGIT_SHA="$GIT_SHA"
run_command ninja -v -j "$CPUS"
run_command ls
tag="bun-$BUILDKITE_GROUP_KEY"
if [ "$USE_LTO" == "OFF" ]; then
# Remove OS check when LTO is enabled on macOS again
if [[ "$tag" == *"darwin"* ]]; then
tag="$tag-nolto"
fi
fi
for name in bun bun-profile; do
dir="$tag"
if [ "$name" == "bun-profile" ]; then
dir="$tag-profile"
fi
run_command chmod +x "$name"
run_command "./$name" --revision
run_command mkdir -p "$dir"
run_command mv "$name" "$dir/$name"
run_command zip -r "$dir.zip" "$dir"
source "$cwd/.buildkite/scripts/upload-artifact.sh" "$dir.zip"
done

View File

@@ -1,35 +0,0 @@
#!/bin/bash
set -eo pipefail
source "$(dirname "$0")/env.sh"
export FORCE_UPDATE_SUBMODULES=1
source "$(realpath $(dirname "$0")/../../scripts/update-submodules.sh)"
{ set +x; } 2>/dev/null
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
mkdir -p build
cd build
mkdir -p tmp_modules tmp_functions js codegen
run_command cmake .. "${CMAKE_FLAGS[@]}" \
-GNinja \
-DBUN_CPP_ONLY="1" \
-DNO_CONFIGURE_DEPENDS="1" \
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
-DCPU_TARGET="$CPU_TARGET" \
-DUSE_LTO="$USE_LTO" \
-DUSE_DEBUG_JSC="$USE_DEBUG_JSC" \
-DCANARY="$CANARY" \
-DGIT_SHA="$GIT_SHA"
chmod +x compile-cpp-only.sh
source compile-cpp-only.sh -v -j "$CPUS"
{ set +x; } 2>/dev/null
cd ..
source "$(dirname "$0")/upload-artifact.sh" "build/bun-cpp-objects.a" --split

View File

@@ -1,22 +0,0 @@
#!/bin/bash
set -eo pipefail
source "$(dirname "$0")/env.sh"
source "$(realpath $(dirname "$0")/../../scripts/all-dependencies.sh)"
artifacts=(
libcrypto.a libssl.a libdecrepit.a
libcares.a
libarchive.a
liblolhtml.a
libmimalloc.a libmimalloc.o
libtcc.a
libz.a
libzstd.a
libdeflate.a
liblshpack.a
)
for artifact in "${artifacts[@]}"; do
source "$(dirname "$0")/upload-artifact.sh" "build/bun-deps/$artifact"
done

View File

@@ -1,40 +0,0 @@
#!/bin/bash
set -eo pipefail
source "$(dirname "$0")/env.sh"
function assert_bun() {
if ! command -v bun &>/dev/null; then
echo "error: bun is not installed" 1>&2
exit 1
fi
}
function assert_make() {
if ! command -v make &>/dev/null; then
echo "error: make is not installed" 1>&2
exit 1
fi
}
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
function build_node_fallbacks() {
local cwd="src/node-fallbacks"
run_command bun install --cwd "$cwd" --frozen-lockfile
run_command bun run --cwd "$cwd" build
}
function build_old_js() {
run_command bun install --frozen-lockfile
run_command make runtime_js fallback_decoder bun_error
}
assert_bun
assert_make
build_node_fallbacks
build_old_js

View File

@@ -1,80 +0,0 @@
#!/bin/bash
set -eo pipefail
source "$(dirname "$0")/env.sh"
function assert_target() {
local arch="${2-$(uname -m)}"
case "$(echo "$arch" | tr '[:upper:]' '[:lower:]')" in
x64 | x86_64 | amd64)
export ZIG_ARCH="x86_64"
if [[ "$BUILDKITE_STEP_KEY" == *"baseline"* ]]; then
export ZIG_CPU_TARGET="nehalem"
else
export ZIG_CPU_TARGET="haswell"
fi
;;
aarch64 | arm64)
export ZIG_ARCH="aarch64"
export ZIG_CPU_TARGET="native"
;;
*)
echo "error: Unsupported architecture: $arch" 1>&2
exit 1
;;
esac
local os="${1-$(uname -s)}"
case "$(echo "$os" | tr '[:upper:]' '[:lower:]')" in
linux)
export ZIG_TARGET="$ZIG_ARCH-linux-gnu" ;;
darwin)
export ZIG_TARGET="$ZIG_ARCH-macos-none" ;;
windows)
export ZIG_TARGET="$ZIG_ARCH-windows-msvc" ;;
*)
echo "error: Unsupported operating system: $os" 1>&2
exit 1
;;
esac
}
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
assert_target "$@"
# Since the zig build depends on files from the zig submodule,
# make sure to update the submodule before building.
run_command git submodule update --init --recursive --progress --depth=1 --checkout src/deps/zig
# TODO: Move these to be part of the CMake build
source "$(dirname "$0")/build-old-js.sh"
cwd="$(pwd)"
mkdir -p build
cd build
run_command cmake .. "${CMAKE_FLAGS[@]}" \
-GNinja \
-DNO_CONFIGURE_DEPENDS="1" \
-DNO_CODEGEN="0" \
-DWEBKIT_DIR="omit" \
-DBUN_ZIG_OBJ_DIR="$cwd/build" \
-DZIG_LIB_DIR="$cwd/src/deps/zig/lib" \
-DCMAKE_BUILD_TYPE="$CMAKE_BUILD_TYPE" \
-DARCH="$ZIG_ARCH" \
-DCPU_TARGET="$ZIG_CPU_TARGET" \
-DZIG_TARGET="$ZIG_TARGET" \
-DUSE_LTO="$USE_LTO" \
-DUSE_DEBUG_JSC="$USE_DEBUG_JSC" \
-DCANARY="$CANARY" \
-DGIT_SHA="$GIT_SHA"
export ONLY_ZIG="1"
run_command ninja "$cwd/build/bun-zig.o" -v -j "$CPUS"
cd ..
source "$(dirname "$0")/upload-artifact.sh" "build/bun-zig.o"

View File

@@ -1,47 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string[]] $Paths,
[switch] $Split
)
$ErrorActionPreference = "Stop"
function Assert-Buildkite-Agent() {
if (-not (Get-Command "buildkite-agent" -ErrorAction SilentlyContinue)) {
Write-Error "Cannot find buildkite-agent, please install it: https://buildkite.com/docs/agent/v3/install"
exit 1
}
}
function Assert-Join-File() {
if (-not (Get-Command "Join-File" -ErrorAction SilentlyContinue)) {
Write-Error "Cannot find Join-File, please install it: https://www.powershellgallery.com/packages/FileSplitter/1.3"
exit 1
}
}
function Download-Buildkite-Artifact() {
param (
[Parameter(Mandatory=$true)]
[string] $Path,
)
if ($Split) {
& buildkite-agent artifact download "$Path.*" --debug --debug-http
Join-File -Path "$(Resolve-Path .)\$Path" -Verbose -DeletePartFiles
} else {
& buildkite-agent artifact download "$Path" --debug --debug-http
}
if (-not (Test-Path $Path)) {
Write-Error "Could not find artifact: $Path"
exit 1
}
}
Assert-Buildkite-Agent
if ($Split) {
Assert-Join-File
}
foreach ($Path in $Paths) {
Download-Buildkite-Artifact $Path
}

View File

@@ -1,46 +0,0 @@
#!/bin/bash
set -eo pipefail
function assert_buildkite_agent() {
if ! command -v buildkite-agent &> /dev/null; then
echo "error: Cannot find buildkite-agent, please install it:"
echo "https://buildkite.com/docs/agent/v3/install"
exit 1
fi
}
function download_buildkite_artifact() {
local path="$1"; shift
local split="0"
local args=()
while true; do
if [ -z "$1" ]; then
break
fi
case "$1" in
--split) split="1"; shift ;;
*) args+=("$1"); shift ;;
esac
done
if [ "$split" == "1" ]; then
run_command buildkite-agent artifact download "$path.*" . "${args[@]}"
run_command cat $path.?? > "$path"
run_command rm -f $path.??
else
run_command buildkite-agent artifact download "$path" . "${args[@]}"
fi
if [[ "$path" != *"*"* ]] && [ ! -f "$path" ]; then
echo "error: Could not find artifact: $path"
exit 1
fi
}
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
assert_buildkite_agent
download_buildkite_artifact "$@"

View File

@@ -1,120 +0,0 @@
#!/bin/bash
set -eo pipefail
function assert_os() {
local os="$(uname -s)"
case "$os" in
Linux)
echo "linux" ;;
Darwin)
echo "darwin" ;;
*)
echo "error: Unsupported operating system: $os" 1>&2
exit 1
;;
esac
}
function assert_arch() {
local arch="$(uname -m)"
case "$arch" in
aarch64 | arm64)
echo "aarch64" ;;
x86_64 | amd64)
echo "x64" ;;
*)
echo "error: Unknown architecture: $arch" 1>&2
exit 1
;;
esac
}
function assert_build() {
if [ -z "$BUILDKITE_REPO" ]; then
echo "error: Cannot find repository for this build"
exit 1
fi
if [ -z "$BUILDKITE_COMMIT" ]; then
echo "error: Cannot find commit for this build"
exit 1
fi
if [ -z "$BUILDKITE_STEP_KEY" ]; then
echo "error: Cannot find step key for this build"
exit 1
fi
if [ -n "$BUILDKITE_GROUP_KEY" ] && [[ "$BUILDKITE_STEP_KEY" != "$BUILDKITE_GROUP_KEY"* ]]; then
echo "error: Build step '$BUILDKITE_STEP_KEY' does not start with group key '$BUILDKITE_GROUP_KEY'"
exit 1
fi
# Skip os and arch checks for Zig, since it's cross-compiled on macOS
if [[ "$BUILDKITE_STEP_KEY" != *"zig"* ]]; then
local os="$(assert_os)"
if [[ "$BUILDKITE_STEP_KEY" != *"$os"* ]]; then
echo "error: Build step '$BUILDKITE_STEP_KEY' does not match operating system '$os'"
exit 1
fi
local arch="$(assert_arch)"
if [[ "$BUILDKITE_STEP_KEY" != *"$arch"* ]]; then
echo "error: Build step '$BUILDKITE_STEP_KEY' does not match architecture '$arch'"
exit 1
fi
fi
}
function assert_buildkite_agent() {
if ! command -v buildkite-agent &> /dev/null; then
echo "error: Cannot find buildkite-agent, please install it:"
echo "https://buildkite.com/docs/agent/v3/install"
exit 1
fi
}
function export_environment() {
source "$(realpath $(dirname "$0")/../../scripts/env.sh)"
source "$(realpath $(dirname "$0")/../../scripts/update-submodules.sh)"
{ set +x; } 2>/dev/null
export GIT_SHA="$BUILDKITE_COMMIT"
export CCACHE_DIR="$HOME/.cache/ccache/$BUILDKITE_STEP_KEY"
export SCCACHE_DIR="$HOME/.cache/sccache/$BUILDKITE_STEP_KEY"
export ZIG_LOCAL_CACHE_DIR="$HOME/.cache/zig-cache/$BUILDKITE_STEP_KEY"
export ZIG_GLOBAL_CACHE_DIR="$HOME/.cache/zig-cache/$BUILDKITE_STEP_KEY"
export BUN_DEPS_CACHE_DIR="$HOME/.cache/bun-deps/$BUILDKITE_STEP_KEY"
if [ "$(assert_os)" == "linux" ]; then
export USE_LTO="ON"
fi
if [ "$(assert_arch)" == "aarch64" ]; then
export CPU_TARGET="native"
elif [[ "$BUILDKITE_STEP_KEY" == *"baseline"* ]]; then
export CPU_TARGET="nehalem"
else
export CPU_TARGET="haswell"
fi
if $(buildkite-agent meta-data exists release &> /dev/null); then
export CMAKE_BUILD_TYPE="$(buildkite-agent meta-data get release)"
else
export CMAKE_BUILD_TYPE="Release"
fi
if $(buildkite-agent meta-data exists canary &> /dev/null); then
export CANARY="$(buildkite-agent meta-data get canary)"
else
export CANARY="1"
fi
if $(buildkite-agent meta-data exists assertions &> /dev/null); then
export USE_DEBUG_JSC="$(buildkite-agent meta-data get assertions)"
else
export USE_DEBUG_JSC="OFF"
fi
if [ "$BUILDKITE_CLEAN_CHECKOUT" == "true" || "$BUILDKITE_BRANCH" == "main" ]; then
rm -rf "$CCACHE_DIR"
rm -rf "$SCCACHE_DIR"
rm -rf "$ZIG_LOCAL_CACHE_DIR"
rm -rf "$ZIG_GLOBAL_CACHE_DIR"
rm -rf "$BUN_DEPS_CACHE_DIR"
export CCACHE_RECACHE="1"
fi
}
assert_build
assert_buildkite_agent
export_environment

View File

@@ -1,97 +0,0 @@
#!/bin/bash
set -eo pipefail
function assert_build() {
if [ -z "$BUILDKITE_REPO" ]; then
echo "error: Cannot find repository for this build"
exit 1
fi
if [ -z "$BUILDKITE_COMMIT" ]; then
echo "error: Cannot find commit for this build"
exit 1
fi
}
function assert_buildkite_agent() {
if ! command -v buildkite-agent &> /dev/null; then
echo "error: Cannot find buildkite-agent, please install it:"
echo "https://buildkite.com/docs/agent/v3/install"
exit 1
fi
}
function assert_jq() {
assert_command "jq" "jq" "https://stedolan.github.io/jq/"
}
function assert_curl() {
assert_command "curl" "curl" "https://curl.se/download.html"
}
function assert_command() {
local command="$1"
local package="$2"
local help_url="$3"
if ! command -v "$command" &> /dev/null; then
echo "warning: $command is not installed, installing..."
if command -v brew &> /dev/null; then
HOMEBREW_NO_AUTO_UPDATE=1 brew install "$package"
else
echo "error: Cannot install $command, please install it"
if [ -n "$help_url" ]; then
echo ""
echo "hint: See $help_url for help"
fi
exit 1
fi
fi
}
function assert_release() {
if [ "$RELEASE" == "1" ]; then
run_command buildkite-agent meta-data set canary "0"
fi
}
function assert_canary() {
local canary="$(buildkite-agent meta-data get canary 2>/dev/null)"
if [ -z "$canary" ]; then
local repo=$(echo "$BUILDKITE_REPO" | sed -E 's#https://github.com/([^/]+)/([^/]+).git#\1/\2#g')
local tag="$(curl -sL "https://api.github.com/repos/$repo/releases/latest" | jq -r ".tag_name")"
if [ "$tag" == "null" ]; then
canary="1"
else
local revision=$(curl -sL "https://api.github.com/repos/$repo/compare/$tag...$BUILDKITE_COMMIT" | jq -r ".ahead_by")
if [ "$revision" == "null" ]; then
canary="1"
else
canary="$revision"
fi
fi
run_command buildkite-agent meta-data set canary "$canary"
fi
}
function upload_buildkite_pipeline() {
local path="$1"
if [ ! -f "$path" ]; then
echo "error: Cannot find pipeline: $path"
exit 1
fi
run_command buildkite-agent pipeline upload "$path"
}
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
assert_build
assert_buildkite_agent
assert_jq
assert_curl
assert_release
assert_canary
upload_buildkite_pipeline ".buildkite/ci.yml"

View File

@@ -1,47 +0,0 @@
param (
[Parameter(Mandatory=$true)]
[string[]] $Paths,
[switch] $Split
)
$ErrorActionPreference = "Stop"
function Assert-Buildkite-Agent() {
if (-not (Get-Command "buildkite-agent" -ErrorAction SilentlyContinue)) {
Write-Error "Cannot find buildkite-agent, please install it: https://buildkite.com/docs/agent/v3/install"
exit 1
}
}
function Assert-Split-File() {
if (-not (Get-Command "Split-File" -ErrorAction SilentlyContinue)) {
Write-Error "Cannot find Split-File, please install it: https://www.powershellgallery.com/packages/FileSplitter/1.3"
exit 1
}
}
function Upload-Buildkite-Artifact() {
param (
[Parameter(Mandatory=$true)]
[string] $Path,
)
if (-not (Test-Path $Path)) {
Write-Error "Could not find artifact: $Path"
exit 1
}
if ($Split) {
Remove-Item -Path "$Path.*" -Force
Split-File -Path (Resolve-Path $Path) -PartSizeBytes "50MB" -Verbose
$Path = "$Path.*"
}
& buildkite-agent artifact upload "$Path" --debug --debug-http
}
Assert-Buildkite-Agent
if ($Split) {
Assert-Split-File
}
foreach ($Path in $Paths) {
Upload-Buildkite-Artifact $Path
}

View File

@@ -1,54 +0,0 @@
#!/bin/bash
set -eo pipefail
function assert_buildkite_agent() {
if ! command -v buildkite-agent &> /dev/null; then
echo "error: Cannot find buildkite-agent, please install it:"
echo "https://buildkite.com/docs/agent/v3/install"
exit 1
fi
}
function assert_split() {
if ! command -v split &> /dev/null; then
echo "error: Cannot find split, please install it:"
echo "https://www.gnu.org/software/coreutils/split"
exit 1
fi
}
function upload_buildkite_artifact() {
local path="$1"; shift
local split="0"
local args=()
while true; do
if [ -z "$1" ]; then
break
fi
case "$1" in
--split) split="1"; shift ;;
*) args+=("$1"); shift ;;
esac
done
if [ ! -f "$path" ]; then
echo "error: Could not find artifact: $path"
exit 1
fi
if [ "$split" == "1" ]; then
run_command rm -f "$path."*
run_command split -b 50MB -d "$path" "$path."
run_command buildkite-agent artifact upload "$path.*" "${args[@]}"
else
run_command buildkite-agent artifact upload "$path" "${args[@]}"
fi
}
function run_command() {
set -x
"$@"
{ set +x; } 2>/dev/null
}
assert_buildkite_agent
upload_buildkite_artifact "$@"

View File

@@ -146,6 +146,7 @@ function update_github_release() {
local version="$1"
local tag="$(release_tag "$version")"
if [ "$tag" == "canary" ]; then
sleep 5 # There is possibly a race condition where this overwrites artifacts?
run_command gh release edit "$tag" --repo "$BUILDKITE_REPO" \
--notes "This release of Bun corresponds to the commit: $BUILDKITE_COMMIT"
fi
@@ -157,6 +158,27 @@ function upload_s3_file() {
run_command aws --endpoint-url="$AWS_ENDPOINT" s3 cp "$file" "s3://$AWS_BUCKET/$folder/$file"
}
function send_bench_webhook() {
if [ -z "$BENCHMARK_URL" ]; then
echo "error: \$BENCHMARK_URL is not set"
# exit 1 # TODO: this isn't live yet
return
fi
local tag="$1"
local commit="$BUILDKITE_COMMIT"
local artifact_path="${commit}"
if [ "$tag" == "canary" ]; then
artifact_path="${commit}-canary"
fi
local artifact_url="https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/$artifact_path/bun-linux-x64.zip"
local webhook_url="$BENCHMARK_URL?tag=$tag&commit=$commit&artifact_url=$artifact_url"
curl -X POST "$webhook_url"
}
function create_release() {
assert_main
assert_buildkite_agent
@@ -168,14 +190,18 @@ function create_release() {
local artifacts=(
bun-darwin-aarch64.zip
bun-darwin-aarch64-profile.zip
bun-darwin-x64.zip
bun-darwin-x64-profile.zip
bun-linux-aarch64.zip
bun-linux-aarch64-profile.zip
bun-linux-x64.zip
bun-linux-x64-profile.zip
bun-linux-x64-baseline.zip
bun-linux-x64-baseline-profile.zip
bun-linux-aarch64-musl.zip
bun-linux-aarch64-musl-profile.zip
bun-linux-x64-musl.zip
bun-linux-x64-musl-profile.zip
bun-linux-x64-musl-baseline.zip
bun-linux-x64-musl-baseline-profile.zip
bun-windows-x64.zip
bun-windows-x64-profile.zip
bun-windows-x64-baseline.zip
@@ -185,23 +211,27 @@ function create_release() {
function upload_artifact() {
local artifact="$1"
download_buildkite_artifact "$artifact"
upload_s3_file "releases/$BUILDKITE_COMMIT" "$artifact" &
if [ "$tag" == "canary" ]; then
upload_s3_file "releases/$BUILDKITE_COMMIT-canary" "$artifact" &
else
upload_s3_file "releases/$BUILDKITE_COMMIT" "$artifact" &
fi
upload_s3_file "releases/$tag" "$artifact" &
upload_github_asset "$tag" "$artifact" &
wait
}
for artifact in "${artifacts[@]}"; do
upload_artifact "$artifact" &
upload_artifact "$artifact"
done
wait
update_github_release "$tag"
create_sentry_release "$tag"
send_bench_webhook "$tag"
}
function assert_canary() {
local canary="$(buildkite-agent meta-data get canary 2>/dev/null)"
if [ -z "$canary" ] || [ "$canary" == "0" ]; then
if [ -z "$CANARY" ] || [ "$CANARY" == "0" ]; then
echo "warn: Skipping release because this is not a canary build"
exit 0
fi

9
.clang-tidy Normal file
View File

@@ -0,0 +1,9 @@
WarningsAsErrors: "*"
FormatStyle: webkit
Checks: >
-*,
clang-analyzer-*,
-clang-analyzer-optin.core.EnumCastOutOfRange
-clang-analyzer-webkit.UncountedLambdaCapturesChecker
-clang-analyzer-optin.core.EnumCastOutOfRange
-clang-analyzer-webkit.RefCntblBaseVirtualDtor

View File

@@ -1,3 +1,8 @@
Index:
Background: Skip # Disable slow background indexing of these files.
CompileFlags:
CompilationDatabase: build/debug
Diagnostics:
UnusedIncludes: None

7
.cursorignore Normal file
View File

@@ -0,0 +1,7 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
bench
vendor
*-fixture.{js,ts}
zig-cache
packages/bun-uws/fuzzing
build

File diff suppressed because it is too large Load Diff

View File

@@ -1,14 +0,0 @@
# Note: 2 blank lines are required between entries
Package: *
Pin: release a=eoan
Pin-Priority: 500
Package: *
Pin: origin "ftp.debian.org"
Pin-Priority: 300
# Pattern includes 'chromium', 'chromium-browser' and similarly
# named dependencies:
Package: chromium*
Pin: origin "ftp.debian.org"
Pin-Priority: 700

View File

@@ -1,8 +0,0 @@
#!/bin/bash
set -euxo pipefail
name=$(openssl rand -hex 12)
id=$(docker create --name=bun-binary-$name $CONTAINER_TAG)
docker container cp bun-binary-$name:$BUN_RELEASE_DIR bun-binary
echo -e "bun-binary-$name"

View File

@@ -1,3 +0,0 @@
deb http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian buster-updates main
deb http://deb.debian.org/debian-security buster/updates main

View File

@@ -1,34 +0,0 @@
export DOCKER_BUILDKIT=1
export BUILDKIT_ARCH=$(uname -m)
export ARCH=${BUILDKIT_ARCH}
if [ "$BUILDKIT_ARCH" == "amd64" ]; then
export BUILDKIT_ARCH="amd64"
export ARCH=x64
fi
if [ "$BUILDKIT_ARCH" == "x86_64" ]; then
export BUILDKIT_ARCH="amd64"
export ARCH=x64
fi
if [ "$BUILDKIT_ARCH" == "arm64" ]; then
export BUILDKIT_ARCH="arm64"
export ARCH=aarch64
fi
if [ "$BUILDKIT_ARCH" == "aarch64" ]; then
export BUILDKIT_ARCH="arm64"
export ARCH=aarch64
fi
if [ "$BUILDKIT_ARCH" == "armv7l" ]; then
echo "Unsupported platform: $BUILDKIT_ARCH"
exit 1
fi
export BUILD_ID=$(cat build-id)
export CONTAINER_NAME=bun-linux-$ARCH
export DEBUG_CONTAINER_NAME=debug-bun-linux-$ARCH
export TEMP=/tmp/bun-0.0.$BUILD_ID

View File

@@ -1,11 +0,0 @@
#!/bin/bash
set -euxo pipefail
docker pull bunbunbunbun/bun-test-base:latest --platform=linux/amd64
docker pull bunbunbunbun/bun-base:latest --platform=linux/amd64
docker pull bunbunbunbun/bun-base-with-zig-and-webkit:latest --platform=linux/amd64
docker tag bunbunbunbun/bun-test-base:latest bun-base:latest
docker tag bunbunbunbun/bun-base:latest bun-base:latest
docker tag bunbunbunbun/bun-base-with-zig-and-webkit:latest bun-base-with-zig-and-webkit:latest

View File

@@ -1,47 +0,0 @@
#!/bin/bash
source "dockerfile-common.sh"
export $CONTAINER_NAME=$CONTAINER_NAME-local
rm -rf $TEMP
mkdir -p $TEMP
docker build . --target release --progress=plain -t $CONTAINER_NAME:latest --build-arg BUILDKIT_INLINE_CACHE=1 --platform=linux/$BUILDKIT_ARCH --cache-from $CONTAINER_NAME:latest
if (($?)); then
echo "Failed to build container"
exit 1
fi
id=$(docker create $CONTAINER_NAME:latest)
docker cp $id:/home/ubuntu/bun-release $TEMP/$CONTAINER_NAME
if (($?)); then
echo "Failed to cp container"
exit 1
fi
cd $TEMP
mkdir -p $TEMP/$CONTAINER_NAME $TEMP/$DEBUG_CONTAINER_NAME
mv $CONTAINER_NAME/bun-profile $DEBUG_CONTAINER_NAME/bun
zip -r $CONTAINER_NAME.zip $CONTAINER_NAME
zip -r $DEBUG_CONTAINER_NAME.zip $DEBUG_CONTAINER_NAME
docker rm -v $id
abs=$(realpath $TEMP/$CONTAINER_NAME.zip)
debug_abs=$(realpath $TEMP/$DEBUG_CONTAINER_NAME.zip)
case $(uname -s) in
"Linux") target="linux" ;;
*) target="other" ;;
esac
if [ "$target" = "linux" ]; then
if command -v bun --version >/dev/null; then
cp $TEMP/$CONTAINER_NAME/bun $(which bun)
cp $TEMP/$DEBUG_CONTAINER_NAME/bun $(which bun-profile)
fi
fi
echo "Saved to:"
echo $debug_abs
echo $abs

View File

@@ -1,9 +0,0 @@
#!/bin/bash
set -euxo pipefail
bun install
bun install --cwd ./test/snippets
bun install --cwd ./test/scripts
make $BUN_TEST_NAME

View File

@@ -1,5 +0,0 @@
#!/bin/bash
set -euxo pipefail
docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --env BUN_TEST_NAME=$BUN_TEST_NAME --ulimit memlock=-1:-1 --init --rm bun-test:latest

View File

@@ -1,5 +0,0 @@
#!/bin/bash
set -euxo pipefail
docker container run --security-opt seccomp=.docker/chrome.json --env GITHUB_WORKSPACE=$GITHUB_WORKSPACE --ulimit memlock=-1:-1 --init --rm bun-unit-tests:latest

View File

@@ -11,5 +11,11 @@ packages/**/bun-profile
src/bun.js/WebKit
src/bun.js/WebKit/LayoutTests
zig-build
zig-cache
zig-out
.zig-cache
zig-out
build
vendor
node_modules
*.trace
packages/bun-uws/fuzzing

10
.gitattributes vendored
View File

@@ -7,6 +7,7 @@
*.cpp text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.cc text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.yml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.toml text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.zig text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.rs text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
*.h text eol=lf whitespace=blank-at-eol,-blank-at-eof,-space-before-tab,tab-in-indent,tabwidth=2
@@ -43,5 +44,10 @@ test/**/* linguist-documentation
bench/**/* linguist-documentation
examples/**/* linguist-documentation
src/deps/*.c linguist-vendored
src/deps/brotli/** linguist-vendored
vendor/*.c linguist-vendored
vendor/brotli/** linguist-vendored
test/js/node/test/fixtures linguist-vendored
test/js/node/test/common linguist-vendored
test/js/bun/css/files linguist-vendored

View File

@@ -1,6 +1,6 @@
name: 🇹 TypeScript Type Bug Report
description: Report an issue with TypeScript types
labels: [bug, typescript]
labels: [bug, types]
body:
- type: markdown
attributes:

View File

@@ -2,11 +2,18 @@ name: bun install crash report
description: Report a crash in bun install
labels:
- npm
- crash
body:
- type: markdown
attributes:
value: |
**Thank you so much** for submitting a crash report. You're helping us make Bun more reliable for everyone!
- type: textarea
id: package_json
attributes:
label: "`package.json` file"
description: "Can you upload your `package.json` file? This helps us reproduce the crash."
render: json
- type: textarea
id: repro
attributes:

View File

@@ -42,9 +42,10 @@ runs:
canary) release="canary";;
*) release="bun-v${{ inputs.bun-version }}";;
esac
curl -LO "${{ inputs.download-url }}/${release}/${target}.zip"
curl -LO "${{ inputs.download-url }}/${release}/${target}.zip" --retry 5
unzip ${target}.zip
mkdir -p ${{ runner.temp }}/.bun/bin
mv ${target}/bun* ${{ runner.temp }}/.bun/bin/
chmod +x ${{ runner.temp }}/.bun/bin/*
ln -fs ${{ runner.temp }}/.bun/bin/bun ${{ runner.temp }}/.bun/bin/bunx
echo "${{ runner.temp }}/.bun/bin" >> ${GITHUB_PATH}

41
.github/workflows/clang-format.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: clang-format
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
LLVM_VERSION: "18.1.8"
LLVM_VERSION_MAJOR: "18"
jobs:
clang-format:
name: clang-format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install LLVM
run: |
curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ env.LLVM_VERSION_MAJOR }} all
- name: Clang Format
env:
LLVM_VERSION: ${{ env.LLVM_VERSION }}
run: |
bun run clang-format
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run clang-format`"

41
.github/workflows/clang-tidy.yml vendored Normal file
View File

@@ -0,0 +1,41 @@
name: clang-tidy
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
LLVM_VERSION: "18.1.8"
LLVM_VERSION_MAJOR: "18"
jobs:
clang-tidy:
name: clang-tidy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Install LLVM
run: |
curl -fsSL https://apt.llvm.org/llvm.sh | sudo bash -s -- ${{ env.LLVM_VERSION_MAJOR }} all
- name: Clang Tidy
env:
LLVM_VERSION: ${{ env.LLVM_VERSION }}
run: |
bun run clang-tidy:diff
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run clang-tidy`"

View File

@@ -7,6 +7,42 @@ on:
types: [labeled]
jobs:
# on-bug:
# runs-on: ubuntu-latest
# if: github.event.label.name == 'bug' || github.event.label.name == 'crash'
# permissions:
# issues: write
# steps:
# - name: Checkout
# uses: actions/checkout@v4
# with:
# sparse-checkout: |
# scripts
# .github
# CMakeLists.txt
# - name: Setup Bun
# uses: ./.github/actions/setup-bun
# with:
# bun-version: "1.1.24"
# - name: "categorize bug"
# id: add-labels
# env:
# GITHUB_ISSUE_BODY: ${{ github.event.issue.body }}
# GITHUB_ISSUE_TITLE: ${{ github.event.issue.title }}
# ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
# shell: bash
# run: |
# echo '{"dependencies": { "@anthropic-ai/sdk": "latest" }}' > scripts/package.json && bun install --cwd=./scripts
# LABELS=$(bun scripts/label-issue.ts)
# echo "labels=$LABELS" >> $GITHUB_OUTPUT
# - name: Add labels
# uses: actions-cool/issues-helper@v3
# if: steps.add-labels.outputs.labels != ''
# with:
# actions: "add-labels"
# token: ${{ secrets.GITHUB_TOKEN }}
# issue-number: ${{ github.event.issue.number }}
# labels: ${{ steps.add-labels.outputs.labels }}
on-labeled:
runs-on: ubuntu-latest
if: github.event.label.name == 'crash' || github.event.label.name == 'needs repro'
@@ -47,6 +83,26 @@ jobs:
echo "latest=$(cat LATEST)" >> $GITHUB_OUTPUT
rm -rf is-outdated.txt outdated.txt latest.txt
- name: Generate comment text with Sentry Link
if: github.event.label.name == 'crash'
# ignore if fail
continue-on-error: true
id: generate-comment-text
env:
GITHUB_ISSUE_BODY: ${{ github.event.issue.body }}
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_EVENTS_SECRET }}
shell: bash
run: |
bun scripts/associate-issue-with-sentry.ts
if [[ -f "sentry-link.txt" ]]; then
echo "sentry-link=$(cat sentry-link.txt)" >> $GITHUB_OUTPUT
fi
if [[ -f "sentry-id.txt" ]]; then
echo "sentry-id=$(cat sentry-id.txt)" >> $GITHUB_OUTPUT
fi
- name: Add labels
uses: actions-cool/issues-helper@v3
if: github.event.label.name == 'crash'
@@ -56,7 +112,7 @@ jobs:
issue-number: ${{ github.event.issue.number }}
labels: ${{ steps.add-labels.outputs.labels }}
- name: Comment outdated
if: steps.add-labels.outputs.is-outdated == 'true' && github.event.label.name == 'crash'
if: steps.add-labels.outputs.is-outdated == 'true' && github.event.label.name == 'crash' && steps.generate-comment-text.outputs.sentry-link == ''
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
@@ -70,6 +126,40 @@ jobs:
```sh
bun upgrade
```
- name: Comment with Sentry Link and outdated version
if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated == 'true'
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
@${{ github.event.issue.user.login }}, thank you for reporting this crash. The latest version of Bun is v${{ steps.add-labels.outputs.latest }}, but this crash was reported on Bun v${{ steps.add-labels.outputs.oudated }}.
Are you able to reproduce this crash on the latest version of Bun?
```sh
bun upgrade
```
For Bun's internal tracking, this issue is [${{ steps.generate-comment-text.outputs.sentry-id }}](${{ steps.generate-comment-text.outputs.sentry-link }}).
<!-- sentry-id: ${{ steps.generate-comment-text.outputs.sentry-id }} -->
<!-- sentry-link: ${{ steps.generate-comment-text.outputs.sentry-link }} -->
- name: Comment with Sentry Link
if: steps.generate-comment-text.outputs.sentry-link != '' && github.event.label.name == 'crash' && steps.add-labels.outputs.is-outdated != 'true'
uses: actions-cool/issues-helper@v3
with:
actions: "create-comment"
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Thank you for reporting this crash.
For Bun's internal tracking, this issue is [${{ steps.generate-comment-text.outputs.sentry-id }}](${{ steps.generate-comment-text.outputs.sentry-link }}).
<!-- sentry-id: ${{ steps.generate-comment-text.outputs.sentry-id }} -->
<!-- sentry-link: ${{ steps.generate-comment-text.outputs.sentry-link }} -->
- name: Comment needs repro
if: github.event.label.name == 'needs repro'
uses: actions-cool/issues-helper@v3
@@ -78,4 +168,4 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.issue.number }}
body: |
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository, [Replit](https://replit.com/@replit/Bun), or [CodeSandbox](https://codesandbox.io/templates/bun). Issues marked with `needs repro` will be closed if they have no activity within 3 days.
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository, [Replit](https://replit.com/@replit/Bun), [CodeSandbox](https://codesandbox.io/templates/bun), or provide a bulleted list of commands to run that reproduce this issue. Issues marked with `needs repro` will be closed if they have no activity within 3 days.

View File

@@ -1,30 +0,0 @@
name: lint-cpp
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.run-id || github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
inputs:
run-id:
type: string
description: The workflow ID to download artifacts (skips the build step)
pull_request:
paths:
- ".github/workflows/lint-cpp.yml"
- "**/*.cpp"
- "src/deps/**/*"
- "CMakeLists.txt"
jobs:
lint-cpp:
if: ${{ !inputs.run-id }}
name: Lint C++
uses: ./.github/workflows/run-lint-cpp.yml
secrets: inherit
with:
pr-number: ${{ github.event.number }}

37
.github/workflows/prettier-format.yml vendored Normal file
View File

@@ -0,0 +1,37 @@
name: prettier-format
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
jobs:
prettier-format:
name: prettier-format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Setup Dependencies
run: |
bun install
- name: Prettier Format
run: |
bun run prettier:diff
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run prettier:extra`"

View File

@@ -88,6 +88,9 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# To workaround issue
ref: main
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:

View File

@@ -1,52 +0,0 @@
name: Format
permissions:
contents: write
on:
workflow_call:
inputs:
zig-version:
type: string
required: true
jobs:
format:
name: Format
runs-on: ubuntu-latest
if: ${{ github.ref != 'refs/heads/main' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
src
scripts
packages
test
bench
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: "1.1.20"
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
version: ${{ inputs.zig-version }}
- name: Install Dependencies
run: |
bun install
- name: Format
run: |
bun fmt
- name: Format Zig
run: |
bun fmt:zig
- name: Generate submodule versions
run: |
bash ./scripts/write-versions.sh
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply formatting changes

View File

@@ -1,84 +0,0 @@
name: lint-cpp
permissions:
contents: read
env:
LLVM_VERSION: 16
LC_CTYPE: "en_US.UTF-8"
LC_ALL: "en_US.UTF-8"
on:
workflow_call:
inputs:
pr-number:
required: true
type: number
jobs:
lint-cpp:
name: Lint C++
runs-on: ${{ github.repository_owner == 'oven-sh' && 'macos-13-xlarge' || 'macos-13' }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: latest
- name: Install Dependencies
env:
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
run: |
brew install \
llvm@${{ env.LLVM_VERSION }} \
ninja \
coreutils \
openssl@1.1 \
libiconv \
gnu-sed --force --overwrite
echo "$(brew --prefix coreutils)/libexec/gnubin" >> $GITHUB_PATH
echo "$(brew --prefix llvm@$LLVM_VERSION)/bin" >> $GITHUB_PATH
brew link --overwrite llvm@$LLVM_VERSION
- name: Bun install
run: |
bun install
- name: clang-tidy
id: format
env:
CPU_TARGET: native
BUN_SILENT: 1
run: |
rm -f did_fail format.log
echo "${{ inputs.pr-number }}" > pr-number.txt
echo "pr_number=$(cat pr-number.txt)" >> $GITHUB_OUTPUT
bun run --silent build:tidy &> >(tee -p format.log) && echo 0 > did_succeed.txt
# Upload format.log as github artifact for the workflow
if [ -f did_succeed.txt ]; then
echo "0" > did_fail.txt
else
echo "1" > did_fail.txt
fi
echo "did_fail=$(cat did_fail.txt)" >> $GITHUB_OUTPUT
- name: Upload format.log
uses: actions/upload-artifact@v2
with:
name: format.log
path: format.log
- name: Upload PR
uses: actions/upload-artifact@v2
with:
name: pr-number.txt
path: pr-number.txt
- name: Upload PR
uses: actions/upload-artifact@v2
with:
name: did_fail.txt
path: did_fail.txt
- name: Fail if formatting failed
if: ${{ steps.format.outputs.did_fail == '1' }}
run: exit 1

30
.github/workflows/stale.yaml vendored Normal file
View File

@@ -0,0 +1,30 @@
name: Close inactive issues
on:
# schedule:
# - cron: "15 * * * *"
workflow_dispatch:
jobs:
close-issues:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v5
with:
days-before-issue-close: 5
any-of-issue-labels: "needs repro,waiting-for-author"
exempt-issue-labels: "neverstale"
exempt-pr-labels: "neverstale"
remove-stale-when-updated: true
stale-issue-label: "stale"
stale-pr-label: "stale"
stale-issue-message: "This issue is stale and may be closed due to inactivity. If you're still running into this, please leave a comment."
close-issue-message: "This issue was closed because it has been inactive for 5 days since being marked as stale."
days-before-pr-stale: 30
days-before-pr-close: 14
stale-pr-message: "This pull request is stale and may be closed due to inactivity."
close-pr-message: "This pull request has been closed due to inactivity."
repo-token: ${{ github.token }}
operations-per-run: 1000

92
.github/workflows/update-cares.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update c-ares
on:
schedule:
- cron: "0 4 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check c-ares version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildCares.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildCares.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildCares.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/c-ares/c-ares/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/c-ares/c-ares/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildCares.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildCares.cmake
commit-message: "deps: update c-ares to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update c-ares to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-cares-${{ github.run_number }}
body: |
## What does this PR do?
Updates c-ares to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-cares.yml)

92
.github/workflows/update-libarchive.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update libarchive
on:
schedule:
- cron: "0 3 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check libarchive version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLibArchive.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLibArchive.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLibArchive.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/libarchive/libarchive/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/libarchive/libarchive/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLibArchive.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLibArchive.cmake
commit-message: "deps: update libarchive to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update libarchive to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-libarchive-${{ github.run_number }}
body: |
## What does this PR do?
Updates libarchive to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-libarchive.yml)

92
.github/workflows/update-libdeflate.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update libdeflate
on:
schedule:
- cron: "0 2 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check libdeflate version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLibDeflate.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLibDeflate.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLibDeflate.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/ebiggers/libdeflate/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/ebiggers/libdeflate/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLibDeflate.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLibDeflate.cmake
commit-message: "deps: update libdeflate to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update libdeflate to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-libdeflate-${{ github.run_number }}
body: |
## What does this PR do?
Updates libdeflate to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-libdeflate.yml)

92
.github/workflows/update-lolhtml.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update lolhtml
on:
schedule:
- cron: "0 1 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check lolhtml version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLolHtml.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLolHtml.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLolHtml.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/cloudflare/lol-html/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/cloudflare/lol-html/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLolHtml.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLolHtml.cmake
commit-message: "deps: update lolhtml to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update lolhtml to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-lolhtml-${{ github.run_number }}
body: |
## What does this PR do?
Updates lolhtml to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-lolhtml.yml)

92
.github/workflows/update-lshpack.yml vendored Normal file
View File

@@ -0,0 +1,92 @@
name: Update lshpack
on:
schedule:
- cron: "0 5 * * 0"
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check lshpack version
id: check-version
run: |
set -euo pipefail
# Extract the commit hash from the line after COMMIT
CURRENT_VERSION=$(awk '/[[:space:]]*COMMIT[[:space:]]*$/{getline; gsub(/^[[:space:]]+|[[:space:]]+$/,"",$0); print}' cmake/targets/BuildLshpack.cmake)
if [ -z "$CURRENT_VERSION" ]; then
echo "Error: Could not find COMMIT line in BuildLshpack.cmake"
exit 1
fi
# Validate that it looks like a git hash
if ! [[ $CURRENT_VERSION =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid git hash format in BuildLshpack.cmake"
echo "Found: $CURRENT_VERSION"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
LATEST_RELEASE=$(curl -sL https://api.github.com/repos/litespeedtech/ls-hpack/releases/latest)
if [ -z "$LATEST_RELEASE" ]; then
echo "Error: Failed to fetch latest release from GitHub API"
exit 1
fi
LATEST_TAG=$(echo "$LATEST_RELEASE" | jq -r '.tag_name')
if [ -z "$LATEST_TAG" ] || [ "$LATEST_TAG" = "null" ]; then
echo "Error: Could not extract tag name from GitHub API response"
exit 1
fi
LATEST_SHA=$(curl -sL "https://api.github.com/repos/litespeedtech/ls-hpack/git/ref/tags/$LATEST_TAG" | jq -r '.object.sha')
if [ -z "$LATEST_SHA" ] || [ "$LATEST_SHA" = "null" ]; then
echo "Error: Could not fetch SHA for tag $LATEST_TAG"
exit 1
fi
if ! [[ $LATEST_SHA =~ ^[0-9a-f]{40}$ ]]; then
echo "Error: Invalid SHA format received from GitHub"
echo "Found: $LATEST_SHA"
echo "Expected: 40 character hexadecimal string"
exit 1
fi
echo "latest=$LATEST_SHA" >> $GITHUB_OUTPUT
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Update version if needed
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
run: |
set -euo pipefail
# Handle multi-line format where COMMIT and its value are on separate lines
sed -i -E '/[[:space:]]*COMMIT[[:space:]]*$/{n;s/[[:space:]]*([0-9a-f]+)[[:space:]]*$/ ${{ steps.check-version.outputs.latest }}/}' cmake/targets/BuildLshpack.cmake
- name: Create Pull Request
if: success() && steps.check-version.outputs.current != steps.check-version.outputs.latest
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
cmake/targets/BuildLshpack.cmake
commit-message: "deps: update lshpack to ${{ steps.check-version.outputs.tag }} (${{ steps.check-version.outputs.latest }})"
title: "deps: update lshpack to ${{ steps.check-version.outputs.tag }}"
delete-branch: true
branch: deps/update-lshpack-${{ github.run_number }}
body: |
## What does this PR do?
Updates lshpack to version ${{ steps.check-version.outputs.tag }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-lshpack.yml)

109
.github/workflows/update-sqlite3.yml vendored Normal file
View File

@@ -0,0 +1,109 @@
name: Update SQLite3
on:
schedule:
- cron: "0 6 * * 0" # Run weekly
workflow_dispatch:
jobs:
check-update:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
- name: Check SQLite version
id: check-version
run: |
set -euo pipefail
# Get current version from the header file using SQLITE_VERSION_NUMBER
CURRENT_VERSION_NUM=$(grep -o '#define SQLITE_VERSION_NUMBER [0-9]\+' src/bun.js/bindings/sqlite/sqlite3_local.h | awk '{print $3}' | tr -d '\n\r')
if [ -z "$CURRENT_VERSION_NUM" ]; then
echo "Error: Could not find SQLITE_VERSION_NUMBER in sqlite3_local.h"
exit 1
fi
# Convert numeric version to semantic version for display
CURRENT_MAJOR=$((CURRENT_VERSION_NUM / 1000000))
CURRENT_MINOR=$((($CURRENT_VERSION_NUM / 1000) % 1000))
CURRENT_PATCH=$((CURRENT_VERSION_NUM % 1000))
CURRENT_VERSION="$CURRENT_MAJOR.$CURRENT_MINOR.$CURRENT_PATCH"
echo "current=$CURRENT_VERSION" >> $GITHUB_OUTPUT
echo "current_num=$CURRENT_VERSION_NUM" >> $GITHUB_OUTPUT
# Fetch SQLite download page
DOWNLOAD_PAGE=$(curl -sL https://sqlite.org/download.html)
if [ -z "$DOWNLOAD_PAGE" ]; then
echo "Error: Failed to fetch SQLite download page"
exit 1
fi
# Extract latest version and year from the amalgamation link
LATEST_INFO=$(echo "$DOWNLOAD_PAGE" | grep -o 'sqlite-amalgamation-[0-9]\{7\}.zip' | head -n1)
LATEST_YEAR=$(echo "$DOWNLOAD_PAGE" | grep -o '[0-9]\{4\}/sqlite-amalgamation-[0-9]\{7\}.zip' | head -n1 | cut -d'/' -f1 | tr -d '\n\r')
LATEST_VERSION_NUM=$(echo "$LATEST_INFO" | grep -o '[0-9]\{7\}' | tr -d '\n\r')
if [ -z "$LATEST_VERSION_NUM" ] || [ -z "$LATEST_YEAR" ]; then
echo "Error: Could not extract latest version info"
exit 1
fi
# Convert numeric version to semantic version for display
LATEST_MAJOR=$((10#$LATEST_VERSION_NUM / 1000000))
LATEST_MINOR=$((($LATEST_VERSION_NUM / 1000) % 1000))
LATEST_PATCH=$((10#$LATEST_VERSION_NUM % 1000))
LATEST_VERSION="$LATEST_MAJOR.$LATEST_MINOR.$LATEST_PATCH"
echo "latest=$LATEST_VERSION" >> $GITHUB_OUTPUT
echo "latest_year=$LATEST_YEAR" >> $GITHUB_OUTPUT
echo "latest_num=$LATEST_VERSION_NUM" >> $GITHUB_OUTPUT
# Debug output
echo "Current version: $CURRENT_VERSION ($CURRENT_VERSION_NUM)"
echo "Latest version: $LATEST_VERSION ($LATEST_VERSION_NUM)"
- name: Update SQLite if needed
if: success() && steps.check-version.outputs.current_num < steps.check-version.outputs.latest_num
run: |
set -euo pipefail
TEMP_DIR=$(mktemp -d)
cd $TEMP_DIR
echo "Downloading from: https://sqlite.org/${{ steps.check-version.outputs.latest_year }}/sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}.zip"
# Download and extract latest version
wget "https://sqlite.org/${{ steps.check-version.outputs.latest_year }}/sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}.zip"
unzip "sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}.zip"
cd "sqlite-amalgamation-${{ steps.check-version.outputs.latest_num }}"
# Add header comment and copy files
echo "// clang-format off" > $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3.c
cat sqlite3.c >> $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3.c
echo "// clang-format off" > $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3_local.h
cat sqlite3.h >> $GITHUB_WORKSPACE/src/bun.js/bindings/sqlite/sqlite3_local.h
- name: Create Pull Request
if: success() && steps.check-version.outputs.current_num < steps.check-version.outputs.latest_num
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
add-paths: |
src/bun.js/bindings/sqlite/sqlite3.c
src/bun.js/bindings/sqlite/sqlite3_local.h
commit-message: "deps: update sqlite to ${{ steps.check-version.outputs.latest }}"
title: "deps: update sqlite to ${{ steps.check-version.outputs.latest }}"
delete-branch: true
branch: deps/update-sqlite-${{ steps.check-version.outputs.latest }}
body: |
## What does this PR do?
Updates SQLite to version ${{ steps.check-version.outputs.latest }}
Auto-updated by [this workflow](https://github.com/oven-sh/bun/actions/workflows/update-sqlite3.yml)

34
.github/workflows/zig-format.yml vendored Normal file
View File

@@ -0,0 +1,34 @@
name: zig-format
permissions:
contents: write
on:
workflow_call:
workflow_dispatch:
pull_request:
merge_group:
env:
BUN_VERSION: "1.1.27"
jobs:
zig-format:
name: zig-format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
bun-version: ${{ env.BUN_VERSION }}
- name: Zig Format
run: |
bun run zig-format:diff
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "`bun run zig-format`"

47
.gitignore vendored
View File

@@ -26,6 +26,7 @@
*.db
*.dmg
*.dSYM
*.generated.ts
*.jsb
*.lib
*.log
@@ -49,13 +50,12 @@
/build-*/
/bun-webkit
/kcov-out
/src/deps/libuv
/test-report.json
/test-report.md
/test.js
/test.ts
/testdir
/test.zig
/testdir
build
build.ninja
bun-binary
@@ -112,16 +112,15 @@ pnpm-lock.yaml
profile.json
README.md.template
release/
scripts/env.local
sign.*.json
sign.json
src/bake/generated.ts
src/generated_enum_extractor.zig
src/bun.js/bindings-obj
src/bun.js/bindings/GeneratedJS2Native.zig
src/bun.js/bindings/GeneratedBindings.zig
src/bun.js/debug-bindings-obj
src/deps/c-ares/build
src/deps/libiconv
src/deps/openssl
src/deps/PLCrashReporter/
src/deps/s2n-tls
src/deps/zig-clap/.gitattributes
src/deps/zig-clap/.github
src/deps/zig-clap/example
@@ -137,6 +136,7 @@ src/runtime.version
src/tests.zig
test.txt
test/js/bun/glob/fixtures
test/node.js/upstream
tsconfig.tsbuildinfo
txt.js
x64
@@ -146,3 +146,36 @@ zig-out
test/node.js/upstream
.zig-cache
scripts/env.local
*.generated.ts
src/bake/generated.ts
test/cli/install/registry/packages/publish-pkg-*
test/cli/install/registry/packages/@secret/publish-pkg-8
test/js/third_party/prisma/prisma/sqlite/dev.db-journal
# Dependencies
/vendor
# Dependencies (before CMake)
# These can be removed in the far future
/src/bun.js/WebKit
/src/deps/boringssl
/src/deps/brotli
/src/deps/c*ares
/src/deps/libarchive
/src/deps/libdeflate
/src/deps/libuv
/src/deps/lol*html
/src/deps/ls*hpack
/src/deps/mimalloc
/src/deps/picohttpparser
/src/deps/tinycc
/src/deps/WebKit
/src/deps/zig
/src/deps/zlib
/src/deps/zstd
# Generated files
.buildkite/ci.yml
*.sock
scratch*.{js,ts,tsx,cjs,mjs}

88
.gitmodules vendored
View File

@@ -1,88 +0,0 @@
[submodule "src/javascript/jsc/WebKit"]
path = src/bun.js/WebKit
url = https://github.com/oven-sh/WebKit.git
ignore = dirty
depth = 1
update = none
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/picohttpparser"]
path = src/deps/picohttpparser
url = https://github.com/h2o/picohttpparser.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/mimalloc"]
path = src/deps/mimalloc
url = https://github.com/Jarred-Sumner/mimalloc.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/zlib"]
path = src/deps/zlib
url = https://github.com/cloudflare/zlib.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/libarchive"]
path = src/deps/libarchive
url = https://github.com/libarchive/libarchive.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/boringssl"]
path = src/deps/boringssl
url = https://github.com/oven-sh/boringssl.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/lol-html"]
path = src/deps/lol-html
url = https://github.com/cloudflare/lol-html
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/tinycc"]
path = src/deps/tinycc
url = https://github.com/Jarred-Sumner/tinycc.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/c-ares"]
path = src/deps/c-ares
url = https://github.com/c-ares/c-ares.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/zstd"]
path = src/deps/zstd
url = https://github.com/facebook/zstd.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/ls-hpack"]
path = src/deps/ls-hpack
url = https://github.com/litespeedtech/ls-hpack.git
ignore = dirty
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "zig"]
path = src/deps/zig
url = https://github.com/oven-sh/zig
depth = 1
shallow = true
fetchRecurseSubmodules = false
[submodule "src/deps/libdeflate"]
path = src/deps/libdeflate
url = https://github.com/ebiggers/libdeflate
ignore = "dirty"

View File

@@ -1,4 +1,4 @@
command script import src/deps/zig/tools/lldb_pretty_printers.py
command script import src/bun.js/WebKit/Tools/lldb/lldb_webkit.py
# command script import vendor/zig/tools/lldb_pretty_printers.py
command script import vendor/WebKit/Tools/lldb/lldb_webkit.py
# type summary add --summary-string "${var} | inner=${var[0-30]}, source=${var[33-64]}, tag=${var[31-32]}" "unsigned long"

View File

@@ -1,7 +1,9 @@
src/bun.js/WebKit
src/deps
vendor
test/snapshots
test/js/deno
test/node.js
src/react-refresh.js
*.min.js
test/snippets
test/js/node/test

View File

@@ -3,18 +3,18 @@
{
"name": "Debug",
"forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"compileCommands": "${workspaceFolder}/build/debug/compile_commands.json",
"includePath": [
"${workspaceFolder}/build/bun-webkit/include",
"${workspaceFolder}/build/codegen",
"${workspaceFolder}/build/debug/codegen",
"${workspaceFolder}/src/bun.js/bindings/",
"${workspaceFolder}/src/bun.js/bindings/webcore/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
"${workspaceFolder}/src/bun.js/bindings/webcrypto/",
"${workspaceFolder}/src/bun.js/modules/",
"${workspaceFolder}/src/js/builtins/",
"${workspaceFolder}/src/deps/boringssl/include/",
"${workspaceFolder}/src/deps",
"${workspaceFolder}/vendor/boringssl/include/",
"${workspaceFolder}/vendor",
"${workspaceFolder}/src/napi/*",
"${workspaceFolder}/packages/bun-usockets/src",
"${workspaceFolder}/packages/",
@@ -26,8 +26,8 @@
"${workspaceFolder}/src/napi/*",
"${workspaceFolder}/src/js/builtins/*",
"${workspaceFolder}/src/bun.js/modules/*",
"${workspaceFolder}/src/deps/*",
"${workspaceFolder}/src/deps/boringssl/include/*",
"${workspaceFolder}/vendor/*",
"${workspaceFolder}/vendor/boringssl/include/*",
"${workspaceFolder}/packages/bun-usockets/*",
"${workspaceFolder}/packages/bun-uws/*",
"${workspaceFolder}/src/napi/*",
@@ -55,12 +55,12 @@
"name": "BunWithJSCDebug",
"forcedInclude": ["${workspaceFolder}/src/bun.js/bindings/root.h"],
"includePath": [
"${workspaceFolder}/build/codegen",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/ICU/Headers/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/WTF/Headers",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/bmalloc/Headers/",
"${workspaceFolder}/build/debug/codegen",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/ICU/Headers/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/WTF/Headers",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/bmalloc/Headers/",
"${workspaceFolder}/src/bun.js/bindings/",
"${workspaceFolder}/src/bun.js/bindings/webcore/",
"${workspaceFolder}/src/bun.js/bindings/sqlite/",
@@ -68,19 +68,19 @@
"${workspaceFolder}/src/bun.js/modules/",
"${workspaceFolder}/src/js/builtins/",
"${workspaceFolder}/src/js/out",
"${workspaceFolder}/src/deps/boringssl/include/",
"${workspaceFolder}/src/deps",
"${workspaceFolder}/vendor/boringssl/include/",
"${workspaceFolder}/vendor",
"${workspaceFolder}/src/napi/*",
"${workspaceFolder}/packages/bun-usockets/src",
"${workspaceFolder}/packages/",
],
"browse": {
"path": [
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/ICU/Headers/",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/WTF/Headers/**",
"${workspaceFolder}/src/bun.js/WebKit/WebKitBuild/Debug/bmalloc/Headers/**",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/ICU/Headers/",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/JavaScriptCore/PrivateHeaders/**",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/WTF/Headers/**",
"${workspaceFolder}/vendor/WebKit/WebKitBuild/Debug/bmalloc/Headers/**",
"${workspaceFolder}/src/bun.js/bindings/*",
"${workspaceFolder}/src/bun.js/bindings/*",
"${workspaceFolder}/src/napi/*",
@@ -90,8 +90,8 @@
"${workspaceFolder}/src/js/builtins/*",
"${workspaceFolder}/src/js/out/*",
"${workspaceFolder}/src/bun.js/modules/*",
"${workspaceFolder}/src/deps",
"${workspaceFolder}/src/deps/boringssl/include/",
"${workspaceFolder}/vendor",
"${workspaceFolder}/vendor/boringssl/include/",
"${workspaceFolder}/packages/bun-usockets/",
"${workspaceFolder}/packages/bun-uws/",
"${workspaceFolder}/src/napi",

405
.vscode/launch.json generated vendored
View File

@@ -12,31 +12,33 @@
"type": "lldb",
"request": "launch",
"name": "bun test [file]",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [file] --only",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "--only", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "1",
"BUN_DEBUG_FileReader": "1",
"BUN_DEBUG_jest": "1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
@@ -48,72 +50,82 @@
"type": "lldb",
"request": "launch",
"name": "bun test [file] (fast)",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "0",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [file] (verbose)",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "0",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [file] --watch",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "--watch", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [file] --hot",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "--hot", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [file] --inspect",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
"BUN_INSPECT": "ws://localhost:0/?wait=1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
"serverReadyAction": {
"pattern": "https://debug.bun.sh/#localhost:([0-9]+)/",
"uriFormat": "https://debug.bun.sh/#ws://localhost:%s/",
@@ -124,16 +136,18 @@
"type": "lldb",
"request": "launch",
"name": "bun test [file] --inspect-brk",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
"BUN_INSPECT": "ws://localhost:0/?break=1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
"serverReadyAction": {
"pattern": "https://debug.bun.sh/#localhost:([0-9]+)/",
"uriFormat": "https://debug.bun.sh/#ws://localhost:%s/",
@@ -145,78 +159,90 @@
"type": "lldb",
"request": "launch",
"name": "bun run [file]",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"env": {
"FORCE_COLOR": "0",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_EventLoop": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun run [file] (fast)",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "0",
"BUN_DEBUG_IncrementalGraph": "1",
"BUN_DEBUG_Bake": "1",
"BUN_DEBUG_reload_file_list": "1",
"GOMAXPROCS": "1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun run [file] (verbose)",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "0",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun run [file] --watch",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["run", "--watch", "${fileBasename}"],
"cwd": "${fileDirname}",
"env": {
"FORCE_COLOR": "1",
// "BUN_DEBUG_DEBUGGER": "1",
// "BUN_DEBUG_INTERNAL_DEBUGGER": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
// "BUN_INSPECT": "ws+unix:///var/folders/jk/8fzl9l5119598vsqrmphsw7m0000gn/T/tl15npi7qtf.sock?report=1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun run [file] --hot",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["run", "--hot", "${fileBasename}"],
"cwd": "${fileDirname}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun run [file] --inspect",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"env": {
@@ -226,6 +252,8 @@
"BUN_INSPECT": "ws://localhost:0/?wait=1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
"serverReadyAction": {
"pattern": "https://debug.bun.sh/#localhost:([0-9]+)/",
"uriFormat": "https://debug.bun.sh/#ws://localhost:%s/",
@@ -236,7 +264,7 @@
"type": "lldb",
"request": "launch",
"name": "bun run [file] --inspect-brk",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"env": {
@@ -246,6 +274,8 @@
"BUN_INSPECT": "ws://localhost:0/?break=1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
"serverReadyAction": {
"pattern": "https://debug.bun.sh/#localhost:([0-9]+)/",
"uriFormat": "https://debug.bun.sh/#ws://localhost:%s/",
@@ -257,86 +287,98 @@
"type": "lldb",
"request": "launch",
"name": "bun test [...]",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [...] (fast)",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "0",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [...] (verbose)",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "0",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [...] --watch",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "--watch", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [...] --hot",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "--hot", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [...] --inspect",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
"BUN_INSPECT": "ws://localhost:0/?wait=1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
"serverReadyAction": {
"pattern": "https://debug.bun.sh/#localhost:([0-9]+)/",
"uriFormat": "https://debug.bun.sh/#ws://localhost:%s/",
@@ -347,16 +389,18 @@
"type": "lldb",
"request": "launch",
"name": "bun test [...] --inspect-brk",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_DEBUG_jest": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
"BUN_INSPECT": "ws://localhost:0/?break=1",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
"serverReadyAction": {
"pattern": "https://debug.bun.sh/#localhost:([0-9]+)/",
"uriFormat": "https://debug.bun.sh/#ws://localhost:%s/",
@@ -368,59 +412,63 @@
"type": "lldb",
"request": "launch",
"name": "bun exec [...]",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["exec", "${input:testName}"],
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
// bun test [*]
{
"type": "lldb",
"request": "launch",
"name": "bun test [*]",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [*] (fast)",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "0",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
"request": "launch",
"name": "bun test [*] --inspect",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["test"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
"BUN_INSPECT": "ws://localhost:0/",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
"serverReadyAction": {
"pattern": "https://debug.bun.sh/#localhost:([0-9]+)/",
"uriFormat": "https://debug.bun.sh/#ws://localhost:%s/",
@@ -431,15 +479,16 @@
"type": "lldb",
"request": "launch",
"name": "bun install [folder]",
"program": "${workspaceFolder}/build/bun-debug",
"program": "${workspaceFolder}/build/debug/bun-debug",
"args": ["install"],
"cwd": "${fileDirname}",
"env": {
"FORCE_COLOR": "1",
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
{
"type": "lldb",
@@ -448,7 +497,13 @@
"program": "node",
"args": ["test/runner.node.mjs"],
"cwd": "${workspaceFolder}",
"env": {
"BUN_DEBUG_QUIET_LOGS": "1",
"BUN_GARBAGE_COLLECTOR_LEVEL": "2",
},
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
// Windows: bun test [file]
{
@@ -458,14 +513,10 @@
},
"request": "launch",
"name": "Windows: bun test [file]",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
@@ -474,7 +525,6 @@
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
"name": "BUN_GARBAGE_COLLECTOR_LEVEL",
"value": "1",
@@ -488,32 +538,16 @@
},
"request": "launch",
"name": "Windows: bun test --only [file]",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "--only", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_EventLoop",
"value": "1",
},
{
"name": "BUN_DEBUG_uv",
"value": "1",
},
{
"name": "BUN_DEBUG_SYS",
"value": "1",
},
{
"name": "BUN_DEBUG_PipeWriter",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -529,16 +563,16 @@
},
"request": "launch",
"name": "Windows: bun test [file] (fast)",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -554,18 +588,18 @@
},
"request": "launch",
"name": "Windows: bun test [file] (verbose)",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "0",
},
{
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
"name": "BUN_GARBAGE_COLLECTOR_LEVEL",
"value": "2",
@@ -579,16 +613,16 @@
},
"request": "launch",
"name": "Windows: bun test [file] --inspect",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -613,16 +647,16 @@
},
"request": "launch",
"name": "Windows: bun test [file] --inspect-brk",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${file}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -648,16 +682,16 @@
},
"request": "launch",
"name": "Windows: bun run [file]",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -673,15 +707,14 @@
},
"request": "launch",
"name": "Windows: bun install",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["install"],
"cwd": "${fileDirname}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_GARBAGE_COLLECTOR_LEVEL",
"value": "0",
@@ -695,17 +728,13 @@
},
"request": "launch",
"name": "Windows: bun run [file] (verbose)",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "0",
"value": "1",
},
{
"name": "BUN_GARBAGE_COLLECTOR_LEVEL",
@@ -720,14 +749,10 @@
},
"request": "launch",
"name": "Windows: bun run [file] --inspect",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
@@ -754,14 +779,10 @@
},
"request": "launch",
"name": "Windows: bun run [file] --inspect-brk",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["run", "${fileBasename}"],
"cwd": "${fileDirname}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
@@ -789,16 +810,16 @@
},
"request": "launch",
"name": "Windows: bun test [...]",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -814,16 +835,16 @@
},
"request": "launch",
"name": "Windows: bun test [...] (fast)",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -839,18 +860,18 @@
},
"request": "launch",
"name": "Windows: bun test [...] (verbose)",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "0",
},
{
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
"name": "BUN_GARBAGE_COLLECTOR_LEVEL",
"value": "2",
@@ -864,16 +885,16 @@
},
"request": "launch",
"name": "Windows: bun test [...] --watch",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "--watch", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -889,16 +910,16 @@
},
"request": "launch",
"name": "Windows: bun test [...] --hot",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "--hot", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -914,16 +935,16 @@
},
"request": "launch",
"name": "Windows: bun test [...] --inspect",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -948,16 +969,16 @@
},
"request": "launch",
"name": "Windows: bun test [...] --inspect-brk",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test", "${input:testName}"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -983,14 +1004,10 @@
},
"request": "launch",
"name": "Windows: bun exec [...]",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["exec", "${input:testName}"],
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
@@ -1009,14 +1026,10 @@
},
"request": "launch",
"name": "Windows: bun test [*]",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
@@ -1034,16 +1047,16 @@
},
"request": "launch",
"name": "Windows: bun test [*] (fast)",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
@@ -1059,17 +1072,17 @@
},
"request": "launch",
"name": "Windows: bun test [*] --inspect",
"program": "${workspaceFolder}/build/bun-debug.exe",
"program": "${workspaceFolder}/build/debug/bun-debug.exe",
"args": ["test"],
"cwd": "${workspaceFolder}/test",
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "FORCE_COLOR",
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "0",
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
"name": "BUN_GARBAGE_COLLECTOR_LEVEL",
@@ -1096,7 +1109,23 @@
"program": "node",
"args": ["test/runner.node.mjs"],
"cwd": "${workspaceFolder}",
"environment": [
{
"name": "BUN_DEBUG_QUIET_LOGS",
"value": "1",
},
{
"name": "BUN_DEBUG_jest",
"value": "1",
},
{
"name": "BUN_GARBAGE_COLLECTOR_LEVEL",
"value": "2",
},
],
"console": "internalConsole",
// Don't pause when the GC runs while the debugger is open.
"postRunCommands": ["command source '${workspaceFolder}/misctools/lldb/lldb_commands'"],
},
],
"inputs": [

18
.vscode/settings.json vendored
View File

@@ -12,9 +12,11 @@
"search.exclude": {
"node_modules": true,
".git": true,
"src/bun.js/WebKit": true,
"src/deps/*/**": true,
"vendor/*/**": true,
"test/node.js/upstream": true,
// This will fill up your whole search history.
"test/js/node/test/fixtures": true,
"test/js/node/test/common": true,
},
"search.followSymlinks": false,
"search.useIgnoreFiles": true,
@@ -27,13 +29,13 @@
// Zig
"zig.initialSetupDone": true,
"zig.buildOption": "build",
"zig.zls.zigLibPath": "${workspaceFolder}/src/deps/zig/lib",
"zig.buildArgs": ["-Dgenerated-code=./build/codegen"],
"zig.zls.zigLibPath": "${workspaceFolder}/vendor/zig/lib",
"zig.buildArgs": ["-Dgenerated-code=./build/debug/codegen"],
"zig.zls.buildOnSaveStep": "check",
// "zig.zls.enableBuildOnSave": true,
// "zig.buildOnSave": true,
"zig.buildFilePath": "${workspaceFolder}/build.zig",
"zig.path": "${workspaceFolder}/.cache/zig/zig.exe",
"zig.path": "${workspaceFolder}/vendor/zig/zig.exe",
"zig.formattingProvider": "zls",
"zig.zls.enableInlayHints": false,
"[zig]": {
@@ -50,12 +52,15 @@
"cmake.configureOnOpen": false,
"C_Cpp.errorSquiggles": "enabled",
"[cpp]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
"[c]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
"[h]": {
"editor.tabSize": 4,
"editor.defaultFormatter": "xaver.clang-format",
},
@@ -72,7 +77,7 @@
"prettier.prettierPath": "./node_modules/prettier",
// TypeScript
"typescript.tsdk": "${workspaceFolder}/node_modules/typescript/lib",
"typescript.tsdk": "node_modules/typescript/lib",
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
},
@@ -135,6 +140,7 @@
},
"files.associations": {
"*.idl": "cpp",
"array": "cpp",
},
"C_Cpp.files.exclude": {
"**/.vscode": true,

91
.vscode/tasks.json vendored
View File

@@ -2,50 +2,57 @@
"version": "2.0.0",
"tasks": [
{
"type": "process",
"label": "Install Dependencies",
"command": "scripts/all-dependencies.sh",
"windows": {
"command": "scripts/all-dependencies.ps1",
},
"icon": {
"id": "arrow-down",
},
"options": {
"cwd": "${workspaceFolder}",
},
},
{
"type": "process",
"label": "Setup Environment",
"dependsOn": ["Install Dependencies"],
"command": "scripts/setup.sh",
"windows": {
"command": "scripts/setup.ps1",
},
"icon": {
"id": "check",
},
"options": {
"cwd": "${workspaceFolder}",
},
},
{
"type": "process",
"label": "Build Bun",
"dependsOn": ["Setup Environment"],
"command": "bun",
"args": ["run", "build"],
"icon": {
"id": "gear",
"type": "shell",
"command": "bun run build",
"group": {
"kind": "build",
"isDefault": true,
},
"options": {
"cwd": "${workspaceFolder}",
},
"isBuildCommand": true,
"runOptions": {
"instanceLimit": 1,
"reevaluateOnRerun": true,
"problemMatcher": [
{
"owner": "zig",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^(.+?):(\\d+):(\\d+): (error|warning|note): (.+)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
},
{
"regexp": "^\\s+(.+)$",
"message": 1,
"loop": true,
},
],
},
{
"owner": "clang",
"fileLocation": ["relative", "${workspaceFolder}"],
"pattern": [
{
"regexp": "^([^:]+):(\\d+):(\\d+):\\s+(warning|error|note|remark):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5,
},
{
"regexp": "^\\s*(.*)$",
"message": 1,
"loop": true,
},
],
},
],
"presentation": {
"reveal": "always",
"panel": "shared",
"clear": true,
},
},
],

File diff suppressed because it is too large Load Diff

View File

@@ -2,16 +2,11 @@ Configuring a development environment for Bun can take 10-30 minutes depending o
If you are using Windows, please refer to [this guide](/docs/project/building-windows)
{% details summary="For Ubuntu users" %}
TL;DR: Ubuntu 22.04 is suggested.
Bun currently requires `glibc >=2.32` in development which means if you're on Ubuntu 20.04 (glibc == 2.31), you may likely meet `error: undefined symbol: __libc_single_threaded `. You need to take extra configurations. Also, according to this [issue](https://github.com/llvm/llvm-project/issues/97314), LLVM 16 is no longer maintained on Ubuntu 24.04 (noble). And instead, you might want `brew` to install LLVM 16 for your Ubuntu 24.04.
{% /details %}
## Install Dependencies
Using your system's package manager, install Bun's dependencies:
{% codetabs %}
{% codetabs group="os" %}
```bash#macOS (Homebrew)
$ brew install automake ccache cmake coreutils gnu-sed go icu4c libiconv libtool ninja pkg-config rust ruby
@@ -30,7 +25,7 @@ $ sudo dnf install cargo ccache cmake git golang libtool ninja-build pkg-config
```
```bash#openSUSE Tumbleweed
$ sudo zypper install go cmake ninja automake git rustup && rustup toolchain install stable
$ sudo zypper install go cmake ninja automake git icu rustup && rustup toolchain install stable
```
{% /codetabs %}
@@ -58,12 +53,12 @@ $ brew install bun
## Install LLVM
Bun requires LLVM 16 (`clang` is part of LLVM). This version requirement is to match WebKit (precompiled), as mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
Bun requires LLVM 18 (`clang` is part of LLVM). This version requirement is to match WebKit (precompiled), as mismatching versions will cause memory allocation failures at runtime. In most cases, you can install LLVM through your system package manager:
{% codetabs %}
{% codetabs group="os" %}
```bash#macOS (Homebrew)
$ brew install llvm@16
$ brew install llvm@18
```
```bash#Ubuntu/Debian
@@ -77,8 +72,8 @@ $ sudo pacman -S llvm clang lld
```bash#Fedora
$ sudo dnf install 'dnf-command(copr)'
$ sudo dnf copr enable -y @fedora-llvm-team/llvm-snapshots
$ sudo dnf install llvm clang lld
$ sudo dnf copr enable -y @fedora-llvm-team/llvm17
$ sudo dnf install llvm16 clang16 lld16-devel
```
```bash#openSUSE Tumbleweed
@@ -89,7 +84,7 @@ $ sudo zypper install clang16 lld16 llvm16
If none of the above solutions apply, you will have to install it [manually](https://github.com/llvm/llvm-project/releases/tag/llvmorg-16.0.6).
Make sure Clang/LLVM 16 is in your path:
Make sure Clang/LLVM 18 is in your path:
```bash
$ which clang-16
@@ -97,7 +92,7 @@ $ which clang-16
If not, run this to manually add it:
{% codetabs %}
{% codetabs group="os" %}
```bash#macOS (Homebrew)
# use fish_add_path if you're using fish
@@ -116,42 +111,26 @@ $ export PATH="$PATH:/usr/lib/llvm16/bin"
## Building Bun
After cloning the repository, run the following command to run the first build. This may take a while as it will clone submodules and build dependencies.
```bash
$ bun setup
```
The binary will be located at `./build/bun-debug`. It is recommended to add this to your `$PATH`. To verify the build worked, let's print the version number on the development build of Bun.
```bash
$ build/bun-debug --version
x.y.z_debug
```
To rebuild, you can invoke `bun run build`
After cloning the repository, run the following command to build. This may take a while as it will clone submodules and build dependencies.
```bash
$ bun run build
```
These two scripts, `setup` and `build`, are aliases to do roughly the following:
The binary will be located at `./build/debug/bun-debug`. It is recommended to add this to your `$PATH`. To verify the build worked, let's print the version number on the development build of Bun.
```bash
$ ./scripts/setup.sh
$ cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Debug
$ ninja -C build # 'bun run build' runs just this
$ build/debug/bun-debug --version
x.y.z_debug
```
Advanced users can pass CMake flags to customize the build.
## VSCode
VSCode is the recommended IDE for working on Bun, as it has been configured. Once opening, you can run `Extensions: Show Recommended Extensions` to install the recommended extensions for Zig and C++. ZLS is automatically configured.
If you use a different editor, make sure that you tell ZLS to use the automatically installed Zig compiler, which is located at `./.cache/zig/zig.exe`. The filename is `zig.exe` so that it works as expected on Windows, but it still works on macOS/Linux (it just has a surprising file extension).
If you use a different editor, make sure that you tell ZLS to use the automatically installed Zig compiler, which is located at `./vendor/zig/zig.exe`. The filename is `zig.exe` so that it works as expected on Windows, but it still works on macOS/Linux (it just has a surprising file extension).
We recommend adding `./build` to your `$PATH` so that you can run `bun-debug` in your terminal:
We recommend adding `./build/debug` to your `$PATH` so that you can run `bun-debug` in your terminal:
```sh
$ bun-debug
@@ -163,8 +142,8 @@ Several code generation scripts are used during Bun's build process. These are r
In particular, these are:
- `./src/codegen/generate-jssink.ts` -- Generates `build/codegen/JSSink.cpp`, `build/codegen/JSSink.h` which implement various classes for interfacing with `ReadableStream`. This is internally how `FileSink`, `ArrayBufferSink`, `"type": "direct"` streams and other code related to streams works.
- `./src/codegen/generate-classes.ts` -- Generates `build/codegen/ZigGeneratedClasses*`, which generates Zig & C++ bindings for JavaScriptCore classes implemented in Zig. In `**/*.classes.ts` files, we define the interfaces for various classes, methods, prototypes, getters/setters etc which the code generator reads to generate boilerplate code implementing the JavaScript objects in C++ and wiring them up to Zig
- `./src/codegen/generate-jssink.ts` -- Generates `build/debug/codegen/JSSink.cpp`, `build/debug/codegen/JSSink.h` which implement various classes for interfacing with `ReadableStream`. This is internally how `FileSink`, `ArrayBufferSink`, `"type": "direct"` streams and other code related to streams works.
- `./src/codegen/generate-classes.ts` -- Generates `build/debug/codegen/ZigGeneratedClasses*`, which generates Zig & C++ bindings for JavaScriptCore classes implemented in Zig. In `**/*.classes.ts` files, we define the interfaces for various classes, methods, prototypes, getters/setters etc which the code generator reads to generate boilerplate code implementing the JavaScript objects in C++ and wiring them up to Zig
- `./src/codegen/bundle-modules.ts` -- Bundles built-in modules like `node:fs`, `bun:ffi` into files we can include in the final binary. In development, these can be reloaded without rebuilding Zig (you still need to run `bun run build`, but it re-reads the transpiled files from disk afterwards). In release builds, these are embedded into the binary.
- `./src/codegen/bundle-functions.ts` -- Bundles globally-accessible functions implemented in JavaScript/TypeScript like `ReadableStream`, `WritableStream`, and a handful more. These are used similarly to the builtin modules, but the output more closely aligns with what WebKit/Safari does for Safari's built-in functions so that we can copy-paste the implementations from WebKit as a starting point.
@@ -180,7 +159,7 @@ To compile a release build of Bun, run:
$ bun run build:release
```
The binary will be located at `./build-release/bun` and `./build-release/bun-profile`.
The binary will be located at `./build/release/bun` and `./build/release/bun-profile`.
### Download release build from pull requests
@@ -189,8 +168,8 @@ To save you time spent building a release build locally, we provide a way to run
To run a release build from a pull request, you can use the `bun-pr` npm package:
```sh
bunx bun-pr pr-number
bunx bun-pr branch/branch-name
bunx bun-pr <pr-number>
bunx bun-pr <branch-name>
bunx bun-pr "https://github.com/oven-sh/bun/pull/1234566"
```
@@ -222,24 +201,18 @@ $ valgrind --fair-sched=try --track-origins=yes bun-debug <args>
## Building WebKit locally + Debug mode of JSC
{% callout %}
**TODO**: This is out of date. TLDR is pass `-DUSE_DEBUG_JSC=1` or `-DWEBKIT_DIR=...` to CMake. it will probably need more fiddling. ask @paperdave if you need this.
{% /callout %}
WebKit is not cloned by default (to save time and disk space). To clone and build WebKit locally, run:
```bash
# once you run this, `make submodule` can be used to automatically
# update WebKit and the other submodules
$ git submodule update --init --depth 1 --checkout src/bun.js/WebKit
# to make a jsc release build
$ make jsc
# JSC debug build does not work perfectly with Bun yet, this is actively being
# worked on and will eventually become the default.
$ make jsc-build-linux-compile-debug cpp
$ make jsc-build-mac-compile-debug cpp
# Clone WebKit into ./vendor/WebKit
$ git clone https://github.com/oven-sh/WebKit vendor/WebKit
# Make a debug build of JSC. This will output build artifacts in ./vendor/WebKit/WebKitBuild/Debug
# Optionally, you can use `make jsc` for a release build
$ make jsc-debug
# Build bun with the local JSC build
$ bun run build:local
```
Note that the WebKit folder, including build artifacts, is 8GB+ in size.
@@ -307,17 +280,17 @@ If you see this error when compiling, run:
$ xcode-select --install
```
## Cannot find `libatomic.a`
### Cannot find `libatomic.a`
Bun defaults to linking `libatomic` statically, as not all systems have it. If you are building on a distro that does not have a static libatomic available, you can run the following command to enable dynamic linking:
```bash
$ bun setup -DUSE_STATIC_LIBATOMIC=OFF
$ bun run build -DUSE_STATIC_LIBATOMIC=OFF
```
The built version of Bun may not work on other systems if compiled this way.
## ccache conflicts with building TinyCC on macOS
### ccache conflicts with building TinyCC on macOS
If you run into issues with `ccache` when building TinyCC, try reinstalling ccache
@@ -325,3 +298,9 @@ If you run into issues with `ccache` when building TinyCC, try reinstalling ccac
brew uninstall ccache
brew install ccache
```
## Using bun-debug
- Disable logging: `BUN_DEBUG_QUIET_LOGS=1 bun-debug ...` (to disable all debug logging)
- Enable logging for a specific zig scope: `BUN_DEBUG_EventLoop=1 bun-debug ...` (to allow `std.log.scoped(.EventLoop)`)
- Bun transpiles every file it runs, to see the actual executed source in a debug build find it in `/tmp/bun-debug-src/...path/to/file`, for example the transpiled version of `/home/bun/index.ts` would be in `/tmp/bun-debug-src/home/bun/index.ts`

View File

@@ -1,645 +0,0 @@
# This Dockerfile is used by CI workflows to build Bun. It is not intended as a development
# environment, or to be used as a base image for other projects.
#
# You likely want this image instead: https://hub.docker.com/r/oven/bun
#
# TODO: move this file to reduce confusion
ARG DEBIAN_FRONTEND=noninteractive
ARG GITHUB_WORKSPACE=/build
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 CPU_TARGET=native
ARG ARCH=x86_64
ARG BUILD_MACHINE_ARCH=x86_64
ARG BUILDARCH=amd64
ARG TRIPLET=${ARCH}-linux-gnu
ARG GIT_SHA=""
ARG BUN_VERSION="bun-v1.1.4"
ARG BUN_DOWNLOAD_URL_BASE="https://pub-5e11e972747a44bf9aaf9394f185a982.r2.dev/releases/${BUN_VERSION}"
ARG CANARY=0
ARG ASSERTIONS=OFF
ARG ZIG_OPTIMIZE=ReleaseFast
ARG CMAKE_BUILD_TYPE=Release
ARG NODE_VERSION="20"
ARG LLVM_VERSION="16"
ARG ZIG_VERSION="0.13.0"
ARG ZIG_VERSION_SHORT="0.13.0"
ARG SCCACHE_BUCKET
ARG SCCACHE_REGION
ARG SCCACHE_S3_USE_SSL
ARG SCCACHE_ENDPOINT
ARG AWS_ACCESS_KEY_ID
ARG AWS_SECRET_ACCESS_KEY
FROM bitnami/minideb:bullseye as bun-base
ARG BUN_DOWNLOAD_URL_BASE
ARG DEBIAN_FRONTEND
ARG BUN_VERSION
ARG NODE_VERSION
ARG LLVM_VERSION
ARG BUILD_MACHINE_ARCH
ARG BUN_DIR
ARG BUN_DEPS_OUT_DIR
ARG CPU_TARGET
ENV CI 1
ENV CPU_TARGET=${CPU_TARGET}
ENV BUILDARCH=${BUILDARCH}
ENV BUN_DEPS_OUT_DIR=${BUN_DEPS_OUT_DIR}
ENV USE_LTO 1
ENV LC_CTYPE=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
ENV SCCACHE_BUCKET=${SCCACHE_BUCKET}
ENV SCCACHE_REGION=${SCCACHE_REGION}
ENV SCCACHE_S3_USE_SSL=${SCCACHE_S3_USE_SSL}
ENV SCCACHE_ENDPOINT=${SCCACHE_ENDPOINT}
ENV AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
ENV AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
RUN install_packages \
ca-certificates \
curl \
gnupg \
&& echo "deb https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${LLVM_VERSION} main" > /etc/apt/sources.list.d/llvm.list \
&& echo "deb-src https://apt.llvm.org/bullseye/ llvm-toolchain-bullseye-${LLVM_VERSION} main" >> /etc/apt/sources.list.d/llvm.list \
&& curl -fsSL "https://apt.llvm.org/llvm-snapshot.gpg.key" | apt-key add - \
&& echo "deb https://deb.nodesource.com/node_${NODE_VERSION}.x nodistro main" > /etc/apt/sources.list.d/nodesource.list \
&& curl -fsSL "https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key" | apt-key add - \
&& echo "deb https://apt.kitware.com/ubuntu/ focal main" > /etc/apt/sources.list.d/kitware.list \
&& curl -fsSL "https://apt.kitware.com/keys/kitware-archive-latest.asc" | apt-key add - \
&& install_packages \
wget \
bash \
software-properties-common \
build-essential \
autoconf \
automake \
libtool \
pkg-config \
clang-${LLVM_VERSION} \
lld-${LLVM_VERSION} \
lldb-${LLVM_VERSION} \
clangd-${LLVM_VERSION} \
libc++-${LLVM_VERSION}-dev \
libc++abi-${LLVM_VERSION}-dev \
llvm-${LLVM_VERSION}-runtime \
llvm-${LLVM_VERSION}-dev \
make \
cmake \
ninja-build \
file \
libc-dev \
libxml2 \
libxml2-dev \
xz-utils \
git \
tar \
rsync \
gzip \
unzip \
perl \
python3 \
ruby \
ruby-dev \
golang \
nodejs && \
for f in /usr/lib/llvm-${LLVM_VERSION}/bin/*; do ln -sf "$f" /usr/bin; done \
&& ln -sf /usr/bin/clang-${LLVM_VERSION} /usr/bin/clang \
&& ln -sf /usr/bin/clang++-${LLVM_VERSION} /usr/bin/clang++ \
&& ln -sf /usr/bin/lld-${LLVM_VERSION} /usr/bin/lld \
&& ln -sf /usr/bin/lldb-${LLVM_VERSION} /usr/bin/lldb \
&& ln -sf /usr/bin/clangd-${LLVM_VERSION} /usr/bin/clangd \
&& ln -sf /usr/bin/llvm-ar-${LLVM_VERSION} /usr/bin/llvm-ar \
&& ln -sf /usr/bin/ld.lld /usr/bin/ld \
&& ln -sf /usr/bin/llvm-ranlib-${LLVM_VERSION} /usr/bin/ranlib \
&& ln -sf /usr/bin/clang /usr/bin/cc \
&& ln -sf /usr/bin/clang /usr/bin/c89 \
&& ln -sf /usr/bin/clang /usr/bin/c99 \
&& ln -sf /usr/bin/clang++ /usr/bin/c++ \
&& ln -sf /usr/bin/clang++ /usr/bin/g++ \
&& ln -sf /usr/bin/llvm-ar /usr/bin/ar \
&& ln -sf /usr/bin/clang /usr/bin/gcc \
&& arch="$(dpkg --print-architecture)" \
&& case "${arch##*-}" in \
amd64) variant="x64";; \
arm64) variant="aarch64";; \
*) echo "unsupported architecture: $arch"; exit 1 ;; \
esac \
&& wget "${BUN_DOWNLOAD_URL_BASE}/bun-linux-${variant}.zip" \
&& unzip bun-linux-${variant}.zip \
&& mv bun-linux-${variant}/bun /usr/bin/bun \
&& ln -s /usr/bin/bun /usr/bin/bunx \
&& rm -rf bun-linux-${variant} bun-linux-${variant}.zip \
&& mkdir -p ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
# && if [ -n "${SCCACHE_BUCKET}" ]; then \
# echo "Setting up sccache" \
# && wget https://github.com/mozilla/sccache/releases/download/v0.5.4/sccache-v0.5.4-${BUILD_MACHINE_ARCH}-unknown-linux-musl.tar.gz \
# && tar xf sccache-v0.5.4-${BUILD_MACHINE_ARCH}-unknown-linux-musl.tar.gz \
# && mv sccache-v0.5.4-${BUILD_MACHINE_ARCH}-unknown-linux-musl/sccache /usr/bin/sccache \
# && rm -rf sccache-v0.5.4-${BUILD_MACHINE_ARCH}-unknown-linux-musl.tar.gz sccache-v0.5.4-${BUILD_MACHINE_ARCH}-unknown-linux-musl \
FROM bun-base as bun-base-with-zig
ARG ZIG_VERSION
ARG ZIG_VERSION_SHORT
ARG BUILD_MACHINE_ARCH
ARG ZIG_FOLDERNAME=zig-linux-${BUILD_MACHINE_ARCH}-${ZIG_VERSION}
ARG ZIG_FILENAME=${ZIG_FOLDERNAME}.tar.xz
ARG ZIG_URL="https://ziglang.org/builds/${ZIG_FILENAME}"
ARG ZIG_LOCAL_CACHE_DIR=/zig-cache
ENV ZIG_LOCAL_CACHE_DIR=${ZIG_LOCAL_CACHE_DIR}
WORKDIR $GITHUB_WORKSPACE
ADD $ZIG_URL .
RUN tar xf ${ZIG_FILENAME} \
&& mv ${ZIG_FOLDERNAME}/lib /usr/lib/zig \
&& mv ${ZIG_FOLDERNAME}/zig /usr/bin/zig \
&& rm -rf ${ZIG_FILENAME} ${ZIG_FOLDERNAME}
FROM bun-base as c-ares
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/c-ares ${BUN_DIR}/src/deps/c-ares
COPY scripts ${BUN_DIR}/scripts
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd $BUN_DIR \
&& bash ./scripts/build-cares.sh \
&& rm -rf ${BUN_DIR}/src/deps/c-ares ${BUN_DIR}/Makefile ${BUN_DIR}/scripts
FROM bun-base as lolhtml
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y
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
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
RUN --mount=type=cache,target=${CCACHE_DIR} \
export PATH=$PATH:$HOME/.cargo/bin \
&& cd ${BUN_DIR} \
&& make lolhtml \
&& rm -rf src/deps/lol-html Makefile
FROM bun-base as mimalloc
ARG BUN_DIR
ARG CPU_TARGET
ARG ASSERTIONS
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/mimalloc ${BUN_DIR}/src/deps/mimalloc
COPY scripts ${BUN_DIR}/scripts
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd ${BUN_DIR} \
&& bash ./scripts/build-mimalloc.sh \
&& rm -rf src/deps/mimalloc Makefile
FROM bun-base as mimalloc-debug
ARG BUN_DIR
ARG CPU_TARGET
ARG ASSERTIONS
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/mimalloc ${BUN_DIR}/src/deps/mimalloc
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd ${BUN_DIR} \
&& make mimalloc-debug \
&& rm -rf src/deps/mimalloc Makefile
FROM bun-base as zlib
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
COPY Makefile ${BUN_DIR}/Makefile
COPY CMakeLists.txt ${BUN_DIR}/CMakeLists.txt
COPY scripts ${BUN_DIR}/scripts
COPY src/deps/zlib ${BUN_DIR}/src/deps/zlib
COPY package.json bun.lockb Makefile .gitmodules ${BUN_DIR}/
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd $BUN_DIR \
&& bash ./scripts/build-zlib.sh && rm -rf src/deps/zlib scripts
FROM bun-base as libdeflate
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
COPY Makefile ${BUN_DIR}/Makefile
COPY CMakeLists.txt ${BUN_DIR}/CMakeLists.txt
COPY scripts ${BUN_DIR}/scripts
COPY src/deps/libdeflate ${BUN_DIR}/src/deps/libdeflate
COPY package.json bun.lockb Makefile .gitmodules ${BUN_DIR}/
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd $BUN_DIR \
&& bash ./scripts/build-libdeflate.sh && rm -rf src/deps/libdeflate scripts
FROM bun-base as libarchive
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
RUN install_packages autoconf automake libtool pkg-config
COPY scripts ${BUN_DIR}/scripts
COPY src/deps/libarchive ${BUN_DIR}/src/deps/libarchive
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd $BUN_DIR \
&& bash ./scripts/build-libarchive.sh && rm -rf src/deps/libarchive .scripts
FROM bun-base as tinycc
ARG BUN_DEPS_OUT_DIR
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
RUN install_packages libtcc-dev && cp /usr/lib/$(uname -m)-linux-gnu/libtcc.a ${BUN_DEPS_OUT_DIR}
FROM bun-base as boringssl
RUN install_packages golang
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY Makefile ${BUN_DIR}/Makefile
COPY scripts ${BUN_DIR}/scripts
COPY src/deps/boringssl ${BUN_DIR}/src/deps/boringssl
WORKDIR $BUN_DIR
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd ${BUN_DIR} \
&& bash ./scripts/build-boringssl.sh \
&& rm -rf src/deps/boringssl Makefile
FROM bun-base as zstd
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/zstd ${BUN_DIR}/src/deps/zstd
COPY scripts ${BUN_DIR}/scripts
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd $BUN_DIR \
&& bash ./scripts/build-zstd.sh \
&& rm -rf src/deps/zstd scripts
FROM bun-base as ls-hpack
ARG BUN_DIR
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
COPY Makefile ${BUN_DIR}/Makefile
COPY src/deps/ls-hpack ${BUN_DIR}/src/deps/ls-hpack
COPY scripts ${BUN_DIR}/scripts
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=${CCACHE_DIR} \
cd $BUN_DIR \
&& bash ./scripts/build-lshpack.sh \
&& rm -rf src/deps/ls-hpack scripts
FROM bun-base-with-zig as bun-identifier-cache
ARG DEBIAN_FRONTEND
ARG GITHUB_WORKSPACE
ARG CPU_TARGET
ARG BUN_DIR
ENV CPU_TARGET=${CPU_TARGET}
WORKDIR $BUN_DIR
COPY src/js_lexer/identifier_data.zig ${BUN_DIR}/src/js_lexer/identifier_data.zig
COPY src/js_lexer/identifier_cache.zig ${BUN_DIR}/src/js_lexer/identifier_cache.zig
RUN --mount=type=cache,target=${ZIG_LOCAL_CACHE_DIR} \
cd $BUN_DIR \
&& zig run src/js_lexer/identifier_data.zig
FROM bun-base as bun-node-fallbacks
ARG BUN_DIR
WORKDIR $BUN_DIR
COPY src/node-fallbacks ${BUN_DIR}/src/node-fallbacks
RUN cd $BUN_DIR/src/node-fallbacks \
&& bun install --frozen-lockfile \
&& bun run build \
&& rm -rf src/node-fallbacks/node_modules
FROM bun-base as bun-webkit
ARG BUILDARCH
ARG ASSERTIONS
COPY CMakeLists.txt ${BUN_DIR}/CMakeLists.txt
RUN mkdir ${BUN_DIR}/bun-webkit \
&& WEBKIT_TAG=$(grep 'set(WEBKIT_TAG' "${BUN_DIR}/CMakeLists.txt" | awk '{print $2}' | cut -f 1 -d ')') \
&& WEBKIT_SUFFIX=$(if [ "${ASSERTIONS}" = "ON" ]; then echo "debug"; else echo "lto"; fi) \
&& WEBKIT_URL="https://github.com/oven-sh/WebKit/releases/download/autobuild-${WEBKIT_TAG}/bun-webkit-linux-${BUILDARCH}-${WEBKIT_SUFFIX}.tar.gz" \
&& echo "Downloading ${WEBKIT_URL}" \
&& curl -fsSL "${WEBKIT_URL}" | tar -xz -C ${BUN_DIR}/bun-webkit --strip-components=1
FROM bun-base as bun-cpp-objects
ARG CANARY
ARG ASSERTIONS
COPY --from=bun-webkit ${BUN_DIR}/bun-webkit ${BUN_DIR}/bun-webkit
COPY packages ${BUN_DIR}/packages
COPY src ${BUN_DIR}/src
COPY CMakeLists.txt ${BUN_DIR}/CMakeLists.txt
COPY src/deps/boringssl/include ${BUN_DIR}/src/deps/boringssl/include
# for uWebSockets
COPY src/deps/libdeflate ${BUN_DIR}/src/deps/libdeflate
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
RUN --mount=type=cache,target=${CCACHE_DIR} mkdir ${BUN_DIR}/build \
&& cd ${BUN_DIR}/build \
&& mkdir -p tmp_modules tmp_functions js codegen \
&& cmake .. -GNinja -DCMAKE_BUILD_TYPE=Release -DUSE_LTO=ON -DUSE_DEBUG_JSC=${ASSERTIONS} -DBUN_CPP_ONLY=1 -DWEBKIT_DIR=/build/bun/bun-webkit -DCANARY=${CANARY} -DZIG_COMPILER=system \
&& bash compile-cpp-only.sh -v
FROM bun-base-with-zig as bun-codegen-for-zig
COPY package.json bun.lockb Makefile .gitmodules ${BUN_DIR}/
COPY src/runtime ${BUN_DIR}/src/runtime
COPY src/runtime.js src/runtime.bun.js ${BUN_DIR}/src/
COPY packages/bun-error ${BUN_DIR}/packages/bun-error
COPY packages/bun-types ${BUN_DIR}/packages/bun-types
COPY src/fallback.ts ${BUN_DIR}/src/fallback.ts
COPY src/api ${BUN_DIR}/src/api
WORKDIR $BUN_DIR
# TODO: move away from Makefile entirely
RUN --mount=type=cache,target=${ZIG_LOCAL_CACHE_DIR} \
bun install --frozen-lockfile \
&& make runtime_js fallback_decoder bun_error \
&& rm -rf src/runtime src/fallback.ts node_modules bun.lockb package.json Makefile
FROM bun-base-with-zig as bun-compile-zig-obj
ARG ZIG_PATH
ARG TRIPLET
ARG GIT_SHA
ARG CPU_TARGET
ARG CANARY=0
ARG ASSERTIONS=OFF
ARG ZIG_OPTIMIZE=ReleaseFast
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
COPY *.zig package.json CMakeLists.txt ${BUN_DIR}/
COPY completions ${BUN_DIR}/completions
COPY packages ${BUN_DIR}/packages
COPY src ${BUN_DIR}/src
COPY --from=bun-identifier-cache ${BUN_DIR}/src/js_lexer/*.blob ${BUN_DIR}/src/js_lexer/
COPY --from=bun-node-fallbacks ${BUN_DIR}/src/node-fallbacks/out ${BUN_DIR}/src/node-fallbacks/out
COPY --from=bun-codegen-for-zig ${BUN_DIR}/src/*.out.js ${BUN_DIR}/src/*.out.refresh.js ${BUN_DIR}/src/
COPY --from=bun-codegen-for-zig ${BUN_DIR}/packages/bun-error/dist ${BUN_DIR}/packages/bun-error/dist
WORKDIR $BUN_DIR
RUN --mount=type=cache,target=${CCACHE_DIR} \
--mount=type=cache,target=${ZIG_LOCAL_CACHE_DIR} \
mkdir -p build \
&& bun run $BUN_DIR/src/codegen/bundle-modules.ts --debug=OFF $BUN_DIR/build \
&& cd build \
&& cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DUSE_LTO=ON \
-DZIG_OPTIMIZE="${ZIG_OPTIMIZE}" \
-DCPU_TARGET="${CPU_TARGET}" \
-DZIG_TARGET="${TRIPLET}" \
-DWEBKIT_DIR="omit" \
-DNO_CONFIGURE_DEPENDS=1 \
-DNO_CODEGEN=1 \
-DBUN_ZIG_OBJ_DIR="/tmp" \
-DCANARY="${CANARY}" \
-DZIG_COMPILER=system \
-DZIG_LIB_DIR=$BUN_DIR/src/deps/zig/lib \
&& ONLY_ZIG=1 ninja "/tmp/bun-zig.o" -v
FROM scratch as build_release_obj
ARG CPU_TARGET
ENV CPU_TARGET=${CPU_TARGET}
COPY --from=bun-compile-zig-obj /tmp/bun-zig.o /
FROM bun-base as bun-link
ARG CPU_TARGET
ARG CANARY
ARG ASSERTIONS
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
ARG ZIG_LOCAL_CACHE_DIR=/zig-cache
ENV ZIG_LOCAL_CACHE_DIR=${ZIG_LOCAL_CACHE_DIR}
WORKDIR $BUN_DIR
RUN mkdir -p build bun-webkit
# lol
COPY src/bun.js/bindings/sqlite/sqlite3.c ${BUN_DIR}/src/bun.js/bindings/sqlite/sqlite3.c
COPY src/deps/brotli ${BUN_DIR}/src/deps/brotli
COPY src/symbols.dyn src/linker.lds ${BUN_DIR}/src/
COPY CMakeLists.txt ${BUN_DIR}/CMakeLists.txt
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=libdeflate ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=libarchive ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=lolhtml ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=mimalloc ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=zstd ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=c-ares ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=ls-hpack ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=bun-compile-zig-obj /tmp/bun-zig.o ${BUN_DIR}/build/bun-zig.o
COPY --from=bun-cpp-objects ${BUN_DIR}/build/*.a ${BUN_DIR}/build/
COPY --from=bun-cpp-objects ${BUN_DIR}/build/*.o ${BUN_DIR}/build/
COPY --from=bun-cpp-objects ${BUN_DIR}/bun-webkit/lib ${BUN_DIR}/bun-webkit/lib
WORKDIR $BUN_DIR/build
RUN --mount=type=cache,target=${CCACHE_DIR} \
--mount=type=cache,target=${ZIG_LOCAL_CACHE_DIR} \
cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUN_LINK_ONLY=1 \
-DBUN_ZIG_OBJ_DIR="${BUN_DIR}/build" \
-DUSE_LTO=ON \
-DUSE_DEBUG_JSC=${ASSERTIONS} \
-DBUN_CPP_ARCHIVE="${BUN_DIR}/build/bun-cpp-objects.a" \
-DWEBKIT_DIR="${BUN_DIR}/bun-webkit" \
-DBUN_DEPS_OUT_DIR="${BUN_DEPS_OUT_DIR}" \
-DCPU_TARGET="${CPU_TARGET}" \
-DNO_CONFIGURE_DEPENDS=1 \
-DCANARY="${CANARY}" \
-DZIG_COMPILER=system \
&& ninja -v \
&& ./bun --revision \
&& mkdir -p /build/out \
&& mv bun bun-profile /build/out \
&& rm -rf ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
FROM scratch as artifact
COPY --from=bun-link /build/out /
FROM bun-base as bun-link-assertions
ARG CPU_TARGET
ARG CANARY
ARG ASSERTIONS
ENV CPU_TARGET=${CPU_TARGET}
ARG CCACHE_DIR=/ccache
ENV CCACHE_DIR=${CCACHE_DIR}
ARG ZIG_LOCAL_CACHE_DIR=/zig-cache
ENV ZIG_LOCAL_CACHE_DIR=${ZIG_LOCAL_CACHE_DIR}
WORKDIR $BUN_DIR
RUN mkdir -p build bun-webkit
# lol
COPY src/bun.js/bindings/sqlite/sqlite3.c ${BUN_DIR}/src/bun.js/bindings/sqlite/sqlite3.c
COPY src/symbols.dyn src/linker.lds ${BUN_DIR}/src/
COPY CMakeLists.txt ${BUN_DIR}/CMakeLists.txt
COPY --from=zlib ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=libarchive ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=boringssl ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=lolhtml ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=mimalloc-debug ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=zstd ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=tinycc ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=c-ares ${BUN_DEPS_OUT_DIR}/* ${BUN_DEPS_OUT_DIR}/
COPY --from=bun-compile-zig-obj /tmp/bun-zig.o ${BUN_DIR}/build/bun-zig.o
COPY --from=bun-cpp-objects ${BUN_DIR}/build/bun-cpp-objects.a ${BUN_DIR}/build/bun-cpp-objects.a
COPY --from=bun-cpp-objects ${BUN_DIR}/bun-webkit/lib ${BUN_DIR}/bun-webkit/lib
WORKDIR $BUN_DIR/build
RUN --mount=type=cache,target=${CCACHE_DIR} \
--mount=type=cache,target=${ZIG_LOCAL_CACHE_DIR} \
cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DBUN_LINK_ONLY=1 \
-DBUN_ZIG_OBJ_DIR="${BUN_DIR}/build" \
-DUSE_DEBUG_JSC=ON \
-DBUN_CPP_ARCHIVE="${BUN_DIR}/build/bun-cpp-objects.a" \
-DWEBKIT_DIR="${BUN_DIR}/bun-webkit" \
-DBUN_DEPS_OUT_DIR="${BUN_DEPS_OUT_DIR}" \
-DCPU_TARGET="${CPU_TARGET}" \
-DNO_CONFIGURE_DEPENDS=1 \
-DCANARY="${CANARY}" \
-DZIG_COMPILER=system \
-DUSE_LTO=ON \
&& ninja -v \
&& ./bun --revision \
&& mkdir -p /build/out \
&& mv bun bun-profile /build/out \
&& rm -rf ${BUN_DIR} ${BUN_DEPS_OUT_DIR}
FROM scratch as artifact-assertions
COPY --from=bun-link-assertions /build/out /

2
LATEST
View File

@@ -1 +1 @@
1.1.21
1.1.42

View File

@@ -1,3 +1,10 @@
# ------------------------------------------------------------
# WARNING
# ------------------------------------------------------------
# This file is very old and will be removed soon!
# You can build Bun using `cmake` or `bun run build`
# ------------------------------------------------------------
SHELL := $(shell which bash) # Use bash syntax to be consistent
OS_NAME := $(shell uname -s | tr '[:upper:]' '[:lower:]')
@@ -70,7 +77,7 @@ BUN_RELEASE_BIN = $(PACKAGE_DIR)/bun
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_DIR ?= $(realpath vendor/WebKit)
WEBKIT_RELEASE_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Release
WEBKIT_DEBUG_DIR ?= $(WEBKIT_DIR)/WebKitBuild/Debug
WEBKIT_RELEASE_DIR_LTO ?= $(WEBKIT_DIR)/WebKitBuild/ReleaseLTO
@@ -131,8 +138,8 @@ endif
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
BUN_DEPS_OUT_DIR ?= $(shell pwd)/build/bun-deps
BUN_DEPS_DIR ?= $(shell pwd)/vendor
BUN_DEPS_OUT_DIR ?= $(shell pwd)/build/release
CPU_COUNT = 2
ifeq ($(OS_NAME),darwin)
CPU_COUNT = $(shell sysctl -n hw.logicalcpu)
@@ -366,7 +373,7 @@ ifeq ($(OS_NAME),linux)
endif
ifeq ($(OS_NAME),darwin)
MACOS_MIN_FLAG=-mmacosx-version-min=$(MIN_MACOS_VERSION)
MACOS_MIN_FLAG=-mmacos-version-min=$(MIN_MACOS_VERSION)
POSIX_PKG_MANAGER=brew
INCLUDE_DIRS += $(MAC_INCLUDE_DIRS)
endif
@@ -682,19 +689,10 @@ assert-deps:
@test $(shell cargo --version | awk '{print $$2}' | cut -d. -f2) -gt 57 || (echo -e "ERROR: cargo version must be at least 1.57."; exit 1)
@echo "You have the dependencies installed! Woo"
# the following allows you to run `make submodule` to update or init submodules. but we will exclude webkit
# unless you explicitly clone it yourself (a huge download)
SUBMODULE_NAMES=$(shell cat .gitmodules | grep 'path = ' | awk '{print $$3}')
ifeq ("$(wildcard src/bun.js/WebKit/.git)", "")
SUBMODULE_NAMES := $(filter-out src/bun.js/WebKit, $(SUBMODULE_NAMES))
endif
.PHONY: init-submodules
init-submodules: submodule # (backwards-compatibility alias)
.PHONY: submodule
submodule: ## to init or update all submodules
git submodule update --init --recursive --progress --depth=1 --checkout $(SUBMODULE_NAMES)
.PHONY: build-obj
build-obj:
@@ -797,7 +795,7 @@ cls:
@echo -e "\n\n---\n\n"
jsc-check:
@ls $(JSC_BASE_DIR) >/dev/null 2>&1 || (echo -e "Failed to access WebKit build. Please compile the WebKit submodule using the Dockerfile at $(shell pwd)/src/javascript/WebKit/Dockerfile and then copy from /output in the Docker container to $(JSC_BASE_DIR). You can override the directory via JSC_BASE_DIR. \n\n DOCKER_BUILDKIT=1 docker build -t bun-webkit $(shell pwd)/src/bun.js/WebKit -f $(shell pwd)/src/bun.js/WebKit/Dockerfile --progress=plain\n\n docker container create bun-webkit\n\n # Get the container ID\n docker container ls\n\n docker cp DOCKER_CONTAINER_ID_YOU_JUST_FOUND:/output $(JSC_BASE_DIR)" && exit 1)
@ls $(JSC_BASE_DIR) >/dev/null 2>&1 || (echo -e "Failed to access WebKit build. Please compile the WebKit submodule using the Dockerfile at $(shell pwd)/src/javascript/WebKit/Dockerfile and then copy from /output in the Docker container to $(JSC_BASE_DIR). You can override the directory via JSC_BASE_DIR. \n\n DOCKER_BUILDKIT=1 docker build -t bun-webkit $(shell pwd)/vendor/WebKit -f $(shell pwd)/vendor/WebKit/Dockerfile --progress=plain\n\n docker container create bun-webkit\n\n # Get the container ID\n docker container ls\n\n docker cp DOCKER_CONTAINER_ID_YOU_JUST_FOUND:/output $(JSC_BASE_DIR)" && exit 1)
@ls $(JSC_INCLUDE_DIR) >/dev/null 2>&1 || (echo "Failed to access WebKit include directory at $(JSC_INCLUDE_DIR)." && exit 1)
@ls $(JSC_LIB) >/dev/null 2>&1 || (echo "Failed to access WebKit lib directory at $(JSC_LIB)." && exit 1)
@@ -928,7 +926,7 @@ bun-codesign-release-local-debug:
.PHONY: jsc
jsc: jsc-build jsc-copy-headers jsc-bindings
.PHONY: jsc-debug
jsc-debug: jsc-build-debug jsc-copy-headers-debug
jsc-debug: jsc-build-debug
.PHONY: jsc-build
jsc-build: $(JSC_BUILD_STEPS)
.PHONY: jsc-build-debug
@@ -938,7 +936,7 @@ 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
git -c submodule."vendor/WebKit".update=none submodule update --init --recursive --depth=1 --progress
.PHONY: headers
@@ -1258,7 +1256,7 @@ jsc-build-mac-compile:
-DENABLE_STATIC_JSC=ON \
-DENABLE_SINGLE_THREADED_VM_ENTRY_SCOPE=ON \
-DALLOW_LINE_AND_COLUMN_NUMBER_IN_BUILTINS=ON \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DUSE_THIN_ARCHIVES=OFF \
-DBUN_FAST_TLS=ON \
-DENABLE_FTL_JIT=ON \
@@ -1270,7 +1268,7 @@ jsc-build-mac-compile:
$(WEBKIT_DIR) \
$(WEBKIT_RELEASE_DIR) && \
CFLAGS="$(CFLAGS) -ffat-lto-objects" CXXFLAGS="$(CXXFLAGS) -ffat-lto-objects" \
cmake --build $(WEBKIT_RELEASE_DIR) --config Release --target jsc
cmake --build $(WEBKIT_RELEASE_DIR) --config RelWithDebInfo --target jsc
.PHONY: jsc-build-mac-compile-lto
jsc-build-mac-compile-lto:
@@ -1372,7 +1370,7 @@ jsc-build-linux-compile-config-debug:
$(WEBKIT_DEBUG_DIR)
# If you get "Error: could not load cache"
# run rm -rf src/bun.js/WebKit/CMakeCache.txt
# run rm -rf vendor/WebKit/CMakeCache.txt
.PHONY: jsc-build-linux-compile-build
jsc-build-linux-compile-build:
mkdir -p $(WEBKIT_RELEASE_DIR) && \
@@ -1389,10 +1387,10 @@ jsc-build-linux-compile-build-debug:
jsc-build-mac: jsc-force-fastjit jsc-build-mac-compile jsc-build-copy
jsc-build-mac-debug: jsc-force-fastjit jsc-build-mac-compile-debug jsc-build-copy-debug
jsc-build-mac-debug: jsc-force-fastjit jsc-build-mac-compile-debug
jsc-build-linux: jsc-build-linux-compile-config jsc-build-linux-compile-build jsc-build-copy
jsc-build-linux-debug: jsc-build-linux-compile-config-debug jsc-build-linux-compile-build-debug jsc-build-copy-debug
jsc-build-linux-debug: jsc-build-linux-compile-config-debug jsc-build-linux-compile-build-debug
jsc-build-copy:
cp $(WEBKIT_RELEASE_DIR)/lib/libJavaScriptCore.a $(BUN_DEPS_OUT_DIR)/libJavaScriptCore.a
@@ -1407,7 +1405,7 @@ jsc-build-copy-debug:
cp $(WEBKIT_DEBUG_DIR)/lib/libbmalloc.a $(BUN_DEPS_OUT_DIR)/libbmalloc.a
clean-jsc:
cd src/bun.js/WebKit && rm -rf **/CMakeCache.txt **/CMakeFiles && rm -rf src/bun.js/WebKit/WebKitBuild
cd vendor/WebKit && rm -rf **/CMakeCache.txt **/CMakeFiles && rm -rf vendor/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) $(OBJ_DIR)/*.d $(DEBUG_OBJ_DIR)/*.d

View File

@@ -1,5 +1,5 @@
<p align="center">
<a href="https://bun.sh"><img src="https://user-images.githubusercontent.com/709451/182802334-d9c42afe-f35d-4a7b-86ea-9985f73f20c3.png" alt="Logo" height=170></a>
<a href="https://bun.sh"><img src="https://github.com/user-attachments/assets/50282090-adfd-4ddb-9e27-c30753c6b161" alt="Logo" height=170></a>
</p>
<h1 align="center">Bun</h1>
@@ -24,8 +24,6 @@
## What is Bun?
> **Bun is under active development.** Use it to speed up your development workflows or run simpler production code in resource-constrained environments like serverless functions. We're working on more complete Node.js compatibility and integration with existing frameworks. Join the [Discord](https://bun.sh/discord) and watch the [GitHub repository](https://github.com/oven-sh/bun) to keep tabs on future releases.
Bun is an all-in-one toolkit for JavaScript and TypeScript apps. It ships as a single executable called `bun`.
At its core is the _Bun runtime_, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It's written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.
@@ -87,16 +85,19 @@ bun upgrade --canary
## Quick links
- Intro
- [What is Bun?](https://bun.sh/docs/index)
- [Installation](https://bun.sh/docs/installation)
- [Quickstart](https://bun.sh/docs/quickstart)
- [TypeScript](https://bun.sh/docs/typescript)
- Templating
- [`bun init`](https://bun.sh/docs/cli/init)
- [`bun create`](https://bun.sh/docs/cli/bun-create)
- Runtime
- [`bun run`](https://bun.sh/docs/cli/run)
- [File types](https://bun.sh/docs/runtime/loaders)
- [TypeScript](https://bun.sh/docs/runtime/typescript)
@@ -115,6 +116,7 @@ bun upgrade --canary
- [Framework API](https://bun.sh/docs/runtime/framework)
- Package manager
- [`bun install`](https://bun.sh/docs/cli/install)
- [`bun add`](https://bun.sh/docs/cli/add)
- [`bun remove`](https://bun.sh/docs/cli/remove)
@@ -130,6 +132,7 @@ bun upgrade --canary
- [Overrides and resolutions](https://bun.sh/docs/install/overrides)
- Bundler
- [`Bun.build`](https://bun.sh/docs/bundler)
- [Loaders](https://bun.sh/docs/bundler/loaders)
- [Plugins](https://bun.sh/docs/bundler/plugins)
@@ -137,6 +140,7 @@ bun upgrade --canary
- [vs esbuild](https://bun.sh/docs/bundler/vs-esbuild)
- Test runner
- [`bun test`](https://bun.sh/docs/cli/test)
- [Writing tests](https://bun.sh/docs/test/writing)
- [Watch mode](https://bun.sh/docs/test/hot)
@@ -148,9 +152,11 @@ bun upgrade --canary
- [Code coverage](https://bun.sh/docs/test/coverage)
- Package runner
- [`bunx`](https://bun.sh/docs/cli/bunx)
- API
- [HTTP server](https://bun.sh/docs/api/http)
- [WebSockets](https://bun.sh/docs/api/websockets)
- [Workers](https://bun.sh/docs/api/workers)
@@ -183,9 +189,10 @@ bun upgrade --canary
- [Building Windows](https://bun.sh/docs/project/building-windows)
- [License](https://bun.sh/docs/project/licensing)
## Guides
## Guides
- Binary
- Binary
- [Convert a Blob to a DataView](https://bun.sh/guides/binary/blob-to-dataview)
- [Convert a Blob to a ReadableStream](https://bun.sh/guides/binary/blob-to-stream)
- [Convert a Blob to a string](https://bun.sh/guides/binary/blob-to-string)
@@ -209,7 +216,8 @@ bun upgrade --canary
- [Convert an ArrayBuffer to a Uint8Array](https://bun.sh/guides/binary/arraybuffer-to-typedarray)
- [Convert an ArrayBuffer to an array of numbers](https://bun.sh/guides/binary/arraybuffer-to-array)
- Ecosystem
- Ecosystem
- [Build a frontend using Vite and Bun](https://bun.sh/guides/ecosystem/vite)
- [Build an app with Astro and Bun](https://bun.sh/guides/ecosystem/astro)
- [Build an app with Next.js and Bun](https://bun.sh/guides/ecosystem/nextjs)
@@ -236,7 +244,8 @@ bun upgrade --canary
- [Use React and JSX](https://bun.sh/guides/ecosystem/react)
- [Add Sentry to a Bun app](https://bun.sh/guides/ecosystem/sentry)
- HTTP
- HTTP
- [Common HTTP server usage](https://bun.sh/guides/http/server)
- [Configure TLS on an HTTP server](https://bun.sh/guides/http/tls)
- [fetch with unix domain sockets in Bun](https://bun.sh/guides/http/fetch-unix)
@@ -250,7 +259,8 @@ bun upgrade --canary
- [Upload files via HTTP using FormData](https://bun.sh/guides/http/file-uploads)
- [Write a simple HTTP server](https://bun.sh/guides/http/simple)
- Install
- Install
- [Add a dependency](https://bun.sh/guides/install/add)
- [Add a development dependency](https://bun.sh/guides/install/add-dev)
- [Add a Git dependency](https://bun.sh/guides/install/add-git)
@@ -268,7 +278,8 @@ bun upgrade --canary
- [Using bun install with an Azure Artifacts npm registry](https://bun.sh/guides/install/azure-artifacts)
- [Using bun install with Artifactory](https://bun.sh/guides/install/jfrog-artifactory)
- Process
- Process
- [Get the process uptime in nanoseconds](https://bun.sh/guides/process/nanoseconds)
- [Listen for CTRL+C](https://bun.sh/guides/process/ctrl-c)
- [Listen to OS signals](https://bun.sh/guides/process/os-signals)
@@ -279,7 +290,8 @@ bun upgrade --canary
- [Spawn a child process](https://bun.sh/guides/process/spawn)
- [Spawn a child process and communicate using IPC](https://bun.sh/guides/process/ipc)
- Read file
- Read file
- [Check if a file exists](https://bun.sh/guides/read-file/exists)
- [Get the MIME type of a file](https://bun.sh/guides/read-file/mime)
- [Read a file as a ReadableStream](https://bun.sh/guides/read-file/stream)
@@ -290,7 +302,8 @@ bun upgrade --canary
- [Read a JSON file](https://bun.sh/guides/read-file/json)
- [Watch a directory for changes](https://bun.sh/guides/read-file/watch)
- Runtime
- Runtime
- [Debugging Bun with the VS Code extension](https://bun.sh/guides/runtime/vscode-debugger)
- [Debugging Bun with the web debugger](https://bun.sh/guides/runtime/web-debugger)
- [Define and replace static globals & constants](https://bun.sh/guides/runtime/define-constant)
@@ -305,7 +318,8 @@ bun upgrade --canary
- [Set a time zone in Bun](https://bun.sh/guides/runtime/timezone)
- [Set environment variables](https://bun.sh/guides/runtime/set-env)
- Streams
- Streams
- [Convert a Node.js Readable to a Blob](https://bun.sh/guides/streams/node-readable-to-blob)
- [Convert a Node.js Readable to a string](https://bun.sh/guides/streams/node-readable-to-string)
- [Convert a Node.js Readable to an ArrayBuffer](https://bun.sh/guides/streams/node-readable-to-arraybuffer)
@@ -318,7 +332,8 @@ bun upgrade --canary
- [Convert a ReadableStream to an ArrayBuffer](https://bun.sh/guides/streams/to-arraybuffer)
- [Convert a ReadableStream to JSON](https://bun.sh/guides/streams/to-json)
- Test
- Test
- [Bail early with the Bun test runner](https://bun.sh/guides/test/bail)
- [Generate code coverage reports with the Bun test runner](https://bun.sh/guides/test/coverage)
- [Mark a test as a "todo" with the Bun test runner](https://bun.sh/guides/test/todo-tests)
@@ -336,7 +351,8 @@ bun upgrade --canary
- [Use snapshot testing in `bun test`](https://bun.sh/guides/test/snapshot)
- [Write browser DOM tests with Bun and happy-dom](https://bun.sh/guides/test/happy-dom)
- Util
- Util
- [Check if the current file is the entrypoint](https://bun.sh/guides/util/entrypoint)
- [Check if two objects are deeply equal](https://bun.sh/guides/util/deep-equals)
- [Compress and decompress data with DEFLATE](https://bun.sh/guides/util/deflate)
@@ -355,13 +371,14 @@ bun upgrade --canary
- [Hash a password](https://bun.sh/guides/util/hash-a-password)
- [Sleep for a fixed number of milliseconds](https://bun.sh/guides/util/sleep)
- WebSocket
- WebSocket
- [Build a publish-subscribe WebSocket server](https://bun.sh/guides/websocket/pubsub)
- [Build a simple WebSocket server](https://bun.sh/guides/websocket/simple)
- [Enable compression for WebSocket messages](https://bun.sh/guides/websocket/compression)
- [Set per-socket contextual data on a WebSocket](https://bun.sh/guides/websocket/context)
- Write file
- Write file
- [Append content to a file](https://bun.sh/guides/write-file/append)
- [Copy a file to another location](https://bun.sh/guides/write-file/file-cp)
- [Delete a file](https://bun.sh/guides/write-file/unlink)

View File

@@ -1,4 +1,4 @@
import { run, bench } from "mitata";
import { bench, run } from "../runner.mjs";
bench("sync", () => {});
bench("async", async () => {});

View File

@@ -1,4 +1,4 @@
import { run, bench } from "../node_modules/mitata/src/cli.mjs";
import { bench, run } from "../runner.mjs";
bench("sync", () => {});
bench("async", async () => {});

View File

@@ -1,4 +1,4 @@
import { run, bench } from "mitata";
import { bench, run } from "../runner.mjs";
bench("sync", () => {});
bench("async", async () => {});

View File

@@ -3,9 +3,9 @@
"scripts": {
"deps": "exit 0",
"build": "exit 0",
"bench:bun": "$BUN bun.js",
"bench:node": "$NODE node.mjs",
"bench:deno": "$DENO run -A --unstable deno.js",
"bench:bun": "bun bun.js",
"bench:node": "node node.mjs",
"bench:deno": "deno run -A --unstable deno.js",
"bench": "bun run bench:bun && bun run bench:node && bun run bench:deno"
}
}

Binary file not shown.

View File

@@ -1,5 +1,5 @@
import { copyFileSync, writeFileSync, readFileSync, statSync } from "node:fs";
import { bench, run } from "mitata";
import { copyFileSync, statSync, writeFileSync } from "node:fs";
import { bench, run } from "../runner.mjs";
function runner(ready) {
for (let size of [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000]) {

View File

@@ -0,0 +1,24 @@
import { bench, run } from "../runner.mjs";
const crypto = require("node:crypto");
const keyPair = crypto.generateKeyPairSync("rsa", {
modulusLength: 2048,
publicKeyEncoding: {
type: "spki",
format: "pem",
},
privateKeyEncoding: {
type: "pkcs8",
format: "pem",
},
});
// Max message size for 2048-bit RSA keys
const plaintext = crypto.getRandomValues(Buffer.alloc(214));
bench("RSA_PKCS1_OAEP_PADDING round-trip", () => {
const ciphertext = crypto.publicEncrypt(keyPair.publicKey, plaintext);
crypto.privateDecrypt(keyPair.privateKey, ciphertext);
});
await run();

View File

@@ -0,0 +1,24 @@
import { bench, run } from "../runner.mjs";
const crypto = require("node:crypto");
const keyPair = crypto.generateKeyPairSync("rsa", {
modulusLength: 2048,
publicKeyEncoding: {
type: "spki",
format: "pem",
},
privateKeyEncoding: {
type: "pkcs8",
format: "pem",
},
});
// Max message size for 2048-bit RSA keys
const plaintext = crypto.getRandomValues(Buffer.alloc(245));
bench("RSA sign RSA_PKCS1_PADDING round-trip", () => {
const sig = crypto.privateEncrypt(keyPair.privateKey, plaintext);
crypto.publicDecrypt(keyPair.publicKey, sig);
});
await run();

27
bench/deepEqual/map.js Normal file
View File

@@ -0,0 +1,27 @@
import { expect } from "bun:test";
import { bench, run } from "../runner.mjs";
const MAP_SIZE = 10_000;
function* genPairs(count) {
for (let i = 0; i < MAP_SIZE; i++) {
yield ["k" + i, "v" + i];
}
}
class CustomMap extends Map {
abc = 123;
constructor(iterable) {
super(iterable);
}
}
const a = new Map(genPairs());
const b = new Map(genPairs());
bench("deepEqual Map", () => expect(a).toEqual(b));
const x = new CustomMap(genPairs());
const y = new CustomMap(genPairs());
bench("deepEqual CustomMap", () => expect(x).toEqual(y));
await run();

27
bench/deepEqual/set.js Normal file
View File

@@ -0,0 +1,27 @@
import { expect } from "bun:test";
import { bench, run } from "../runner.mjs";
const SET_SIZE = 10_000;
function* genValues(count) {
for (let i = 0; i < SET_SIZE; i++) {
yield "v" + i;
}
}
class CustomSet extends Set {
abc = 123;
constructor(iterable) {
super(iterable);
}
}
const a = new Set(genValues());
const b = new Set(genValues());
bench("deepEqual Set", () => expect(a).toEqual(b));
const x = new CustomSet(genValues());
const y = new CustomSet(genValues());
bench("deepEqual CustomSet", () => expect(x).toEqual(y));
await run();

View File

@@ -1,6 +1,5 @@
import EventEmitter3 from "eventemitter3";
import { group } from "mitata";
import EventEmitterNative from "node:events";
import { group } from "../runner.mjs";
export const implementations = [
{

View File

@@ -1,4 +1,4 @@
import { bench, run } from "mitata";
import { bench, run } from "../runner.mjs";
import { groupForEmitter } from "./implementations.mjs";
var id = 0;

View File

@@ -1,4 +1,4 @@
import { bench, run } from "mitata";
import { bench, run } from "../runner.mjs";
import { groupForEmitter } from "./implementations.mjs";
var id = 0;

View File

@@ -1,4 +1,4 @@
import { bench, run } from "mitata";
import { bench, run } from "../runner.mjs";
import { groupForEmitter } from "./implementations.mjs";
// Pseudo RNG is derived from https://stackoverflow.com/a/424445

View File

@@ -1,5 +1,5 @@
// bun:test automatically rewrites this import to bun:test when run in bun
import { test, expect } from "@jest/globals";
import { expect, test } from "@jest/globals";
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
if (!Number.isSafeInteger(N)) {

View File

@@ -1,4 +1,4 @@
import { test, expect } from "vitest";
import { expect, test } from "vitest";
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
if (!Number.isSafeInteger(N)) {

View File

@@ -1,4 +1,4 @@
import { bench, run } from "mitata";
import { bench, run } from "../runner.mjs";
const count = 100;

View File

@@ -1,4 +1,4 @@
import { bench, run } from "mitata";
import { bench, run } from "../runner.mjs";
const count = 100;

View File

@@ -1,5 +1,5 @@
import { ptr, dlopen, CString, toBuffer } from "bun:ffi";
import { run, bench, group } from "mitata";
import { CString, dlopen, ptr } from "bun:ffi";
import { bench, group, run } from "../runner.mjs";
const { napiNoop, napiHash, napiString } = require(import.meta.dir + "/src/ffi_napi_bench.node");

View File

@@ -1,4 +1,4 @@
import { run, bench, group } from "../node_modules/mitata/src/cli.mjs";
import { bench, group, run } from "../runner.mjs";
const extension = "darwin" !== Deno.build.os ? "so" : "dylib";
const path = new URL("src/target/release/libffi_napi_bench." + extension, import.meta.url).pathname;

View File

@@ -1,5 +1,5 @@
import { run, bench, group } from "mitata";
import { createRequire } from "node:module";
import { bench, group, run } from "../runner.mjs";
const require = createRequire(import.meta.url);
const { napiNoop, napiHash, napiString } = require("./src/ffi_napi_bench.node");

View File

@@ -1,11 +1,11 @@
{
"name": "bench",
"scripts": {
"bench:bun": "$BUN bun.js",
"bench:node": "$NODE node.mjs",
"bench:bun": "bun bun.js",
"bench:node": "node node.mjs",
"deps": "cd src && bun run deps",
"build": "cd src && bun run build",
"bench:deno": "$DENO run -A --unstable deno.js",
"bench:deno": "deno run -A --unstable deno.js",
"bench": "bun run bench:bun && bun run bench:node && bun run bench:deno"
}
}

View File

@@ -1,5 +1,5 @@
import braces from "braces";
import { group, bench, run } from "mitata";
import { bench, group, run } from "../runner.mjs";
// const iterations = 1000;
const iterations = 100;
@@ -10,15 +10,16 @@ const veryComplexPattern = "{a,b,HI{c,e,LMAO{d,f}Q}}{1,2,{3,4},5}";
console.log(braces(complexPattern, { expand: true }));
function benchPattern(pattern, name) {
group({ name: `${name} pattern: "${pattern}"`, summary: true }, () => {
const _name = `${name} pattern: "${pattern}"`;
group({ name: _name, summary: true }, () => {
if (typeof Bun !== "undefined")
bench("Bun", () => {
bench(`Bun (${_name})`, () => {
for (let i = 0; i < iterations; i++) {
Bun.$.braces(pattern);
}
});
bench("micromatch/braces", () => {
bench(`micromatch/braces ${_name}`, () => {
for (let i = 0; i < iterations; i++) {
braces(pattern, { expand: true });
}

View File

@@ -1,5 +1,5 @@
import micromatch from "micromatch";
import { bench, run } from "mitata";
import { bench, run } from "../runner.mjs";
const Glob = typeof Bun !== "undefined" ? Bun.Glob : undefined;
const doMatch = typeof Bun === "undefined" ? micromatch.isMatch : (a, b) => new Glob(b).match(a);

View File

@@ -1,6 +1,6 @@
import { run, bench, group } from "mitata";
import fg from "fast-glob";
import { fdir } from "fdir";
import { bench, group, run } from "../runner.mjs";
const normalPattern = "*.ts";
const recursivePattern = "**/*.ts";

View File

@@ -0,0 +1,14 @@
syntax = "proto3";
package benchmark;
service BenchmarkService {
rpc Ping(Request) returns (Response);
}
message Request {
string message = 1;
}
message Response {
string message = 1;
}

View File

@@ -0,0 +1,33 @@
-----BEGIN CERTIFICATE-----
MIIFxjCCA66gAwIBAgIUUaQCzOcxcFBP0KwoQfNqD/FoI44wDQYJKoZIhvcNAQEL
BQAwYjELMAkGA1UEBhMCVVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1TYW4gRnJh
bmNpc2NvMQwwCgYDVQQKDANCdW4xDDAKBgNVBAsMA0J1bjESMBAGA1UEAwwJbG9j
YWxob3N0MB4XDTI0MTAxNjAwMDExNloXDTM0MTAxNDAwMDExNlowYjELMAkGA1UE
BhMCVVMxCzAJBgNVBAgMAkNBMRYwFAYDVQQHDA1TYW4gRnJhbmNpc2NvMQwwCgYD
VQQKDANCdW4xDDAKBgNVBAsMA0J1bjESMBAGA1UEAwwJbG9jYWxob3N0MIICIjAN
BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp2s1CWRRV3bkjUxyBefcRCiZj8v6
LIIWOb/kFJOo1PQsmQtOOWfY/kNEATPhLtEVolMzsQtaKV+u/Jnp6vU6cCU0qfQ/
cha/s0XaSn9zkJSXjmNOPDOXoeJ5wmSUvWETRvDgeYXCg84zTwRnD1pXIsKxHtia
SYkTC29skSn0+63GW2Ebzkbn3jcYbk3gfkRO/qw8EDh/4/TcS2SjoHl96E1QcfBX
InXrPGoHQhuqJV60rmmkVws0lTIZIq0g2p7iFDCg5TG1asakX7+CrEM/q+oyo3e8
RwMfc+9pqFEqyvXGIQSulS+CVKKbpAFMg07UGYe1t0s5iCwfLQ9apaKL31t/3Vkr
uVKgy5FrPLnRXkFXDZ1v+43AZBmdLrKODzsqHEbt2JmV0V6JVUkE4kbeJr/nlkhQ
x6yXloYY3VKbnCb1L3HmMInrK1QSpxlOb8RllTd33oBwd1FKEvH2gza0j9hqq8uQ
hWVN7tlamkgtBteZ8Y9fd3MdxD9iZOx4dVtCX1+sgJFdaL2ZgE0asojn46yT8Uqw
5d0M9vqmWc5AqG7c4UWWRrfB1MfOq/X8GtImmKyhEgizIPdWFeF1cNjhPffJv4yR
Y4Rj33OBTCM+9h8ZSw/fKo55yRXyz3bjrW2Mg8Dtq+6TcRd5gSLCaTN6jX8E9y7G
TobnA9MnKHhSIhsCAwEAAaN0MHIwHQYDVR0OBBYEFEJU6/9ELCp1CAxYJ5FJJxpV
FSRmMB8GA1UdIwQYMBaAFEJU6/9ELCp1CAxYJ5FJJxpVFSRmMA8GA1UdEwEB/wQF
MAMBAf8wHwYDVR0RBBgwFoIJbG9jYWxob3N0ggkxMjcuMC4wLjEwDQYJKoZIhvcN
AQELBQADggIBACyOPdVwfJg1aUNANy78+cm6eoInM9NDdXGWHMqCJwYF6qJTQV11
jYwYrl+OWOi3CEC+ogXl+uJX4tSS5d+rBTXEb73cLpogxP+xuxr4cBHhtgpGRpY0
GqWCFUTexHxXMrYhHQxf3uv79PNauw/dd1Baby1OjF3zSKRzFsv4KId97cAgT/9H
HfUo2ym5jmhNFj5rhUavO3Pw1++1eeDeDAkS6T59buzx0h9760WD20oBdgjt42cb
P6xg9OwV7ALQSwJ8YPEXpkl7u+6jy0j5ceYmXh76tAyA+hDYOJrY0opBjSPmXH99
p3W63gvk/AdfeAdbFHp6en0b04x4EIogOGZxBP35rzBvsQpqavBE3PBpUIyrQs5p
OBUncRrcjEDL6WKh6RJIjZnvpHPrEqOqyxaeWRc4+85ZrVArJHGMc8I+zs9uCFjo
Cjfde3d317kCszUTxo0l3azyBpr007PMIUoBF2VJEAyQp2Tz/yu0CbEscNJO/wCn
Sb1A6ojaQcgQe2hsaJz/mS+OOjHHaDbCp9iltP2CS63PYleEx4q1Bn8KVRy2zYTB
n74y4YaD8Q+hSA6zU741pzqK2SFCpBQnSz757ocr6WspQ47iOonX2giGZS/3KVeK
qNzU14+h0b8HaBqZmOvjF+S4G0HDpRwxPzDWgc7dEIWlzHH+ZCqjBFwL
-----END CERTIFICATE-----

View File

@@ -0,0 +1,31 @@
const grpc = require("@grpc/grpc-js");
const protoLoader = require("@grpc/proto-loader");
const packageDefinition = protoLoader.loadSync("benchmark.proto", {});
const proto = grpc.loadPackageDefinition(packageDefinition).benchmark;
const fs = require("fs");
function ping(call, callback) {
callback(null, { message: "Hello, World" });
}
function main() {
const server = new grpc.Server();
server.addService(proto.BenchmarkService.service, { ping: ping });
const tls = !!process.env.TLS && (process.env.TLS === "1" || process.env.TLS === "true");
const port = process.env.PORT || 50051;
const host = process.env.HOST || "localhost";
let credentials;
if (tls) {
const ca = fs.readFileSync("./cert.pem");
const key = fs.readFileSync("./key.pem");
const cert = fs.readFileSync("./cert.pem");
credentials = grpc.ServerCredentials.createSsl(ca, [{ private_key: key, cert_chain: cert }]);
} else {
credentials = grpc.ServerCredentials.createInsecure();
}
server.bindAsync(`${host}:${port}`, credentials, () => {
console.log(`Server running at ${tls ? "https" : "http"}://${host}:${port}`);
});
}
main();

52
bench/grpc-server/key.pem Normal file
View File

@@ -0,0 +1,52 @@
-----BEGIN PRIVATE KEY-----
MIIJQgIBADANBgkqhkiG9w0BAQEFAASCCSwwggkoAgEAAoICAQCnazUJZFFXduSN
THIF59xEKJmPy/osghY5v+QUk6jU9CyZC045Z9j+Q0QBM+Eu0RWiUzOxC1opX678
menq9TpwJTSp9D9yFr+zRdpKf3OQlJeOY048M5eh4nnCZJS9YRNG8OB5hcKDzjNP
BGcPWlciwrEe2JpJiRMLb2yRKfT7rcZbYRvORufeNxhuTeB+RE7+rDwQOH/j9NxL
ZKOgeX3oTVBx8Fcides8agdCG6olXrSuaaRXCzSVMhkirSDanuIUMKDlMbVqxqRf
v4KsQz+r6jKjd7xHAx9z72moUSrK9cYhBK6VL4JUopukAUyDTtQZh7W3SzmILB8t
D1qloovfW3/dWSu5UqDLkWs8udFeQVcNnW/7jcBkGZ0uso4POyocRu3YmZXRXolV
SQTiRt4mv+eWSFDHrJeWhhjdUpucJvUvceYwiesrVBKnGU5vxGWVN3fegHB3UUoS
8faDNrSP2Gqry5CFZU3u2VqaSC0G15nxj193cx3EP2Jk7Hh1W0JfX6yAkV1ovZmA
TRqyiOfjrJPxSrDl3Qz2+qZZzkCobtzhRZZGt8HUx86r9fwa0iaYrKESCLMg91YV
4XVw2OE998m/jJFjhGPfc4FMIz72HxlLD98qjnnJFfLPduOtbYyDwO2r7pNxF3mB
IsJpM3qNfwT3LsZOhucD0ycoeFIiGwIDAQABAoICAE+YYrDCZwHEXsjmzVcNcuVc
wBVjjt9WQabXGmLGCQClzgY9H8WfH8VSyaQgvDB762MvV2YW1ZjSCunBazrvuAbV
SYJ7wyZEtoNO9IdyrMjSPHPPtsRcavzmJalMFIMtAfM6Vh6wf1gW0sIAf9cGxmKa
WYcmx8OqTcmkAePKJNT7O1D6jDO39kjpvM3EbLTbWQsva6bylasVIR8fC8QhvsCQ
8WwaLfMOSPaCGk1Nxcjai+BYDW/sveUo2lZoJTSLUUT0EaqlxXCsXD3BWSj5F+5t
/AFHzdWdIHkIHB2P6V5xFu9fwHjhC3+dh42jqHLNKX2xza0FMKcTAwdzQ094RjL3
cOGIsa0Vdt7Mks5eLCRxz0xI3kyrbF0/CopxT0pVWZwUzPk1G+Z3HesWkVtQpg7u
RYzsoNKKc5mhc/V+vG290WAcNB4E3m85DgKQr4ib+J/rCy5/SnJYgg4QXsEyNlQ5
ESBtRmuPfnrPIxqrDKZ7ZsJv8XFWydXTOfJxeKR1T1S02iYna+z1FnNu+t0ELTr9
uhmkuqmV8RJVTub1P2EJPdiku/61UwNLyyZMgFjATDxB0hHIj1FP1HbfhEYbkYNc
Dl7a7egJ4KFYWpQ+7MzOmc0OKq1HuJ9H4FhoYpbVq1OQosZ6G3d9afKSZa6dFdK0
8ujvdQBR0NlAhc/LAr6BAoIBAQDfD3h9P4i5L8NCdocovCi3Eo0kcNQ3QuvnWrrs
B/9CLoWhJrcLV85d0dEX6lSYl9BWW02ilVB+Qvom2wS2td1CBUgDxovX4tCZCuXt
otYL/yWWOA7IG0Fjt6YEERQD/tRfKnn8hVBlk5cDTXXxHRGVMku4CHsN3ILtITQS
VnVsTrGoWd6mFFA9X9Qu4zR9wKtjGEuL7BT8ixxtXLa2tMjdc4UL140yAgmMemJS
TzC6EURe2OnhIzVe9yyLKcqw0prkGHg/Lau5lA1CAh67ZMY4EjO3cuda8R+O7vyO
z2afeaTORzzdEbSZPG+8oqIN1/RjRCbl3RXYN8ibSwOzp6X7AoIBAQDAJEVta98J
P2/36rXrkl6WrRfYqUPy6vgo/lPuRpp+BQ7ldgmH4+ZrJW5Mxa5hktVujk/C2kAO
auzhzNlsxR+c/KwtsL1JXwBn8CT1bR0qvi+URmvGQn9GOKrLLy+6cfphuZWuc4/r
hAgXzEjzPcJJJfxA1i2soKPbiFiCGHxot68P4uJSM2sU6QjNIxEjPbTJjEg894pD
GJoiRRVHgnzzxL3cqrK90Zn6MAl9f2tYihfddsENeZb5t84LBppxBSGouE3ZH8uD
Sufs4DSj1ptocbDbX+0kRNqfjTI5ivDxlS+ZKBe05PVTUmGBAWLamfCe89IW3/z+
Rfkh4ZBPtlphAoIBADwjSqPR7kWnN+iCVjxIRl3dNYpelQh1FW7hikW6fjpUmphw
/KalPLEUsV/WQIqHW5b8tLihsvrnidPR9rpf29BB5kGGVQuWThEE3CquXTEM0BBo
+qs+lemRiMPN6uyM1qr1o7/OHXfVS8CLMMIZyTTFQ57RQoPhMLdH3WcYQj46FTHD
UQDLtzpkzKr7fJpuyIZF9ZA6zQmtY7OkbGpj4Ue7LmKb8ahK3lIuaLWyPfvcTeeY
aa3WNTxuPWcjlE8J6NKYOksmQAcfgFeMhMaXC83wMltCMlfVbGG30wWZqxxRynoG
wMUFUgCCR8m+uxwqXewpYqdUbOBHYeFkXxIfn+MCggEAR5p8wQ1NHd4lNOekCfkP
BOnWlChoKRPFjUlSL97h3gq2hW6amKimitF1LGkS1kvo+/1O3heFfZn9UxyK/kzr
vg4vgAt4Tup3dUR6EXgrQW2Ev6YKreTEF4Awre2UxM+K9nY5wLxSKvuWJIA9w2AF
kkr0mZj3hniK99n02e6UFlY1iB8OJoIA6tb5L7FcxpxNTjrYBNhfDygQ8Kp8Bp0r
QZDVDHIUkEaXMjRKpRkiAOndgOurgAEK8V69C0DXtzypUX31jO+bYP8+NPlMxK3K
Vn7f4LD75+M88e6lg+oyZmUpStM1GnWksvtlWLUSiNKLaEEGzv2EA6JB+I1dwUb8
oQKCAQEAlmisUyn1/lpNnEzKsfUnRs53WxS2e1br5vJ5+pet3cjXT2btfp6J5/mf
Tfqv5mZfTjYxydG0Kl3afI/SnhTcRS2/s4svrktZYLOLM2PAGYdCV6j1stXl4ObO
eIfjzB3y1Zc2dEcWTylJ/lABoNGMPWFJQ67q8WS37pUHQPseJ++LmZFvlRyBgZBl
VLqiHHiZ2ax+yC1ZxY4RECtEiYFplspNldNe+bP/lzTJftsUDe1FqRT/SvEam+1f
kb//sbHkJ+l4BEv0Us3SIGwJ0BblhxLYO34IFVpheY4UQBy/nRaeUUdVR9r8JtYD
z/cCLOrUJfealezimyd8SKPWPeHhrA==
-----END PRIVATE KEY-----

View File

@@ -0,0 +1,15 @@
{
"name": "bench",
"scripts": {
"deps": "exit 0",
"build": "exit 0",
"bun:server": "TLS=1 PORT=50051 bun ./index.js",
"node:server": "TLS=1 PORT=50051 node ./index.js",
"bench": "ghz --cacert ./cert.pem --proto ./benchmark.proto --call benchmark.BenchmarkService.Ping -d '{\"message\": \"Hello\"}' --total=100000 localhost:50051",
"bench:insecure": "ghz --insecure --proto ./benchmark.proto --call benchmark.BenchmarkService.Ping -d '{\"message\": \"Hello\"}' --total=100000 localhost:50051"
},
"dependencies": {
"@grpc/grpc-js": "1.12.0",
"@grpc/proto-loader": "0.7.10"
}
}

View File

@@ -1,5 +1,5 @@
import { run, bench, group } from "mitata";
import { gzipSync, gunzipSync } from "bun";
import { gunzipSync, gzipSync } from "bun";
import { bench, group, run } from "../runner.mjs";
const data = await Bun.file(require.resolve("@babel/standalone/babel.min.js")).arrayBuffer();

View File

@@ -1,4 +1,4 @@
import { run, bench } from "../node_modules/mitata/src/cli.mjs";
import { bench, run } from "../runner.mjs";
const data = new TextEncoder().encode("Hello World!".repeat(9999));

View File

@@ -1,7 +1,7 @@
import { run, bench } from "mitata";
import { gzipSync, gunzipSync } from "zlib";
import { createRequire } from "module";
import { readFileSync } from "fs";
import { createRequire } from "module";
import { gunzipSync, gzipSync } from "zlib";
import { bench, run } from "../runner.mjs";
const require = createRequire(import.meta.url);
const data = readFileSync(require.resolve("@babel/standalone/babel.min.js"));

View File

@@ -3,9 +3,9 @@
"scripts": {
"deps": "exit 0",
"build": "exit 0",
"bench:bun": "$BUN bun.js",
"bench:node": "$NODE node.mjs",
"bench:deno": "$DENO run -A --unstable deno.js",
"bench:bun": "bun bun.js",
"bench:node": "node node.mjs",
"bench:deno": "deno run -A --unstable deno.js",
"bench": "bun run bench:bun && bun run bench:node && bun run bench:deno"
},
"dependencies": {

Some files were not shown because too many files have changed in this diff Show More