Commit Graph

173 Commits

Author SHA1 Message Date
Meghan Denny
92bc522e85 lsan: fix reporting on linux ci (#22806) 2025-09-24 00:47:52 -07:00
Meghan Denny
45760cd53c ci: instrument being able to run leaksanitizer (#21142)
tests not in `test/no-validate-leaksan.txt` will run with leaksanitizer
in CI
leaks documented in `test/leaksan.supp` will not cause a test failure

-- notes about leaksanitizer

- will not catch garbage collected objects accumulated during
long-running processes
- will not catch js objects (eg a strong held to a promise)
- will catch native calls to `malloc` not `free`d
- will catch allocations made in C, Zig, C++, libc, dependencies,
dlopen'd

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2025-09-19 02:06:02 -07:00
Alistair Smith
784271f85e SQLite in Bun.sql (#21640)
### What does this PR do?

Support sqlite in the Bun.sql API

Fixes #18951
Fixes #19701

### How did you verify your code works?

tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2025-08-19 23:15:53 -07:00
Meghan Denny
a63f09784e .vscode/launch.json: delete unused configurations (#20901) 2025-07-08 16:45:24 -07:00
190n
3b75095f0c Use long timeout for bun test launch configurations (#19869) 2025-05-23 18:03:09 -07:00
190n
259bf47abd Add sourceMap to launch.json so lldb can find WebKit code (#19263) 2025-05-20 16:50:47 -07:00
pfg
342fe232d0 test-eventtarget.js (#19547)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Ciro Spaciari <ciro.spaciari@gmail.com>
2025-05-16 23:17:35 -07:00
pfg
d9c77be90d node child process maxbuf support (#18293) 2025-04-03 17:03:26 -07:00
pfg
5c7df736bf Bring back btjs (#18108) 2025-03-11 22:51:05 -07:00
Don Isaac
9a5afe371a fix(bun-plugin-svelte): fix svelte module imports (#18042) 2025-03-11 12:01:15 -07:00
pfg
aa2e109f5f Add launch configuration for rr (#17963) 2025-03-09 00:19:20 -08:00
Jarred Sumner
fb0f28aab9 Remove a .vscode/launch.json config that is rarely used 2025-02-09 22:55:13 -08:00
Don Isaac
146ec7791b fix(node/assert): port more test cases from node (#16895)
Co-authored-by: DonIsaac <22823424+DonIsaac@users.noreply.github.com>
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
2025-02-06 14:29:59 -08:00
chloe caruso
5819fe49a7 node fs compat pr #2 (#16422)
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: dylan-conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2025-01-21 10:28:35 -08:00
Jarred Sumner
92baa07e76 Update launch.json 2025-01-16 23:32:13 -08:00
Jarred Sumner
4cb8e37474 Make console.warn yellow, make console.log(error) not red (#16435) 2025-01-16 00:43:26 -08:00
Don Isaac
36ad2974ab fix(launch): bun run ... launch configs (#16234) 2025-01-12 17:40:16 +00:00
190n
37765e6df8 Remove envFile from launch.json (#16224) 2025-01-07 15:05:35 -08:00
Jarred Sumner
4454ebb152 Allow http:// endpoints in Bun.S3 2025-01-04 01:08:27 -08:00
pfg
f276484f25 Add lldb scripts for zig & jsc (#15807) 2024-12-16 18:31:41 -08:00
Meghan Denny
53318c8b13 ci: run re-enable node tests on all platforms (#15572) 2024-12-09 19:08:30 -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
Alistair Smith
39af2a0a56 Fix VSCode extension hanging (#15407) 2024-11-25 12:43:46 -08: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
Meghan Denny
850cdb0587 vscode: set the launch configs' cwd to the root (#14643) 2024-10-17 16:24:10 -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
dave caruso
fc85a2dc92 feat(bake): add dependencies to IncrementalGraph (#14368) 2024-10-07 14:18:26 -07:00
dave caruso
514d37b3d2 kit: implement server components dev server (#14025) 2024-09-27 20:53:39 -07:00
Jarred Sumner
0378e5a277 Update launch.json 2024-09-11 15:41:41 -07:00
Meghan Denny
ab55477c2d vscode/launch.json: audit and tidy (#13162) 2024-08-08 14:27:36 -07:00
Jarred Sumner
0bbdd880e6 Fix various Windows build issues 2024-07-29 04:31:39 -07:00
dave caruso
75df73ef90 fix: make raiseIgnoringPanicHandler ignore the panic handler (#12578)
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-26 18:36:53 -07:00
Meghan Denny
f95ae9baee launch.json: remove BUN_DEBUG_ALL=1 from 'bun run' (#12845) 2024-07-26 04:14:45 -07:00
Jarred Sumner
157b56cca5 Update launch.json 2024-07-15 15:12:57 -07:00
dave caruso
02b589b2ce fix a crash in remapping stacks (#12477)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-07-10 16:39:05 -07:00
Ashcon Partovi
d105b048b1 Use Buildkite for CI (#11477) 2024-06-27 14:56:07 -07:00
Dylan Conway
61cb11dc2f remove sourceMap property 2024-06-08 15:50:33 -07:00
Jarred Sumner
fca20f1a43 Make sure this is set 2024-05-30 17:32:55 -07:00
Jarred Sumner
323011980c Add fuzzer-like test of methods (#11436)
Co-authored-by: Jarred-Sumner <Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-05-30 15:12:29 -07:00
Dylan Conway
4b8f89cb73 Allow bun update to edit package.json (#11340)
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-05-30 02:14:01 -07:00
Jarred Sumner
5f55d45d3b [internal] Fix showing source mappings for WebKit code in debugger 2024-05-28 18:09:43 -07:00
Meghan Denny
698d0f7c87 fix vscode json handling in prettier (#10133) 2024-04-09 20:42:42 -07:00
Meghan Denny
fd3cd05647 shell: more builtin commands (#9908)
* remove asString and improve fromString

* make writeNoIO return Maybe

* shell: add builtin command 'yes'

* shell: add builtin command 'seq'

* shell: yes+seq: fix usage string

* shell: add builtin command 'dirname'

* shell: add builtin command 'basename'

* add more tests

* update shell docs with list of commands

* add 'bun exec' launch configurations

* fix AsyncDeinitReader name

* fix 'yes' command IO

* shell: rewrite 'bun' to 'bun-debug' when self is bun-debug

* make the docs not lie about bun being a shell builtin

---------

Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-04-05 16:29:50 -07:00
Jarred Sumner
f393f8a065 bun install launch.json 2024-04-04 19:31:10 -07:00
Jarred Sumner
2d61c865fc Replace some of std.ChildProcess with bun.spawnSync (#9513)
* Replace some of std.ChildProcess with bun.spawnSync

* Update process.zig

* Fix some build errors

* Fix linux build

* Keep error

* Don't print a mesasge in this case

* Update spawn.test.ts

* Make `bun install` faster on Linux

* Comments + edgecases

* Fix the tests

* Add bun install launch.json

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Zack Radisic <zack@theradisic.com>
2024-03-21 23:50:48 -07:00
Jarred Sumner
c9fe57fa63 wip use wrapper for managing process (#8456)
* WIP sync close (shows ref count bug in stream)

* fix closing on PipeWriter and PipeReader

* remove old todos

* join

* Some shell changes

at least it compiles

* fix some compile errors

* fix ref/unref server on windows

* actually use the ref count in this places

* make windows compile again

* more tests passing

* Make shell compile again

* Slowly remove some `@panic("TODO SHELL")`

* Eliminate `@panic("TODO SHELL")` for BufferedWriter

* Holy cleansing of `@panic("TODO SHELL")`

at least it compiles now

* Okay now the shell compiles, but segfaults

* Fix compiler errors

* more stable stream and now Content-Range pass

* make windows compile again

* revert stuff until the fix is actually ready

* revert onDone thing

* Fix buffered writer for shell

* Fix buffered writer + shell/subproc.zig and windows build

* Fix for #8982 got lost in the merge

* Actually buffer subproc output

* Fix some stuff shell

* oops

* fix context deinit

* fix renderMissing

* shell: Fix array buffer

* more stable streams (#9053)

fix stream ref counting

* wip

* Remove `@panic("TODO")` on shell event loop tasks and Redirect  open flags got lost in merge

* Support redirects

* fixes

cc @cirospaciari

* Update ReadableStreamInternals.ts

* Fix spurious error

* Update stream.js

* leak

* Fix UAF

cc @cirospaciari

* Fix memory leaks

* HOLY FUCK big refactor

* misc cleanup

* shell: Fix a bunch of tests

* clean up

* gitignore: fix ending newline

* get windows compiling again

* tidy

* hide linker warn with icu

* closeIfPossible

* Better leak test

* Fix forgetting to decrement reference count

* Update stdio.zig

* Fix shell windows build

* Stupid unreachable

* Woops

* basic echo hi works on windows

* Fix flaky test on Windows

* Fix windows regression in Bun.main (#9156)

* Fix windows regression in Bun.main

* Handle invalid handles

* Fix flaky test

* Better launch config

* Fixup

* Make this test less flaky on Windows

* Fixup

* Cygwin

* Support signal codes in subprocess.kill(), resolve file path

* Treat null as ignore

* Ignore carriage returns

* Fixup

* shell: Fix IOWriter bug

* shell: Use custom `open()`/`openat()`

* windows shell subproc works

* zack commit

* I think I understand WindowsStreamingWriter

* fix thing

* why were we doing this in tests

* shell: Fix rm

* shell: Add rm -rf node_modules/ test

* shell: use `.runAsTest()` in some places to make it easier to determine which test failed

* [autofix.ci] apply automated fixes

* woopsie

* Various changes

* Fix

* shell: abstract output task logic

* shell: mkdir builtin

* fixup

* stuff

* shell: Make writing length of 0 in IOWriter immediately resolve

* shell: Implement `touch`

* shell: basic `cat` working

* Make it compile on windows

* shell: Fix IOReader bug

* [autofix.ci] apply automated fixes

* fix windows kill on subprocess/process

* fix dns tests to match behavior on windows (same as nodejs)

* fix windows ci

* again

* move `close_handle` to flags in `PipeWriter` and fix shell hanging

* Fix `ls` not giving non-zero exit code on error

* Handle edgecase in is_atty

* Fix writer.flush() when there's no data

* Fix some tests

* Disable uv_unref on uv_process_t on Windows, for now.

* fix writer.end

* fix stdout.write

* fix child-process on win32

* Make this test less flaky on Windows

* Add assertion

* Make these the same

* Make it pass on windows

* Don't commit

* Log the test name

* Make this test less flaky on windows

* Make this test less flaky on windows

* Print which test is taking awhile in the runner

* fixups

* Fixups

* Add some assertions

* Bring back test concurrency

* shell: bring back redirect stdin

* make it compile again cc @zackradisic

* initialize env map with capacity

* some fixes

* cleanup

* oops

* fix leak, fix done

* fix unconsumedPromises on events

* always run expect

* Update child_process.test.ts

* fix reading special files

* Fix a test

* Deflake this test

* Make these comparisons easier

* Won't really fix it but slightly cleaner

* Update serve.test.ts

* Make the checks for if the body is already used more resilient

* Move this to the harness

* Make this test not hang in development

* Fix this test

* Make the logs better

* zero init some things

* Make this test better

* Fix readSocket

* Parallelize this test

* Handle EPipe and avoid big data

* This was a mistake

* Fix a bunch of things

* Fix memory leak

* Avoid sigpipe + optimize + delete dead code

* Make this take less time

* Make it bigger

* Remove some redundant code

* Update process.zig

* Merge and hopefully don't breka things along teh way

* Silence build warning

* Uncomment on posix

* Skip test on windows

* windows

* Cleanup test

* Update

* Deflake

* always

* less flaky test

* [autofix.ci] apply automated fixes

* logs

* fix uaf on shell IOReader

* stuff to make it work with mini event loop

* fix 2 double free scenarios, support redirections on windows

* shell: Make `1>&2` and `2>&1` work with libuv

* yoops

* Partial fix

* Partial fix

* fix build

* fix build

* ok

* Make a couple shell tests pass

* More logging

* fix

* fix

* Fix build issue

* more tests pass

* Deflake

* Deflake

* Use Output.panic instead of garbled text

* Formatting

* Introduce `bun.sys.File`, use it for `Output.Source.StreamType`, fix nested Output.scoped() calls, use Win32 `ReadFile` API for reading when it's not a libuv file descriptor.

This lets us avoid the subtle usages of `unreachable` in std.os when writing to stdout/stderr.

Previously, we were initializing the libuv loop immediately at launch due to checking for the existence of a bun build --compile'd executable. When the file descriptor is not from libuv, it's just overhead to use libuv

cc @paperdave, please tell me if Iany of that is incorrect or if you think this is a bad idea.

* Fix closing undefined memory file descriptors in spawn

cc @zackradisic

* pause instead of close

* Fix poorly-written test

* We don't need big numbers for this test

* sad workaround

* fixup

* Clearer error handling for this test

* Fix incorrect test

@electroid when ReadableStream isn't closed, hanging is the correct behavior when consuming buffered data. We cannot know if the buffered data is finished if the stream never closes.

* Fix build

* Remove known failing on windows

* Deflake

* Mark no longer failing

* show all the failing tests

* Sort the list of tests

* fix argument handling

* dont show "posix_spawn" as an error code on windows

* make bun-upgrade.test.ts pass on windows

* fix bunx and bun create again sorry

* a

* fix invalidexe because we should not be running javascript files as if they were exes

* Concurrency in test runner + better logging

* Revert "fix invalidexe because we should not be running javascript files as if they were exes"

This reverts commit da47cf8247.

* WIP: Unix fixes (#9322)

* wip

* [autofix.ci] apply automated fixes

* wip 2

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>

* Update runner.node.mjs

* Update runner.node.mjs

* Document some environment variables

* shell: Make `Response` work with builtins

* Make it compile

* make pwd test pass

* [autofix.ci] apply automated fixes

* Fix printing garbage for source code previews

* Update javascript.zig

* Fix posix test failures

* Fix signal dispatch

cc @paperdave. Signals can be run from any thread. This causes an assertion failure when the receiving thread happens to not be the main thread. Easiest to reproduce on linux when you spawn 100 short-lived processes at once.

* windows

---------

Co-authored-by: cirospaciari <ciro.spaciari@gmail.com>
Co-authored-by: Zack Radisic <56137411+zackradisic@users.noreply.github.com>
Co-authored-by: Zack Radisic <zackradisic@Zacks-MBP-2.attlocal.net>
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Meghan Denny <meghan@bun.sh>
Co-authored-by: Zack Radisic <zack@theradisic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
2024-03-11 08:24:30 -07:00
Jarred Sumner
f34de31edb Fix windows regression in Bun.main (#9156)
* Fix windows regression in Bun.main

* Handle invalid handles

* Fix flaky test

* Better launch config

* Fixup
2024-02-28 16:49:37 -08:00
Ashcon Partovi
63a9a8b015 Improve .vscode extensions, tasks, and configuration (#8511) 2024-02-01 14:55:35 -08:00
vinnichase
692fb220a4 Update launch.json to use ${workspaceFolder}/build/bun-debug (#8570) 2024-01-29 22:38:43 -08:00
dave caruso
c9a7d24538 windows(install): add bun_shim (support bin linking, bin shebangs, etc) (#8265)
* shim v1 TODO

* fix BunXShimData

* wip

* put a little bit of the sa u c e on it

* wow

* wat

* a

* swag

* swag

* allllllllllllright

* Update src/install/bin.zig

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* swag

* swag

* finis

* fix submodules

* ok

* omg it works again

* silly

* ok

* OK

* update laucnh jsn

* swaaaaaaaaaaaaag

* remove debug

---------

Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2024-01-25 07:38:55 -08:00