authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-17 02:44:16-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-26 10:33:17-08:00
logd51aa9748f9e4e3616328a207a8047ff37d81f8b
tree6f517deb55ab4059c8dd10d3618ac2e2c87019b5
parent031f23117dadd84b1e7189ee5b0f712eeb23ca1e

change default WASI stack size

to match the other operating systems. 16 MiB closes #18885

4 files changed, 10 insertions(+), 16 deletions(-)

lib/std/compress/flate.zig+3-3
...@@ -79,9 +79,9 @@ const fixedBufferStream = std.io.fixedBufferStream;...@@ -79,9 +79,9 @@ const fixedBufferStream = std.io.fixedBufferStream;
79const print = std.debug.print;79const print = std.debug.print;
80const builtin = @import("builtin");80const builtin = @import("builtin");
8181
82test "flate" {82test {
83 _ = @import("flate/deflate.zig");83 _ = deflate;
84 _ = @import("flate/inflate.zig");84 _ = inflate;
85}85}
8686
87test "flate compress/decompress" {87test "flate compress/decompress" {
lib/std/compress/flate/deflate.zig+3-7
...@@ -530,9 +530,7 @@ fn SimpleCompressor(...@@ -530,9 +530,7 @@ fn SimpleCompressor(
530530
531const builtin = @import("builtin");531const builtin = @import("builtin");
532532
533test "flate.Deflate tokenization" {533test "tokenization" {
534 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
535
536 const L = Token.initLiteral;534 const L = Token.initLiteral;
537 const M = Token.initMatch;535 const M = Token.initMatch;
538536
...@@ -607,9 +605,7 @@ const TestTokenWriter = struct {...@@ -607,9 +605,7 @@ const TestTokenWriter = struct {
607 pub fn flush(_: *Self) !void {}605 pub fn flush(_: *Self) !void {}
608};606};
609607
610test "flate deflate file tokenization" {608test "file tokenization" {
611 if (builtin.target.cpu.arch == .wasm32) return error.SkipZigTest;
612
613 const levels = [_]Level{ .level_4, .level_5, .level_6, .level_7, .level_8, .level_9 };609 const levels = [_]Level{ .level_4, .level_5, .level_6, .level_7, .level_8, .level_9 };
614 const cases = [_]struct {610 const cases = [_]struct {
615 data: []const u8, // uncompressed content611 data: []const u8, // uncompressed content
...@@ -718,7 +714,7 @@ fn TokenDecoder(comptime WriterType: type) type {...@@ -718,7 +714,7 @@ fn TokenDecoder(comptime WriterType: type) type {
718 };714 };
719}715}
720716
721test "flate.Deflate store simple compressor" {717test "store simple compressor" {
722 const data = "Hello world!";718 const data = "Hello world!";
723 const expected = [_]u8{719 const expected = [_]u8{
724 0x1, // block type 0, final bit set720 0x1, // block type 0, final bit set
src/link/Wasm.zig+4-1
...@@ -418,7 +418,10 @@ pub fn createEmpty(...@@ -418,7 +418,10 @@ pub fn createEmpty(
418 .zcu_object_sub_path = zcu_object_sub_path,418 .zcu_object_sub_path = zcu_object_sub_path,
419 .gc_sections = options.gc_sections orelse (output_mode != .Obj),419 .gc_sections = options.gc_sections orelse (output_mode != .Obj),
420 .print_gc_sections = options.print_gc_sections,420 .print_gc_sections = options.print_gc_sections,
421 .stack_size = options.stack_size orelse std.wasm.page_size * 16, // 1MB421 .stack_size = options.stack_size orelse switch (target.os.tag) {
422 .freestanding => 1 * 1024 * 1024, // 1 MiB
423 else => 16 * 1024 * 1024, // 16 MiB
424 },
422 .allow_shlib_undefined = options.allow_shlib_undefined orelse false,425 .allow_shlib_undefined = options.allow_shlib_undefined orelse false,
423 .file = null,426 .file = null,
424 .disable_lld_caching = options.disable_lld_caching,427 .disable_lld_caching = options.disable_lld_caching,
test/tests.zig-5
...@@ -1138,11 +1138,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {...@@ -1138,11 +1138,6 @@ pub fn addModuleTests(b: *std.Build, options: ModuleTestOptions) *Step {
11381138
1139 for (options.include_paths) |include_path| these_tests.addIncludePath(.{ .path = include_path });1139 for (options.include_paths) |include_path| these_tests.addIncludePath(.{ .path = include_path });
11401140
1141 if (target.os.tag == .wasi) {
1142 // WASI's default stack size can be too small for some big tests.
1143 these_tests.stack_size = 2 * 1024 * 1024;
1144 }
1145
1146 const qualified_name = b.fmt("{s}-{s}-{s}-{s}{s}{s}{s}{s}{s}", .{1141 const qualified_name = b.fmt("{s}-{s}-{s}-{s}{s}{s}{s}{s}{s}", .{
1147 options.name,1142 options.name,
1148 triple_txt,1143 triple_txt,