robobun
70fa6af355
feat: add Bun.Archive API for creating and extracting tarballs (#25665)
## Summary
- Adds new `Bun.Archive` API for working with tar archives
- `Bun.Archive.from(data)` - Create archive from object, Blob,
TypedArray, or ArrayBuffer
- `Bun.Archive.write(path, data, compress?)` - Write archive to disk
(async)
- `archive.extract(path)` - Extract to directory, returns
`Promise<number>` (file count)
- `archive.blob(compress?)` - Get archive as Blob (async)
- `archive.bytes(compress?)` - Get archive as Uint8Array (async)
Key implementation details:
- Uses existing libarchive bindings for tarball creation/extraction via
`extractToDisk`
- Uses libdeflate for gzip compression
- Immediate byte copying for GC safety (no JSValue protection, no
`hasPendingActivity`)
- Async operations run on worker pool threads with proper VM reference
handling
- Growing memory buffer via `archive_write_open2` callbacks for
efficient tarball creation
## Test plan
- [x] 65 comprehensive tests covering:
- Normal operations (create, extract, blob, bytes, write)
- GC safety (unreferenced archives, mutation isolation)
- Error handling (invalid args, corrupted data, I/O errors)
- Edge cases (large files, many files, special characters, path
normalization)
- Concurrent operations
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Bot <claude-bot@bun.sh>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Dylan Conway <dylan.conway567@gmail.com>
Co-authored-by: Jarred Sumner <jarred@jarredsumner.com>
2026-01-09 00:33:35 -08:00
..
2022-07-12 01:40:12 -07:00
2026-01-09 00:33:35 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-12-27 00:05:57 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-02-07 15:13:21 -08:00
2024-11-08 23:15:24 -08:00
2025-02-18 13:12:03 -08:00
2023-03-02 19:02:10 -08:00
2024-11-08 23:15:24 -08:00
2025-02-12 23:37:36 -08:00
2024-12-31 19:48:33 -08:00
2023-03-02 19:02:10 -08:00
2024-11-08 23:15:24 -08:00
2025-11-20 17:14:37 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2023-08-31 17:33:08 -07:00
2024-11-08 23:15:24 -08:00
2025-09-01 02:56:59 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-02-16 00:42:05 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-07-10 00:10:43 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2022-07-12 01:40:12 -07:00
2025-03-10 20:19:29 -07:00
2025-03-10 20:19:29 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-06-03 03:34:35 -07:00
2024-11-08 23:15:24 -08:00
2022-12-06 14:18:25 -08:00
2022-12-06 14:18:25 -08:00
2023-11-06 03:51:49 -08:00
2024-11-08 23:15:24 -08:00
2025-12-29 20:02:18 -08:00
2025-12-29 20:02:18 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2022-07-12 01:40:12 -07:00
2024-11-08 23:15:24 -08:00
2025-01-03 13:57:46 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-08-01 14:35:04 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-12-24 19:55:44 -08:00
2024-11-08 23:15:24 -08:00
2025-02-12 23:14:02 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-12-23 22:53:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-04-08 03:57:35 -07:00
2024-09-03 21:32:52 -07:00
2025-04-11 20:59:38 -07:00
2024-11-08 23:15:24 -08:00
2025-11-04 11:56:33 -08:00
2024-11-08 23:15:24 -08:00
2025-12-27 15:01:28 -08:00
2023-07-30 23:51:43 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-09-03 21:32:52 -07:00
2024-09-03 21:32:52 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-09-03 21:32:52 -07:00
2022-08-21 00:51:27 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-07-07 23:08:12 -07:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-12-26 21:49:00 -08:00
2024-11-08 23:15:24 -08:00
2025-08-14 22:42:05 -07:00
2024-11-08 23:15:24 -08:00
2024-09-03 21:32:52 -07:00
2023-01-04 18:55:16 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2025-11-28 00:04:30 -08:00
2025-01-08 07:12:18 +00:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-11-08 23:15:24 -08:00
2024-12-24 04:20:24 -08:00