* think about the future
* waaaaaaaaaaa
* a
* testing
* make it faster
* fire
* macos and linux
* stuff
* a
* a
* CI
* buh
* disable in debug
* Apply formatting changes
* a
* a
* Apply formatting changes
* more review comment resolution
* a
* a
* oh no i started writing macos code from within windows i should stop and switch devices again
* rookie mistake
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: paperdave <paperdave@users.noreply.github.com>
* allow client renegotiation and allow server renegotiation with limits matching nodejs behavior
* wip before the refactoring and context separation
* investigate if BoringSSL can send a SSL_renegotiate request or only accept
* format-off
* option to disable server renegotiation
* allow tls options on https
* dead_socket when connectError
* propagate cert error
* test
* move the logic to the right place
* cleanup
* Update test/js/node/tls/renegotiation.test.ts
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
---------
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
Co-authored-by: Georgijs <48869301+gvilums@users.noreply.github.com>
* some fixes
* WIP
* wip wip
* more debug
* closer
* sending a really big payload at once is still broken
* now we need to avoid segfault happening inside onWritable after destroy
* opsie
* cleanup
* more cleanup
* more WIP, closer need to fix cork
* fix cork actually not writing non-optional data
* make onWritable return actually do something
* actually clean the on writable handler
* remove unreachable condition
* we are not looping anymore
* little revert
* fix possible fault
* inform backpressure on chunked encoding
* just queue when tryEnd
* remove unreachable code
* Upgrade HTTPParser.h from uWS v20.6.0 to v20.62.0
* Make MAX_FALLBACK_SIZE larger to allow for large redirect urls
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* 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>
* Make printing errors faster
* Make Next.js tests less flaky
* Update dev-server.test.ts
* Copy over runner from process pr
* bump next version
* Update javascript.zig
* Set port to 0
* p-queue
* no dont use docker buildx
* Prevent runner from hanging
* Update dev-server.test.ts
* Really fix hanging this time
* Fix bounds check for unix domain socket, support abstract namespace sockets
* Various fixes
* [autofix.ci] apply automated fixes
* Update runner.node.mjs
* Update runner.node.mjs
* windows
* Only care about stdout
* increase concureency + clean up test
* Tweak puppeteer
* Update runner.node.mjs
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Add `BUN_DEBUG` flag to control where debug logs go
* Update all the actions
* Configure temp
* use spawn instead of rm
* Use CLOSE_RANGE_CLOEXEC
* Make some tests more reproducible
* Update hot.test.ts
* Detect file descriptor leaks and wait for stdout
* Update runner.node.mjs
* Update preload.ts
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* Upgrade uWebSockets & usockets
* Update HttpRouter.h
* Defensively prevent sending to blocking sockets
* Add test for receiving large amounts of data
* Large data optimization
* Update loop.c
* Avoid extra system call before entering event loop
* Update internal.h
* 1 less pointer lookup
* Fix error
* Update socket-huge-fixture.js
---------
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
* fix fetch
* oops
* revert
* fix checkServerIdentity
* check dns len
* use same checks on wsclient and fetch, fix tests
* more tests and more fixes
* fix node-http flask test
* orelse
* fix requestCert
* more fixes, but no data receiving
* fix pause on connect behavior on TLS
* WS Client + rejectUnauthorized progress
* move test to the right place
* more test
* oops
* oops 2
* fmt
* cleanup
* WIP: handle handshake properly on uWS
* handle rejectUnauthorized in uWS
* fmt
* duplicated test
* fix leak
* add rejectUnauthorized option in WS types
* fix merge
* fix merge2
* Prepare for windows event loop
* More progress
* Update libuv.zig
* wip
* Make compiling each dependency a shell script
* Bump mimalloc
* Add the build scripts
* Update settings.json
* Fix a bunch of compiler warnings
* Remove more warnings
* more warnings
* cmake works
* Update JSSQLStatement.h
* put it in the zig file
* Fix usockets warnings
* Fixup
* Fix one of the compiler errors
* chunk
* draw the rest of the owl
* theres more
* Rename Process -> BunProcess
Works around a Windows issue
* Add musl polyfill for memmem on Windows
* More
* 12 mb
* Fix getenvZ
* fix variosu issues
* Add fast-ish path for bun install on Windows
* Update windows.zig
* Update windows.zig
* Fix build issue
* it works
* hmmm
* Rename file
* Fixups
* Update wtf-bindings.cpp
* Update src/bun.js/bindings/headers-handwritten.h
Co-authored-by: Dylan Conway <35280289+dylan-conway@users.noreply.github.com>
* further!
* more
* Update .gitignore
* hm
* quite a lot of fixes
* Update CMakeLists.txt
* zig fmt
* Many more things are starting to work.
* reb
* regenaret
* Update JSSink.h
* fixup
* fetch works
* Bun.serve() and much of the event loop works now
* Make require() work
* bun install progress
* more things work
* use less std.os
* Fixes
* small fixes
* Bump
* Bummp
* Undo that change
* We have to bump the version of Debian because libarchive has a higher minimum requirement
* ok
* some clenaup
* windows
* Update bun.zig
* fixup
* avoid duplicate symbols
* avoid undefined symbols
* bump
* Remove issue template for install
It's not used, and use the bug issue instead.
* Add types for cp and cpSync
* Add types for watchFile and unwatchFile
* Add bun-types to 'bun fmt' script
* Update nodejs compat docs cp/cpSync/watchFile/unwatchFile (#4525)
* feat(fetch) rejectUnauthorized and checkServerIdentity (#4514)
* enable root certs on fetch
* rebase
* fix lookup
* some fixes and improvements
* fmt
* more fixes
* more fixes
* check detached onHandshake
* fix promise case
* fix cert non-Native
* add fetch tls tests
* more one test
* churn
* Update feature_flags.zig
* Update response.zig
* Revert "avoid undefined symbols"
This reverts commit ca835b726f.
* Revert "avoid duplicate symbols"
This reverts commit 4ac6ca8700.
* Update feature_flags.zig
* Set permissions
* more
* Update mimalloc
* Fix sqlite test failures
* Fix some test failures
* Make sure we remove libusockets is removed
* hm
* [dave]: fix webcrypto crash
* bump
* Update index.ts
* windows zig compiles
* cmake on mac works
* progress
* yay
* bun run build
* fix
* ok
* oops
* asdfasfdafdsafda
* fghjkl
* git ignore
* wow
* Process -> BunProcess
* hmm
* blah
* finalize merge
* now it only has linker errors on mac
* sdfadsf
* g
* getting farther
* sxdcvbnmk,
* adfhjskfjdhkas
* a
* fgh
* update build dot zig
* asdfg
* theoretical -DCANARY flag we can use
* asdf
* cool
* okay
* colorterm
* New build workflow
* Fix script
* Use sudo
* More sudo
* Tweak dependencies
* Another sudo attempt
* Tweak script
* 16.0 -> 16
* Tweak script
* Tweak script
* Tweak script
* Tweak script
* Tweak script
* bun install
* ssh into github actions
* add more to ssh
* Fix postinstal
* Skip llvm
* New dockerfile
* Build
* More changes to Dockerfile
* chaos chaos chaos
* okay
* a
* more cmake nonsense
* add unified sources code (does not work)
* stuff
* prepare for CI builds
* ok
* yay
* yeah
* make this more stable simply by trying again if it fails, 5 times, then lose. it fixes the stability issue i was running into L O L
* messing with ci
* x
* a
* clean dependencies before build
* oops
* this is not going to work but its closer
* not gonna work either
* a
* a
* did i do it
* a
* a
* work around weird fs+Bun.build issues
* properly pass debug flag correctly
* idk im sorry
* lose
* maybe
* run the tests please
* a
* fix zlib script
* a
* hi
* prevent stupid ci issue
* i totally didnt leave in a syntax error on cmakelists
* a
* lol
* relax
* 😭
* a
* SO SILLY
* 😡 one line mistake
* one character diff
* fix linking symbols missing
* work on dependency scripts
* does this work now?
* fix mac build
* a
* bump!
* woops
* add macos baseline build
* .
* fix sqlite and also enable $assert/$debug support in builtin functions
* okay
* oops
* zig upgrade lol
* Merge
* Fix spawn test issue
* Set a timeout
* yeah
* etc
* mi
---------
Co-authored-by: Jarred Sumner <709451+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>
Co-authored-by: Ashcon Partovi <ashcon@partovi.net>
Co-authored-by: Birk Skyum <74932975+birkskyum@users.noreply.github.com>
Co-authored-by: dave caruso <me@paperdave.net>
* [server] requestIp and AnyRequestContext
Changed Request.uws_request to the new AnyRequestContext. This
allows grabbing the IP from a Request. Unfinished.
* [server] basic `requestIp` implementation
Currently using uws's requestIpAsText, which always returns a ipv6
string. We should return a `SocketAddress` object to the user instead,
which will contain the formatted address string and what type it is.
We'll have to use requestIpAsBinary and parse that ourselves.
* TypeScript docs, use `bun.String`, return `undefined` instead of `null`
if we can't get the ip.
* binary address formatting
* uws getRemoteAddress binding
* remove dead code
* working
* final touches✨
* I will abide by the results of this poll.
---------
Co-authored-by: Parzival-3141 <29632054+Parzival-3141@users.noreply.github.com>