Skip to content

Commit 1a524c2

Browse files
committed
Merge branch 'main' into claude/add-bun-archive
2 parents 6fbf5b2 + 1f22f44 commit 1a524c2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1925
-981
lines changed

cmake/targets/BuildBun.cmake

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -419,12 +419,9 @@ execute_process(
419419
--command=list-outputs
420420
--sources=${BUN_BINDGENV2_SOURCES_COMMA_SEPARATED}
421421
--codegen-path=${CODEGEN_PATH}
422-
RESULT_VARIABLE bindgen_result
423422
OUTPUT_VARIABLE bindgen_outputs
423+
COMMAND_ERROR_IS_FATAL ANY
424424
)
425-
if(${bindgen_result})
426-
message(FATAL_ERROR "bindgenv2/script.ts exited with non-zero status")
427-
endif()
428425
foreach(output IN LISTS bindgen_outputs)
429426
if(output MATCHES "\.cpp$")
430427
list(APPEND BUN_BINDGENV2_CPP_OUTPUTS ${output})

cmake/tools/SetupWebKit.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ if(WEBKIT_LOCAL)
2828
# make jsc-compile-debug jsc-copy-headers
2929
include_directories(
3030
${WEBKIT_PATH}
31+
${WEBKIT_PATH}/JavaScriptCore/Headers
3132
${WEBKIT_PATH}/JavaScriptCore/Headers/JavaScriptCore
3233
${WEBKIT_PATH}/JavaScriptCore/PrivateHeaders
3334
${WEBKIT_PATH}/bmalloc/Headers
@@ -90,7 +91,14 @@ if(EXISTS ${WEBKIT_PATH}/package.json)
9091
endif()
9192
endif()
9293

93-
file(DOWNLOAD ${WEBKIT_DOWNLOAD_URL} ${CACHE_PATH}/${WEBKIT_FILENAME} SHOW_PROGRESS)
94+
file(
95+
DOWNLOAD ${WEBKIT_DOWNLOAD_URL} ${CACHE_PATH}/${WEBKIT_FILENAME} SHOW_PROGRESS
96+
STATUS WEBKIT_DOWNLOAD_STATUS
97+
)
98+
if(NOT "${WEBKIT_DOWNLOAD_STATUS}" MATCHES "^0;")
99+
message(FATAL_ERROR "Failed to download WebKit: ${WEBKIT_DOWNLOAD_STATUS}")
100+
endif()
101+
94102
file(ARCHIVE_EXTRACT INPUT ${CACHE_PATH}/${WEBKIT_FILENAME} DESTINATION ${CACHE_PATH} TOUCH)
95103
file(REMOVE ${CACHE_PATH}/${WEBKIT_FILENAME})
96104
file(REMOVE_RECURSE ${WEBKIT_PATH})

docs/guides/ecosystem/pm2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ Alternatively, you can create a PM2 configuration file. Create a file named `pm2
3333

3434
```js pm2.config.js icon="file-code"
3535
module.exports = {
36-
title: "app", // Name of your application
36+
name: "app", // Name of your application
3737
script: "index.ts", // Entry point of your application
3838
interpreter: "bun", // Bun interpreter
3939
env: {

packages/bun-types/s3.d.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,30 @@ declare module "bun" {
321321
| "SNOW"
322322
| "STANDARD_IA";
323323

324+
/**
325+
* When set to `true`, confirms that the requester knows they will be charged
326+
* for the request and data transfer costs. Required for accessing objects
327+
* in Requester Pays buckets.
328+
*
329+
* @see https://docs.aws.amazon.com/AmazonS3/latest/userguide/RequesterPaysBuckets.html
330+
*
331+
* @example
332+
* // Accessing a file in a Requester Pays bucket
333+
* const file = s3.file("data.csv", {
334+
* bucket: "requester-pays-bucket",
335+
* requestPayer: true
336+
* });
337+
* const content = await file.text();
338+
*
339+
* @example
340+
* // Uploading to a Requester Pays bucket
341+
* await s3.write("output.json", data, {
342+
* bucket: "requester-pays-bucket",
343+
* requestPayer: true
344+
* });
345+
*/
346+
requestPayer?: boolean;
347+
324348
/**
325349
* @deprecated The size of the internal buffer in bytes. Defaults to 5 MiB. use `partSize` and `queueSize` instead.
326350
*/

scripts/create-link-metadata.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ console.log("Reading linker files...");
2828
const linkerLds = await Bun.file(join(repoRoot, "src", "linker.lds")).text();
2929
const symbolsDyn = await Bun.file(join(repoRoot, "src", "symbols.dyn")).text();
3030
const symbolsTxt = await Bun.file(join(repoRoot, "src", "symbols.txt")).text();
31+
const symbolsDef = await Bun.file(join(repoRoot, "src", "symbols.def")).text();
3132

3233
// Create metadata JSON with link command included
3334
const metadata = {
@@ -41,6 +42,7 @@ const metadata = {
4142
linker_lds: linkerLds,
4243
symbols_dyn: symbolsDyn,
4344
symbols_txt: symbolsTxt,
45+
symbols_def: symbolsDef,
4446
};
4547

4648
const metadataPath = join(buildPath, "link-metadata.json");

scripts/runner.node.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,6 +1128,7 @@ async function spawnBun(execPath, { args, cwd, timeout, env, stdout, stderr }) {
11281128
...process.env,
11291129
PATH: path,
11301130
TMPDIR: tmpdirPath,
1131+
BUN_TMPDIR: tmpdirPath,
11311132
USER: username,
11321133
HOME: homedir,
11331134
SHELL: shellPath,

src/CLAUDE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Syntax reminders:
88
Conventions:
99

1010
- Prefer `@import` at the **bottom** of the file, but the auto formatter will move them so you don't need to worry about it.
11+
- **Never** use `@import()` inline inside of functions. **Always** put them at the bottom of the file or containing struct. Imports in Zig are free of side-effects, so there's no such thing as a "dynamic" import.
1112
- You must be patient with the build.

src/OutputFile.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ pub const FileOperation = struct {
7474

7575
pub fn getPathname(file: *const FileOperation) string {
7676
if (file.is_tmpdir) {
77-
return resolve_path.joinAbs(@TypeOf(Fs.FileSystem.instance.fs).tmpdir_path, .auto, file.pathname);
77+
return resolve_path.joinAbs(Fs.FileSystem.RealFS.tmpdirPath(), .auto, file.pathname);
7878
} else {
7979
return file.pathname;
8080
}

src/StandaloneModuleGraph.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,7 +670,7 @@ pub const StandaloneModuleGraph = struct {
670670
if (!tried_changing_abs_dir) {
671671
tried_changing_abs_dir = true;
672672
const zname_z = bun.strings.concat(bun.default_allocator, &.{
673-
bun.fs.FileSystem.instance.fs.tmpdirPath(),
673+
bun.fs.FileSystem.RealFS.tmpdirPath(),
674674
std.fs.path.sep_str,
675675
zname,
676676
&.{0},
@@ -1213,7 +1213,7 @@ pub const StandaloneModuleGraph = struct {
12131213
}
12141214
}
12151215

1216-
if (read_amount < trailer.len + @sizeOf(usize) + 32)
1216+
if (read_amount < trailer.len + @sizeOf(usize) + @sizeOf(Offsets))
12171217
// definitely missing data
12181218
return null;
12191219

src/boringssl.zig

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,30 @@ pub fn checkX509ServerIdentity(
167167
if (dnsNameSlice.len > 0) {
168168
if (X509.isSafeAltName(dnsNameSlice, false)) {
169169
if (dnsNameSlice[0] == '*') {
170-
dnsNameSlice = dnsNameSlice[1..dnsNameSlice.len];
171-
var host = hostname;
172-
if (hostname.len > dnsNameSlice.len) {
173-
host = hostname[hostname.len - dnsNameSlice.len .. hostname.len];
174-
}
175-
if (strings.eql(dnsNameSlice, host)) {
176-
return true;
170+
// RFC 6125 Section 6.4.3: Wildcard must match exactly one label
171+
// Enforce "*." prefix (wildcards must be leftmost and followed by a dot)
172+
if (dnsNameSlice.len >= 2 and dnsNameSlice[1] == '.') {
173+
const suffix = dnsNameSlice[2..];
174+
// Disallow "*.tld" (suffix must contain at least one dot for proper domain hierarchy)
175+
if (std.mem.indexOfScalar(u8, suffix, '.') != null) {
176+
// Host must be at least "label.suffix" (suffix_len + 1 for dot + at least 1 char for label)
177+
if (hostname.len > suffix.len + 1) {
178+
const dot_index = hostname.len - suffix.len - 1;
179+
// The character before suffix must be a dot, and there must be no other dots
180+
// in the prefix (single-label wildcard only)
181+
if (hostname[dot_index] == '.' and std.mem.indexOfScalar(u8, hostname[0..dot_index], '.') == null) {
182+
const host_suffix = hostname[dot_index + 1 ..];
183+
// RFC 4343: DNS names are case-insensitive
184+
if (strings.eqlCaseInsensitiveASCII(suffix, host_suffix, true)) {
185+
return true;
186+
}
187+
}
188+
}
189+
}
177190
}
178191
}
179-
if (strings.eql(dnsNameSlice, hostname)) {
192+
// RFC 4343: DNS names are case-insensitive
193+
if (strings.eqlCaseInsensitiveASCII(dnsNameSlice, hostname, true)) {
180194
return true;
181195
}
182196
}

0 commit comments

Comments
 (0)