Skip to content

Commit

Permalink
Merge branch 'main' into dylan/migrate-non-optional-optional-peer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarred-Sumner authored Jan 25, 2025
2 parents 60fe4ca + 0768baf commit 04f7c05
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions .buildkite/ci.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ function getBuildZigStep(platform, options) {
cancel_on_build_failing: isMergeQueue(),
env: getBuildEnv(platform, options),
command: `bun run build:ci --target bun-zig --toolchain ${toolchain}`,
timeout_in_minutes: 25,
};
}

Expand Down
11 changes: 9 additions & 2 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ pub fn getCpuModel(os: OperatingSystem, arch: Arch) ?Target.Query.CpuModel {

pub fn build(b: *Build) !void {
std.log.info("zig compiler v{s}", .{builtin.zig_version_string});
checked_file_exists = std.AutoHashMap(u64, void).init(b.allocator);

b.zig_lib_dir = b.zig_lib_dir orelse b.path("vendor/zig/lib");

Expand Down Expand Up @@ -481,9 +482,15 @@ pub fn addInstallObjectFile(
}, b.fmt("{s}.o", .{name})).step;
}

var checked_file_exists: std.AutoHashMap(u64, void) = undefined;
fn exists(path: []const u8) bool {
const file = std.fs.openFileAbsolute(path, .{ .mode = .read_only }) catch return false;
file.close();
const entry = checked_file_exists.getOrPut(std.hash.Wyhash.hash(0, path)) catch unreachable;
if (entry.found_existing) {
// It would've panicked.
return true;
}

std.fs.accessAbsolute(path, .{ .mode = .read_only }) catch return false;
return true;
}

Expand Down
3 changes: 2 additions & 1 deletion src/bun.js/bindings/webcore/AbortSignal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ void AbortSignal::cleanNativeBindings(void* ref)
});

std::exchange(m_native_callbacks, WTFMove(callbacks));
this->eventListenersDidChange();
}

// https://dom.spec.whatwg.org/#abortsignal-follow
Expand All @@ -218,7 +219,7 @@ void AbortSignal::signalFollow(AbortSignal& signal)

void AbortSignal::eventListenersDidChange()
{
m_hasAbortEventListener = hasEventListeners(eventNames().abortEvent);
m_hasAbortEventListener = hasEventListeners(eventNames().abortEvent) or !m_native_callbacks.isEmpty();
}

uint32_t AbortSignal::addAbortAlgorithmToSignal(AbortSignal& signal, Ref<AbortAlgorithm>&& algorithm)
Expand Down
2 changes: 2 additions & 0 deletions src/io/PipeReader.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,8 @@ pub const WindowsBufferedReader = struct {
.source = other.source,
};
other.flags.is_done = true;
other._offset = 0;
other.buffer().* = std.ArrayList(u8).init(bun.default_allocator);
other.source = null;
to.setParent(parent);
}
Expand Down

0 comments on commit 04f7c05

Please sign in to comment.