authorgravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-06-10 17:54:19+02:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2025-06-10 17:54:19+02:00
log6810ffa424fccae0ecbf2f9e3db80069d8e7543b
tree1c975b3c85032c7ea5e3ea8c876aaed71edebd35
parent4d79806459618f1830772ed6dfbb82059589aaa4
parent7f7318700427875d5b0ec2f8601c12e5bc21cebe
signaturebadge-check Signed by PGP key B5690EEEBB952194

Merge pull request #24031 from ypsvlq/master

Haiku fixes

6 files changed, 18 insertions(+), 5 deletions(-)

lib/compiler/build_runner.zig+4-1
...@@ -415,7 +415,7 @@ pub fn main() !void {...@@ -415,7 +415,7 @@ pub fn main() !void {
415 else => return err,415 else => return err,
416 };416 };
417417
418 var w = if (watch) try Watch.init() else undefined;418 var w: Watch = if (watch and Watch.have_impl) try Watch.init() else undefined;
419419
420 try run.thread_pool.init(thread_pool_options);420 try run.thread_pool.init(thread_pool_options);
421 defer run.thread_pool.deinit();421 defer run.thread_pool.deinit();
...@@ -435,6 +435,9 @@ pub fn main() !void {...@@ -435,6 +435,9 @@ pub fn main() !void {
435 else => return err,435 else => return err,
436 };436 };
437 if (fuzz) {437 if (fuzz) {
438 if (builtin.single_threaded) {
439 fatal("--fuzz not yet implemented for single-threaded builds", .{});
440 }
438 switch (builtin.os.tag) {441 switch (builtin.os.tag) {
439 // Current implementation depends on two things that need to be ported to Windows:442 // Current implementation depends on two things that need to be ported to Windows:
440 // * Memory-mapping to share data between the fuzzer and build runner.443 // * Memory-mapping to share data between the fuzzer and build runner.
lib/std/Build/Watch.zig+1-1
...@@ -600,7 +600,7 @@ const Os = switch (builtin.os.tag) {...@@ -600,7 +600,7 @@ const Os = switch (builtin.os.tag) {
600 };600 };
601 }601 }
602 },602 },
603 .dragonfly, .freebsd, .netbsd, .openbsd, .ios, .macos, .tvos, .visionos, .watchos, .haiku => struct {603 .dragonfly, .freebsd, .netbsd, .openbsd, .ios, .macos, .tvos, .visionos, .watchos => struct {
604 const posix = std.posix;604 const posix = std.posix;
605605
606 kq_fd: i32,606 kq_fd: i32,
lib/std/c.zig+5-2
...@@ -5703,6 +5703,9 @@ pub const SOCK = switch (native_os) {...@@ -5703,6 +5703,9 @@ pub const SOCK = switch (native_os) {
5703 pub const RAW = 3;5703 pub const RAW = 3;
5704 pub const SEQPACKET = 5;5704 pub const SEQPACKET = 5;
5705 pub const MISC = 255;5705 pub const MISC = 255;
5706
5707 pub const NONBLOCK = 0x40000;
5708 pub const CLOEXEC = 0x80000;
5706 },5709 },
5707 .openbsd => struct {5710 .openbsd => struct {
5708 pub const STREAM = 1;5711 pub const STREAM = 1;
...@@ -10824,8 +10827,8 @@ pub const LC = enum(c_int) {...@@ -10824,8 +10827,8 @@ pub const LC = enum(c_int) {
1082410827
10825pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8;10828pub extern "c" fn setlocale(category: LC, locale: ?[*:0]const u8) ?[*:0]const u8;
1082610829
10827pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd)10830pub const getcontext = if (builtin.target.abi.isAndroid() or builtin.target.os.tag == .openbsd or builtin.target.os.tag == .haiku)
10828{} // android bionic and openbsd libc does not implement getcontext10831{} // libc does not implement getcontext
10829 else if (native_os == .linux and builtin.target.abi.isMusl())10832 else if (native_os == .linux and builtin.target.abi.isMusl())
10830 linux.getcontext10833 linux.getcontext
10831 else10834 else
lib/std/c/haiku.zig+5
...@@ -23,6 +23,11 @@ pub extern "root" fn get_system_info(system_info: *system_info) usize;...@@ -23,6 +23,11 @@ pub extern "root" fn get_system_info(system_info: *system_info) usize;
23pub extern "root" fn _get_team_info(team: i32, team_info: *team_info, size: usize) i32;23pub extern "root" fn _get_team_info(team: i32, team_info: *team_info, size: usize) i32;
24pub extern "root" fn _get_next_area_info(team: i32, cookie: *i64, area_info: *area_info, size: usize) i32;24pub extern "root" fn _get_next_area_info(team: i32, cookie: *i64, area_info: *area_info, size: usize) i32;
25pub extern "root" fn _get_next_image_info(team: i32, cookie: *i32, image_info: *image_info, size: usize) i32;25pub extern "root" fn _get_next_image_info(team: i32, cookie: *i32, image_info: *image_info, size: usize) i32;
26pub extern "root" fn _kern_get_current_team() team_id;
27pub extern "root" fn _kern_open_dir(fd: fd_t, path: [*:0]const u8) fd_t;
28pub extern "root" fn _kern_read_dir(fd: fd_t, buffer: [*]u8, bufferSize: usize, maxCount: u32) isize;
29pub extern "root" fn _kern_rewind_dir(fd: fd_t) status_t;
30pub extern "root" fn _kern_read_stat(fd: fd_t, path: [*:0]const u8, traverseLink: bool, stat: *std.c.Stat, statSize: usize) status_t;
2631
27pub const area_info = extern struct {32pub const area_info = extern struct {
28 area: u32,33 area: u32,
lib/std/crypto/Certificate/Bundle.zig+1
...@@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {...@@ -64,6 +64,7 @@ pub fn rescan(cb: *Bundle, gpa: Allocator) RescanError!void {
64 .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),64 .netbsd => return rescanWithPath(cb, gpa, "/etc/openssl/certs/ca-certificates.crt"),
65 .dragonfly => return rescanWithPath(cb, gpa, "/usr/local/etc/ssl/cert.pem"),65 .dragonfly => return rescanWithPath(cb, gpa, "/usr/local/etc/ssl/cert.pem"),
66 .solaris, .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"),66 .solaris, .illumos => return rescanWithPath(cb, gpa, "/etc/ssl/cacert.pem"),
67 .haiku => return rescanWithPath(cb, gpa, "/boot/system/data/ssl/CARootCertificates.pem"),
67 // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L1968 // https://github.com/SerenityOS/serenity/blob/222acc9d389bc6b490d4c39539761b043a4bfcb0/Ports/ca-certificates/package.sh#L19
68 .serenity => return rescanWithPath(cb, gpa, "/etc/ssl/certs/ca-certificates.crt"),69 .serenity => return rescanWithPath(cb, gpa, "/etc/ssl/certs/ca-certificates.crt"),
69 .windows => return rescanWindows(cb, gpa),70 .windows => return rescanWindows(cb, gpa),
lib/std/fs/Dir.zig+2-1
...@@ -13,6 +13,7 @@ pub const Entry = struct {...@@ -13,6 +13,7 @@ pub const Entry = struct {
1313
14const IteratorError = error{14const IteratorError = error{
15 AccessDenied,15 AccessDenied,
16 PermissionDenied,
16 SystemResources,17 SystemResources,
17 /// WASI-only. The path of an entry could not be encoded as valid UTF-8.18 /// WASI-only. The path of an entry could not be encoded as valid UTF-8.
18 /// WASI is unable to handle paths that cannot be encoded as well-formed UTF-8.19 /// WASI is unable to handle paths that cannot be encoded as well-formed UTF-8.
...@@ -287,7 +288,7 @@ pub const Iterator = switch (native_os) {...@@ -287,7 +288,7 @@ pub const Iterator = switch (native_os) {
287 name,288 name,
288 false,289 false,
289 &stat_info,290 &stat_info,
290 0,291 @sizeOf(posix.Stat),
291 )))) {292 )))) {
292 .SUCCESS => {},293 .SUCCESS => {},
293 .INVAL => unreachable,294 .INVAL => unreachable,