@@ -614,27 +614,28 @@ pub fn build(b: *std.Build) void {
614614const ModuleTest = modules .ModuleTest ;
615615
616616fn discoverBuiltinRocFiles (b : * std.Build ) ! []const []const u8 {
617- var builtin_roc_dir = try std .fs .cwd ().openDir ("src/build/roc" , .{ .iterate = true });
617+ const builtin_roc_path = try b .build_root .join (b .allocator , &.{ "src" , "build" , "roc" });
618+ var builtin_roc_dir = try std .fs .openDirAbsolute (builtin_roc_path , .{ .iterate = true });
618619 defer builtin_roc_dir .close ();
619620
620- var roc_files = std .array_list . Managed ([]const u8 ).init ( b . allocator ) ;
621- errdefer roc_files .deinit ();
621+ var roc_files = std .ArrayList ([]const u8 ).empty ;
622+ errdefer roc_files .deinit (b . allocator );
622623
623624 var iter = builtin_roc_dir .iterate ();
624625 while (try iter .next ()) | entry | {
625626 if (entry .kind == .file and std .mem .endsWith (u8 , entry .name , ".roc" )) {
626627 const full_path = b .fmt ("src/build/roc/{s}" , .{entry .name });
627- try roc_files .append (full_path );
628+ try roc_files .append (b . allocator , full_path );
628629 }
629630 }
630631
631- return roc_files .toOwnedSlice ();
632+ return roc_files .toOwnedSlice (b . allocator );
632633}
633634
634635fn generateCompiledBuiltinsSource (b : * std.Build , roc_files : []const []const u8 ) ! []const u8 {
635- var builtins_source = std .array_list . Managed (u8 ).init ( b . allocator ) ;
636- errdefer builtins_source .deinit ();
637- const writer = builtins_source .writer ();
636+ var builtins_source = std .ArrayList (u8 ).empty ;
637+ errdefer builtins_source .deinit (b . allocator );
638+ const writer = builtins_source .writer (b . allocator );
638639
639640 for (roc_files ) | roc_path | {
640641 const roc_basename = std .fs .path .basename (roc_path );
@@ -651,7 +652,7 @@ fn generateCompiledBuiltinsSource(b: *std.Build, roc_files: []const []const u8)
651652 // Also embed builtin_indices.bin
652653 try writer .writeAll ("pub const builtin_indices_bin = @embedFile(\" builtin_indices.bin\" );\n " );
653654
654- return builtins_source .toOwnedSlice ();
655+ return builtins_source .toOwnedSlice (b . allocator );
655656}
656657
657658fn add_fuzz_target (
@@ -748,7 +749,7 @@ fn addMainExe(
748749 .root_source_file = b .path ("test/str/platform/host.zig" ),
749750 .target = target ,
750751 .optimize = optimize ,
751- .strip = true ,
752+ .strip = optimize != .Debug ,
752753 .pic = true , // Enable Position Independent Code for PIE compatibility
753754 }),
754755 });
@@ -772,7 +773,7 @@ fn addMainExe(
772773 .root_source_file = b .path ("test/int/platform/host.zig" ),
773774 .target = target ,
774775 .optimize = optimize ,
775- .strip = true ,
776+ .strip = optimize != .Debug ,
776777 .pic = true , // Enable Position Independent Code for PIE compatibility
777778 }),
778779 });
@@ -805,7 +806,7 @@ fn addMainExe(
805806 .root_source_file = b .path ("test/int/platform/host.zig" ),
806807 .target = cross_resolved_target ,
807808 .optimize = optimize ,
808- .strip = true ,
809+ .strip = optimize != .Debug ,
809810 .pic = true ,
810811 }),
811812 .linkage = .static ,
@@ -850,7 +851,7 @@ fn addMainExe(
850851 .root_source_file = b .path ("src/interpreter_shim/main.zig" ),
851852 .target = target ,
852853 .optimize = optimize ,
853- .strip = true ,
854+ .strip = optimize != .Debug ,
854855 .pic = true , // Enable Position Independent Code for PIE compatibility
855856 }),
856857 .linkage = .static ,
@@ -928,13 +929,13 @@ const ParsedBuildArgs = struct {
928929};
929930
930931fn appendFilter (
931- list : * std .array_list . Managed ([]const u8 ),
932+ list : * std .ArrayList ([]const u8 ),
932933 b : * std.Build ,
933934 value : []const u8 ,
934935) void {
935936 const trimmed = std .mem .trim (u8 , value , " \t \n \r " );
936937 if (trimmed .len == 0 ) return ;
937- list .append (b .dupe (trimmed )) catch @panic ("OOM while parsing --test-filter value" );
938+ list .append (b .allocator , b . dupe (trimmed )) catch @panic ("OOM while parsing --test-filter value" );
938939}
939940
940941fn parseBuildArgs (b : * std.Build ) ParsedBuildArgs {
@@ -943,8 +944,8 @@ fn parseBuildArgs(b: *std.Build) ParsedBuildArgs {
943944 .test_filters = &.{},
944945 };
945946
946- var run_args_list = std .array_list . Managed ([]const u8 ).init ( b . allocator ) ;
947- var filter_list = std .array_list . Managed ([]const u8 ).init ( b . allocator ) ;
947+ var run_args_list = std .ArrayList ([]const u8 ).empty ;
948+ var filter_list = std .ArrayList ([]const u8 ).empty ;
948949
949950 var i : usize = 0 ;
950951 while (i < raw_args .len ) {
@@ -969,12 +970,12 @@ fn parseBuildArgs(b: *std.Build) ParsedBuildArgs {
969970 continue ;
970971 }
971972
972- run_args_list .append (arg ) catch @panic ("OOM while recording build arguments" );
973+ run_args_list .append (b . allocator , arg ) catch @panic ("OOM while recording build arguments" );
973974 i += 1 ;
974975 }
975976
976- const run_args = run_args_list .toOwnedSlice () catch @panic ("OOM while finalizing build arguments" );
977- const test_filters = filter_list .toOwnedSlice () catch @panic ("OOM while finalizing test filters" );
977+ const run_args = run_args_list .toOwnedSlice (b . allocator ) catch @panic ("OOM while finalizing build arguments" );
978+ const test_filters = filter_list .toOwnedSlice (b . allocator ) catch @panic ("OOM while finalizing test filters" );
978979
979980 return .{ .run_args = run_args , .test_filters = test_filters };
980981}
@@ -1398,10 +1399,10 @@ fn getCompilerVersion(b: *std.Build, optimize: OptimizeMode) []const u8 {
13981399fn generateGlibcStub (b : * std.Build , target : ResolvedTarget , target_name : []const u8 ) ? * Step.UpdateSourceFiles {
13991400
14001401 // Generate assembly stub with comprehensive symbols using the new build module
1401- var assembly_buf = std .array_list . Managed (u8 ).init ( b . allocator ) ;
1402- defer assembly_buf .deinit ();
1402+ var assembly_buf = std .ArrayList (u8 ).empty ;
1403+ defer assembly_buf .deinit (b . allocator );
14031404
1404- const writer = assembly_buf .writer ();
1405+ const writer = assembly_buf .writer (b . allocator );
14051406 const target_arch = target .result .cpu .arch ;
14061407 const target_abi = target .result .abi ;
14071408
0 commit comments