-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.zig
More file actions
1755 lines (1655 loc) · 93.7 KB
/
Copy pathbuild.zig
File metadata and controls
1755 lines (1655 loc) · 93.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const tsan = b.option(bool, "tsan", "Build tests with ThreadSanitizer") orelse false;
// Homegrown regex engine, used to back JS RegExp.
const regex_dep = b.dependency("zig_regex", .{ .target = target, .optimize = optimize });
const regex_mod = regex_dep.module("regex");
// Precise tracing GC (issue #1 Phase 7). Opt-in contexts route heap cells
// through it; src/gc.zig supplies the engine binding. See P7-gc-design.md.
const gc_dep = b.dependency("zig_gc", .{ .target = target, .optimize = optimize });
const gc_mod = gc_dep.module("gc");
// The importable module: `@import("js")` once a consumer adds this package.
const mod = b.addModule("js", .{
.root_source_file = b.path("src/root.zig"),
.target = target,
.imports = &.{
.{ .name = "regex", .module = regex_mod },
.{ .name = "gc", .module = gc_mod },
},
});
// A static library exposing the implemented C API symbols. Some names are
// JavaScriptCore-shaped for embedding convenience, but pre-stabilization API
// cleanup should prefer clear zig-js semantics over inert compatibility shims.
const lib = b.addLibrary(.{
.linkage = .static,
.name = "zig-js",
.root_module = b.createModule(.{
.root_source_file = b.path("src/c_api.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.imports = &.{
.{ .name = "regex", .module = regex_mod },
.{ .name = "gc", .module = gc_mod },
},
}),
});
const private_abi_consumer = b.option(
[]const u8,
"private-abi-consumer",
"Private ABI tag layout to compile: home or bun",
) orelse "home";
const private_abi_is_bun = if (std.mem.eql(u8, private_abi_consumer, "home"))
false
else if (std.mem.eql(u8, private_abi_consumer, "bun"))
true
else
std.debug.panic("unknown private-abi-consumer '{s}'; expected home or bun", .{private_abi_consumer});
const private_abi_options = b.addOptions();
private_abi_options.addOption(bool, "is_bun", private_abi_is_bun);
mod.addOptions("private_abi_options", private_abi_options);
lib.root_module.addOptions("private_abi_options", private_abi_options);
// Focused Home and Bun fixtures may run together. Compile the opposite
// private-tag profile once so neither fixture inherits the command-line
// profile intended for the installed library.
const fixture_private_abi_options = b.addOptions();
fixture_private_abi_options.addOption(bool, "is_bun", !private_abi_is_bun);
const fixture_private_lib = b.addLibrary(.{
.linkage = .static,
.name = if (private_abi_is_bun) "zig-js-private-home" else "zig-js-private-bun",
.root_module = b.createModule(.{
.root_source_file = b.path("src/c_api.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.imports = &.{
.{ .name = "regex", .module = regex_mod },
.{ .name = "gc", .module = gc_mod },
},
}),
});
fixture_private_lib.root_module.addOptions("private_abi_options", fixture_private_abi_options);
const home_private_lib = if (private_abi_is_bun) fixture_private_lib else lib;
const bun_private_lib = if (private_abi_is_bun) lib else fixture_private_lib;
var installed_library: ?std.Build.LazyPath = null;
var objc_bridge_object: ?std.Build.LazyPath = null;
if (target.result.os.tag == .macos) {
const compile_objc_bridge = b.addSystemCommand(&.{
"xcrun", "--sdk", "macosx", "clang",
"-fobjc-arc", "-fblocks", "-Wno-incomplete-implementation",
});
compile_objc_bridge.addPrefixedDirectoryArg("-I", b.path("include"));
compile_objc_bridge.addArg("-c");
compile_objc_bridge.addFileArg(b.path("src/objc_bridge.m"));
compile_objc_bridge.addArg("-o");
objc_bridge_object = compile_objc_bridge.addOutputFileArg("objc_bridge.o");
const merge_library = b.addSystemCommand(&.{
"python3",
"tools/merge-static-library.py",
});
installed_library = merge_library.addOutputFileArg("libzig-js.a");
merge_library.addArtifactArg(lib);
merge_library.addFileArg(objc_bridge_object.?);
b.getInstallStep().dependOn(&b.addInstallLibFile(installed_library.?, "libzig-js.a").step);
} else {
b.installArtifact(lib);
}
b.getInstallStep().dependOn(&b.addInstallDirectory(.{
.source_dir = b.path("include"),
.install_dir = .header,
.install_subdir = "",
}).step);
// Pinned public-C declaration/export drift gate plus small real-host ABI
// checks. These stay separate from the world-sized Zig unit-test artifact.
const c_api_audit_cmd = b.addSystemCommand(&.{
"python3",
"tools/verify-c-api.py",
});
const c_api_audit_step = b.step("c-api-audit", "Verify pinned JSC declarations, inventory, and Zig exports");
c_api_audit_step.dependOn(&c_api_audit_cmd.step);
const home_public_abi_profile = b.option(
[]const u8,
"home-public-abi-profile",
"Exact supported Home public C ABI profile ID",
) orelse "home-public-c-7ed99c02";
const home_public_abi_audit_cmd = b.addSystemCommand(&.{
"python3",
"tools/verify-abi-profile.py",
"--profile",
home_public_abi_profile,
});
const home_source_root = b.option([]const u8, "home-source-root", "Optional pinned Home checkout to verify");
if (home_source_root) |root| {
home_public_abi_audit_cmd.addArgs(&.{ "--home-root", root });
}
const home_public_abi_audit_step = b.step(
"home-public-abi-audit",
"Verify the revision-pinned Home public C consumer profile",
);
home_public_abi_audit_step.dependOn(&home_public_abi_audit_cmd.step);
const home_private_abi_audit_cmd = b.addSystemCommand(&.{
"python3",
"tools/home-private-abi.py",
"--profile",
b.option([]const u8, "home-private-abi-profile", "Exact supported Home private ABI profile ID") orelse "home-private-7ed99c02",
});
if (home_source_root) |root| home_private_abi_audit_cmd.addArgs(&.{ "--home-root", root });
const home_private_abi_audit_step = b.step(
"home-private-abi-audit",
"Verify the pinned Home private extern-fn inventory",
);
home_private_abi_audit_step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_abi_audit_cmd = b.addSystemCommand(&.{
"python3",
"tools/bun-private-abi.py",
});
const bun_source_root = b.option([]const u8, "bun-source-root", "Optional pinned Bun checkout to verify");
if (bun_source_root) |root| {
bun_private_abi_audit_cmd.addArgs(&.{ "--bun-root", root });
}
const bun_private_abi_audit_step = b.step(
"bun-private-abi-audit",
"Verify the pinned Bun core private extern-fn inventory",
);
bun_private_abi_audit_step.dependOn(&bun_private_abi_audit_cmd.step);
const private_jstype_abi_audit_cmd = b.addSystemCommand(&.{
"python3",
"tools/private-jstype-abi.py",
});
if (home_source_root) |root| {
if (bun_source_root) |bun_root| {
private_jstype_abi_audit_cmd.addArgs(&.{ "--home-root", root, "--bun-root", bun_root });
}
}
const private_jstype_abi_audit_step = b.step(
"private-jstype-abi-audit",
"Verify pinned Home and Bun private JSType layouts",
);
private_jstype_abi_audit_step.dependOn(&private_jstype_abi_audit_cmd.step);
const objc_api_audit_cmd = b.addSystemCommand(&.{
"python3",
"tools/verify-objc-api.py",
});
const objc_api_audit_step = b.step("objc-api-audit", "Verify the pinned Objective-C JSC inventory");
objc_api_audit_step.dependOn(&objc_api_audit_cmd.step);
if (target.result.os.tag == .macos) {
const objc_header_smoke = b.addSystemCommand(&.{
"xcrun",
"--sdk",
"macosx",
"clang",
"-fsyntax-only",
"-fobjc-arc",
"-fblocks",
"-Iinclude",
"tests/objc_api_headers_smoke.m",
});
objc_header_smoke.step.dependOn(&objc_api_audit_cmd.step);
const objc_header_step = b.step("test-objc-api-headers", "Compile the Objective-C bridge headers on macOS");
objc_header_step.dependOn(&objc_header_smoke.step);
const objc_runtime_smoke = b.addExecutable(.{
.name = "objc-api-runtime-smoke",
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
}),
});
objc_runtime_smoke.root_module.addCSourceFile(.{
.file = b.path("tests/objc_api_runtime_smoke.m"),
.flags = &.{ "-fobjc-arc", "-fblocks", "-Wno-arc-retain-cycles" },
});
objc_runtime_smoke.root_module.addIncludePath(b.path("include"));
objc_runtime_smoke.root_module.addObjectFile(installed_library.?);
objc_runtime_smoke.root_module.linkFramework("Foundation", .{});
objc_runtime_smoke.root_module.linkSystemLibrary("ffi", .{});
const run_objc_runtime_smoke = b.addRunArtifact(objc_runtime_smoke);
run_objc_runtime_smoke.step.dependOn(&objc_api_audit_cmd.step);
const objc_runtime_step = b.step("test-objc-api", "Compile, link, and run the Objective-C bridge host");
objc_runtime_step.dependOn(&run_objc_runtime_smoke.step);
const objc_lifetime_stress = b.addExecutable(.{
.name = "objc-api-lifetime-stress",
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
}),
});
objc_lifetime_stress.root_module.addCSourceFile(.{
.file = b.path("tests/objc_api_lifetime_stress.m"),
.flags = &.{ "-fobjc-arc", "-fblocks", "-Wno-arc-retain-cycles", "-Wno-objc-circular-container" },
});
objc_lifetime_stress.root_module.addIncludePath(b.path("include"));
objc_lifetime_stress.root_module.addObjectFile(installed_library.?);
objc_lifetime_stress.root_module.linkFramework("Foundation", .{});
objc_lifetime_stress.root_module.linkSystemLibrary("ffi", .{});
const run_objc_lifetime_stress = b.addRunArtifact(objc_lifetime_stress);
run_objc_lifetime_stress.step.dependOn(&objc_api_audit_cmd.step);
const objc_lifetime_step = b.step("test-objc-api-lifetime", "Stress Objective-C VM, wrapper, managed-reference, and autorelease teardown");
objc_lifetime_step.dependOn(&run_objc_lifetime_stress.step);
const objc_sanitized_stress = b.addSystemCommand(&.{
"xcrun", "--sdk", "macosx", "clang",
"-fobjc-arc", "-fblocks", "-Wno-arc-retain-cycles", "-Wno-objc-circular-container",
"-Wno-incomplete-implementation", "-fsanitize=address,undefined",
});
objc_sanitized_stress.addPrefixedDirectoryArg("-I", b.path("include"));
objc_sanitized_stress.addFileArg(b.path("tests/objc_api_lifetime_stress.m"));
objc_sanitized_stress.addFileArg(b.path("src/objc_bridge.m"));
objc_sanitized_stress.addArtifactArg(lib);
objc_sanitized_stress.addArgs(&.{ "-lffi", "-framework", "Foundation", "-o" });
const objc_sanitized_executable = objc_sanitized_stress.addOutputFileArg("objc-api-lifetime-sanitized");
const run_objc_sanitized_stress = b.addSystemCommand(&.{"env"});
run_objc_sanitized_stress.addFileArg(objc_sanitized_executable);
const objc_sanitize_step = b.step("test-objc-api-sanitize", "Run Objective-C lifetime stress under ASan and UBSan");
objc_sanitize_step.dependOn(&run_objc_sanitized_stress.step);
const objc_leak_stress = b.addSystemCommand(&.{ "leaks", "-q", "--atExit", "--" });
objc_leak_stress.addArtifactArg(objc_lifetime_stress);
objc_leak_stress.step.dependOn(&objc_api_audit_cmd.step);
const objc_leak_step = b.step("test-objc-api-leaks", "Run Objective-C lifetime stress under the macOS leak checker");
objc_leak_step.dependOn(&objc_leak_stress.step);
const objc_fault_injection = b.addSystemCommand(&.{
"xcrun", "--sdk", "macosx", "clang", "-fobjc-arc", "-fblocks",
"-Wno-incomplete-implementation", "-DZJS_OBJC_BRIDGE_FAULT_INJECTION=1",
});
objc_fault_injection.addPrefixedDirectoryArg("-I", b.path("include"));
objc_fault_injection.addFileArg(b.path("tests/objc_api_fault_injection.m"));
objc_fault_injection.addFileArg(b.path("src/objc_bridge.m"));
objc_fault_injection.addArtifactArg(lib);
objc_fault_injection.addArgs(&.{ "-lffi", "-framework", "Foundation", "-o" });
const objc_fault_executable = objc_fault_injection.addOutputFileArg("objc-api-fault-injection");
const run_objc_fault_injection = b.addSystemCommand(&.{"env"});
run_objc_fault_injection.addFileArg(objc_fault_executable);
const objc_fault_step = b.step("test-objc-api-faults", "Inject Objective-C bridge allocation and registration failures");
objc_fault_step.dependOn(&run_objc_fault_injection.step);
const objc_jsc_diff_cmd = b.addSystemCommand(&.{ "python3", "tools/objc-api-jsc-diff.py" });
objc_jsc_diff_cmd.addFileArg(installed_library.?);
const objc_jsc_diff_step = b.step("objc-api-jsc-diff", "Compare Objective-C bridge behavior with pinned system JSC");
objc_jsc_diff_step.dependOn(&objc_jsc_diff_cmd.step);
const objc_evidence_step = b.step("test-objc-api-evidence", "Run the complete Objective-C bridge evidence matrix");
objc_evidence_step.dependOn(&objc_header_smoke.step);
objc_evidence_step.dependOn(&run_objc_runtime_smoke.step);
objc_evidence_step.dependOn(&objc_jsc_diff_cmd.step);
objc_evidence_step.dependOn(&run_objc_lifetime_stress.step);
objc_evidence_step.dependOn(&run_objc_sanitized_stress.step);
objc_evidence_step.dependOn(&objc_leak_stress.step);
objc_evidence_step.dependOn(&run_objc_fault_injection.step);
}
const c_api_c_smoke = b.addExecutable(.{
.name = "c-api-smoke-c",
.root_module = b.createModule(.{ .target = target, .optimize = optimize, .link_libc = true }),
});
c_api_c_smoke.root_module.addCSourceFile(.{ .file = b.path("tests/c_api_smoke.c") });
c_api_c_smoke.root_module.addIncludePath(b.path("include"));
c_api_c_smoke.root_module.linkLibrary(lib);
const run_c_api_c_smoke = b.addRunArtifact(c_api_c_smoke);
run_c_api_c_smoke.step.dependOn(&c_api_audit_cmd.step);
const c_api_cpp_smoke = b.addExecutable(.{
.name = "c-api-smoke-cpp",
.root_module = b.createModule(.{ .target = target, .optimize = optimize, .link_libc = true, .link_libcpp = true }),
});
c_api_cpp_smoke.root_module.addCSourceFile(.{ .file = b.path("tests/c_api_smoke.cpp") });
c_api_cpp_smoke.root_module.addIncludePath(b.path("include"));
c_api_cpp_smoke.root_module.linkLibrary(lib);
const run_c_api_cpp_smoke = b.addRunArtifact(c_api_cpp_smoke);
run_c_api_cpp_smoke.step.dependOn(&c_api_audit_cmd.step);
const c_api_inspector_smoke = b.addExecutable(.{
.name = "c-api-inspector-smoke",
.root_module = b.createModule(.{ .target = target, .optimize = optimize, .link_libc = true }),
});
c_api_inspector_smoke.root_module.addCSourceFile(.{ .file = b.path("tests/c_api_inspector_smoke.c") });
c_api_inspector_smoke.root_module.addIncludePath(b.path("include"));
c_api_inspector_smoke.root_module.linkLibrary(lib);
const run_c_api_inspector_smoke = b.addRunArtifact(c_api_inspector_smoke);
run_c_api_inspector_smoke.step.dependOn(&c_api_audit_cmd.step);
const c_api_test_step = b.step("test-c-api", "Compile, link, and run C and C++ public-ABI hosts");
c_api_test_step.dependOn(&run_c_api_c_smoke.step);
c_api_test_step.dependOn(&run_c_api_cpp_smoke.step);
c_api_test_step.dependOn(&run_c_api_inspector_smoke.step);
const home_public_abi_fixture = b.addExecutable(.{
.name = "home-public-abi-7ed99c02",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/home_public_c_7ed99c02.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
}),
});
home_public_abi_fixture.root_module.linkLibrary(lib);
const run_home_public_abi_fixture = b.addRunArtifact(home_public_abi_fixture);
run_home_public_abi_fixture.step.dependOn(&home_public_abi_audit_cmd.step);
const home_public_abi_test_step = b.step(
"test-home-public-abi",
"Compile, link, and run the pinned Home Zig C-ABI consumer",
);
home_public_abi_test_step.dependOn(&run_home_public_abi_fixture.step);
const private_encoded_value_fixture = b.addExecutable(.{
.name = "private-encoded-value-smoke",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_encoded_value_smoke.zig"),
.target = target,
.optimize = optimize,
.imports = &.{.{ .name = "js", .module = mod }},
}),
});
const run_private_encoded_value_fixture = b.addRunArtifact(private_encoded_value_fixture);
const private_encoded_value_tests = b.addTest(.{
.root_module = b.createModule(.{
.root_source_file = b.path("src/private_abi/encoded_value.zig"),
.target = target,
.optimize = optimize,
}),
});
const run_private_encoded_value_tests = b.addRunArtifact(private_encoded_value_tests);
const private_encoded_value_step = b.step(
"test-private-abi-value",
"Verify the pinned JSC64 EncodedJSValue boundary codec",
);
private_encoded_value_step.dependOn(&run_private_encoded_value_fixture.step);
private_encoded_value_step.dependOn(&run_private_encoded_value_tests.step);
const home_private_value_fixture = b.addExecutable(.{
.name = "home-private-value-shims",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/home_private_value_shims.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
home_private_value_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_value_fixture = b.addRunArtifact(home_private_value_fixture);
run_home_private_value_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const home_private_abi_test_step = b.step(
"test-home-private-abi",
"Compile, link, and run implemented Home private-ABI slices",
);
home_private_abi_test_step.dependOn(&run_home_private_value_fixture.step);
const home_private_consumer_providers_fixture = b.addExecutable(.{
.name = "home-private-consumer-providers",
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.link_libcpp = true,
.sanitize_thread = tsan,
}),
});
home_private_consumer_providers_fixture.root_module.addCSourceFile(.{
.file = b.path("tests/abi/private_consumer_providers.cpp"),
});
home_private_consumer_providers_fixture.root_module.addIncludePath(b.path("include"));
home_private_consumer_providers_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_consumer_providers_fixture = b.addRunArtifact(home_private_consumer_providers_fixture);
run_home_private_consumer_providers_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_consumer_providers_fixture = b.addExecutable(.{
.name = "bun-private-consumer-providers",
.root_module = b.createModule(.{
.target = target,
.optimize = optimize,
.link_libc = true,
.link_libcpp = true,
.sanitize_thread = tsan,
}),
});
bun_private_consumer_providers_fixture.root_module.addCSourceFile(.{
.file = b.path("tests/abi/private_consumer_providers.cpp"),
});
bun_private_consumer_providers_fixture.root_module.addIncludePath(b.path("include"));
bun_private_consumer_providers_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_consumer_providers_fixture = b.addRunArtifact(bun_private_consumer_providers_fixture);
run_bun_private_consumer_providers_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_consumer_providers_test_step = b.step(
"test-private-consumer-providers",
"Compile, final-link, and run both pinned consumer-provider witnesses",
);
private_consumer_providers_test_step.dependOn(&run_home_private_consumer_providers_fixture.step);
private_consumer_providers_test_step.dependOn(&run_bun_private_consumer_providers_fixture.step);
const bun_private_sql_structure_fixture = b.addExecutable(.{
.name = "bun-private-sql-structure",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_sql_structure.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
bun_private_sql_structure_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_sql_structure_fixture = b.addRunArtifact(bun_private_sql_structure_fixture);
run_bun_private_sql_structure_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_sql_structure_test_step = b.step(
"test-bun-private-sql-structure",
"Compile, link, and run Bun's private SQL Structure boundary",
);
bun_private_sql_structure_test_step.dependOn(&run_bun_private_sql_structure_fixture.step);
const home_private_global_lifecycle_fixture = b.addExecutable(.{
.name = "home-private-global-lifecycle",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/home_private_global_lifecycle.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
home_private_global_lifecycle_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_global_lifecycle_fixture = b.addRunArtifact(home_private_global_lifecycle_fixture);
run_home_private_global_lifecycle_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_global_lifecycle_fixture = b.addExecutable(.{
.name = "bun-private-global-lifecycle",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_global_lifecycle.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
bun_private_global_lifecycle_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_global_lifecycle_fixture = b.addRunArtifact(bun_private_global_lifecycle_fixture);
run_bun_private_global_lifecycle_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_global_lifecycle_test_step = b.step(
"test-private-global-lifecycle",
"Compile, link, and run both pinned global-object lifecycle boundaries",
);
private_global_lifecycle_test_step.dependOn(&run_home_private_global_lifecycle_fixture.step);
private_global_lifecycle_test_step.dependOn(&run_bun_private_global_lifecycle_fixture.step);
const home_private_process_initialization_fixture = b.addExecutable(.{
.name = "home-private-process-initialization",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/home_private_process_initialization.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
home_private_process_initialization_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_process_initialization_fixture = b.addRunArtifact(home_private_process_initialization_fixture);
run_home_private_process_initialization_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_process_initialization_fixture = b.addExecutable(.{
.name = "bun-private-process-initialization",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_process_initialization.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
bun_private_process_initialization_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_process_initialization_fixture = b.addRunArtifact(bun_private_process_initialization_fixture);
run_bun_private_process_initialization_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_process_initialization_test_step = b.step(
"test-private-process-initialization",
"Compile, link, and run both pinned process initialization boundaries",
);
private_process_initialization_test_step.dependOn(&run_home_private_process_initialization_fixture.step);
private_process_initialization_test_step.dependOn(&run_bun_private_process_initialization_fixture.step);
const bun_private_abort_signal_fixture = b.addExecutable(.{
.name = "bun-private-abort-signal",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_abort_signal.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
bun_private_abort_signal_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_abort_signal_fixture = b.addRunArtifact(bun_private_abort_signal_fixture);
run_bun_private_abort_signal_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_abort_signal_test_step = b.step(
"test-bun-private-abort-signal",
"Compile, link, and run Bun's private AbortSignal timeout boundary",
);
bun_private_abort_signal_test_step.dependOn(&run_bun_private_abort_signal_fixture.step);
const bun_private_cached_bytecode_fixture = b.addExecutable(.{
.name = "bun-private-cached-bytecode",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_cached_bytecode.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
bun_private_cached_bytecode_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_cached_bytecode_fixture = b.addRunArtifact(bun_private_cached_bytecode_fixture);
run_bun_private_cached_bytecode_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_cached_bytecode_test_step = b.step(
"test-bun-private-cached-bytecode",
"Compile, link, and run Bun's private cached-bytecode boundary",
);
bun_private_cached_bytecode_test_step.dependOn(&run_bun_private_cached_bytecode_fixture.step);
const bun_private_vm_lifecycle_fixture = b.addExecutable(.{
.name = "bun-private-vm-lifecycle",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_vm_lifecycle.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_vm_lifecycle_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_vm_lifecycle_fixture = b.addRunArtifact(bun_private_vm_lifecycle_fixture);
run_bun_private_vm_lifecycle_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_vm_lifecycle_test_step = b.step(
"test-bun-private-vm-lifecycle",
"Compile, link, and run Bun's private VM lifecycle boundary",
);
bun_private_vm_lifecycle_test_step.dependOn(&run_bun_private_vm_lifecycle_fixture.step);
const home_private_hot_reload_fixture = b.addExecutable(.{
.name = "home-private-hot-reload",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_hot_reload.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
home_private_hot_reload_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_hot_reload_fixture = b.addRunArtifact(home_private_hot_reload_fixture);
run_home_private_hot_reload_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_hot_reload_fixture = b.addExecutable(.{
.name = "bun-private-hot-reload",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_hot_reload.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_hot_reload_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_hot_reload_fixture = b.addRunArtifact(bun_private_hot_reload_fixture);
run_bun_private_hot_reload_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_hot_reload_test_step = b.step(
"test-private-hot-reload",
"Compile, link, and run both pinned hot-reload inspector boundaries",
);
private_hot_reload_test_step.dependOn(&run_home_private_hot_reload_fixture.step);
private_hot_reload_test_step.dependOn(&run_bun_private_hot_reload_fixture.step);
const home_private_process_signal_fixture = b.addExecutable(.{
.name = "home-private-process-signal",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_process_signal.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
home_private_process_signal_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_process_signal_fixture = b.addRunArtifact(home_private_process_signal_fixture);
run_home_private_process_signal_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_process_signal_fixture = b.addExecutable(.{
.name = "bun-private-process-signal",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_process_signal.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
bun_private_process_signal_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_process_signal_fixture = b.addRunArtifact(bun_private_process_signal_fixture);
run_bun_private_process_signal_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_process_signal_test_step = b.step(
"test-private-process-signal",
"Compile, link, and run both pinned process-signal boundaries",
);
private_process_signal_test_step.dependOn(&run_home_private_process_signal_fixture.step);
private_process_signal_test_step.dependOn(&run_bun_private_process_signal_fixture.step);
const home_private_script_execution_context_fixture = b.addExecutable(.{
.name = "home-private-script-execution-context",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/home_private_script_execution_context.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
home_private_script_execution_context_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_script_execution_context_fixture = b.addRunArtifact(home_private_script_execution_context_fixture);
run_home_private_script_execution_context_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const home_private_script_execution_context_test_step = b.step(
"test-home-private-script-execution-context",
"Compile, link, and run Home's ScriptExecutionContext registry boundary",
);
home_private_script_execution_context_test_step.dependOn(&run_home_private_script_execution_context_fixture.step);
const home_private_module_registry_shims_fixture = b.addExecutable(.{
.name = "home-private-module-registry-shims",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_module_registry_shims.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
home_private_module_registry_shims_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_module_registry_shims_fixture = b.addRunArtifact(home_private_module_registry_shims_fixture);
run_home_private_module_registry_shims_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_module_registry_shims_fixture = b.addExecutable(.{
.name = "bun-private-module-registry-shims",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_module_registry_shims.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_module_registry_shims_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_module_registry_shims_fixture = b.addRunArtifact(bun_private_module_registry_shims_fixture);
run_bun_private_module_registry_shims_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_module_registry_shims_test_step = b.step(
"test-private-module-registry-shims",
"Compile, link, and run both retired module-registry snapshot shims",
);
private_module_registry_shims_test_step.dependOn(&run_home_private_module_registry_shims_fixture.step);
private_module_registry_shims_test_step.dependOn(&run_bun_private_module_registry_shims_fixture.step);
const home_private_heap_snapshot_fixture = b.addExecutable(.{
.name = "home-private-heap-snapshot",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/home_private_heap_snapshot.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
home_private_heap_snapshot_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_heap_snapshot_fixture = b.addRunArtifact(home_private_heap_snapshot_fixture);
run_home_private_heap_snapshot_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_heap_snapshot_fixture = b.addExecutable(.{
.name = "bun-private-heap-snapshot",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_heap_snapshot.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
bun_private_heap_snapshot_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_heap_snapshot_fixture = b.addRunArtifact(bun_private_heap_snapshot_fixture);
run_bun_private_heap_snapshot_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_heap_snapshot_test_step = b.step(
"test-private-heap-snapshot",
"Compile, link, and run both pinned heap-snapshot ownership profiles",
);
private_heap_snapshot_test_step.dependOn(&run_home_private_heap_snapshot_fixture.step);
private_heap_snapshot_test_step.dependOn(&run_bun_private_heap_snapshot_fixture.step);
const home_private_cpu_profile_fixture = b.addExecutable(.{
.name = "home-private-cpu-profile",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/home_private_cpu_profile.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
home_private_cpu_profile_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_cpu_profile_fixture = b.addRunArtifact(home_private_cpu_profile_fixture);
run_home_private_cpu_profile_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_cpu_profile_fixture = b.addExecutable(.{
.name = "bun-private-cpu-profile",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_cpu_profile.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
bun_private_cpu_profile_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_cpu_profile_fixture = b.addRunArtifact(bun_private_cpu_profile_fixture);
run_bun_private_cpu_profile_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_cpu_profile_test_step = b.step(
"test-private-cpu-profile",
"Compile, link, and run both pinned CPU-profiler ownership profiles",
);
private_cpu_profile_test_step.dependOn(&run_home_private_cpu_profile_fixture.step);
private_cpu_profile_test_step.dependOn(&run_bun_private_cpu_profile_fixture.step);
const home_private_readable_stream_fixture = b.addExecutable(.{
.name = "home-private-readable-stream",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_readable_stream.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
home_private_readable_stream_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_readable_stream_fixture = b.addRunArtifact(home_private_readable_stream_fixture);
run_home_private_readable_stream_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_readable_stream_fixture = b.addExecutable(.{
.name = "bun-private-readable-stream",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_readable_stream.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
bun_private_readable_stream_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_readable_stream_fixture = b.addRunArtifact(bun_private_readable_stream_fixture);
run_bun_private_readable_stream_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_readable_stream_test_step = b.step(
"test-private-readable-stream",
"Compile, link, and run both pinned ReadableStream consumer profiles",
);
private_readable_stream_test_step.dependOn(&run_home_private_readable_stream_fixture.step);
private_readable_stream_test_step.dependOn(&run_bun_private_readable_stream_fixture.step);
const home_private_wasm_streaming_fixture = b.addExecutable(.{
.name = "home-private-wasm-streaming-compiler",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_wasm_streaming_compiler.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
home_private_wasm_streaming_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_wasm_streaming_fixture = b.addRunArtifact(home_private_wasm_streaming_fixture);
run_home_private_wasm_streaming_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_wasm_streaming_fixture = b.addExecutable(.{
.name = "bun-private-wasm-streaming-compiler",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_wasm_streaming_compiler.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
.link_libc = true,
}),
});
bun_private_wasm_streaming_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_wasm_streaming_fixture = b.addRunArtifact(bun_private_wasm_streaming_fixture);
run_bun_private_wasm_streaming_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_wasm_streaming_test_step = b.step(
"test-private-wasm-streaming-compiler",
"Compile, link, and run both pinned Wasm StreamingCompiler profiles",
);
private_wasm_streaming_test_step.dependOn(&run_home_private_wasm_streaming_fixture.step);
private_wasm_streaming_test_step.dependOn(&run_bun_private_wasm_streaming_fixture.step);
const home_private_error_code_fixture = b.addExecutable(.{
.name = "home-private-error-code",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_error_code.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
home_private_error_code_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_error_code_fixture = b.addRunArtifact(home_private_error_code_fixture);
run_home_private_error_code_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_error_code_fixture = b.addExecutable(.{
.name = "bun-private-error-code",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_error_code.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_error_code_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_error_code_fixture = b.addRunArtifact(bun_private_error_code_fixture);
run_bun_private_error_code_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_error_code_test_step = b.step(
"test-private-error-code",
"Compile, link, and run both pinned ErrorCode diagnostic boundaries",
);
private_error_code_test_step.dependOn(&run_home_private_error_code_fixture.step);
private_error_code_test_step.dependOn(&run_bun_private_error_code_fixture.step);
const home_private_inspector_agents_fixture = b.addExecutable(.{
.name = "home-private-inspector-agents",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_inspector_agents.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
home_private_inspector_agents_fixture.root_module.linkLibrary(home_private_lib);
const run_home_private_inspector_agents_fixture = b.addRunArtifact(home_private_inspector_agents_fixture);
run_home_private_inspector_agents_fixture.step.dependOn(&home_private_abi_audit_cmd.step);
const bun_private_inspector_agents_fixture = b.addExecutable(.{
.name = "bun-private-inspector-agents",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/private_inspector_agents.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_inspector_agents_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_inspector_agents_fixture = b.addRunArtifact(bun_private_inspector_agents_fixture);
run_bun_private_inspector_agents_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const private_inspector_agents_test_step = b.step(
"test-private-inspector-agents",
"Compile, link, and run both pinned lifecycle/test inspector-agent boundaries",
);
private_inspector_agents_test_step.dependOn(&run_home_private_inspector_agents_fixture.step);
private_inspector_agents_test_step.dependOn(&run_bun_private_inspector_agents_fixture.step);
const bun_private_property_iterator_fixture = b.addExecutable(.{
.name = "bun-private-property-iterator",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_property_iterator.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_property_iterator_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_property_iterator_fixture = b.addRunArtifact(bun_private_property_iterator_fixture);
run_bun_private_property_iterator_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_property_iterator_test_step = b.step(
"test-bun-private-property-iterator",
"Compile, link, and run Bun's private property-iterator boundary",
);
bun_private_property_iterator_test_step.dependOn(&run_bun_private_property_iterator_fixture.step);
const bun_private_c_api_extensions_fixture = b.addExecutable(.{
.name = "bun-private-c-api-extensions",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_c_api_extensions.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_c_api_extensions_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_c_api_extensions_fixture = b.addRunArtifact(bun_private_c_api_extensions_fixture);
run_bun_private_c_api_extensions_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_c_api_extensions_test_step = b.step(
"test-bun-private-c-api-extensions",
"Compile, link, and run Bun's private call/proxy/async-context extensions",
);
bun_private_c_api_extensions_test_step.dependOn(&run_bun_private_c_api_extensions_fixture.step);
const bun_private_array_buffer_fixture = b.addExecutable(.{
.name = "bun-private-array-buffer",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_array_buffer.zig"),
.target = target,
.optimize = optimize,
.link_libc = true,
.sanitize_thread = tsan,
}),
});
bun_private_array_buffer_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_array_buffer_fixture = b.addRunArtifact(bun_private_array_buffer_fixture);
run_bun_private_array_buffer_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_array_buffer_test_step = b.step(
"test-bun-private-array-buffer",
"Compile, link, and run Bun's private ArrayBuffer ownership boundary",
);
bun_private_array_buffer_test_step.dependOn(&run_bun_private_array_buffer_fixture.step);
const bun_private_dom_form_data_fixture = b.addExecutable(.{
.name = "bun-private-dom-form-data",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_dom_form_data.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_dom_form_data_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_dom_form_data_fixture = b.addRunArtifact(bun_private_dom_form_data_fixture);
run_bun_private_dom_form_data_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_dom_form_data_test_step = b.step(
"test-bun-private-dom-form-data",
"Compile, link, and run Bun's private DOMFormData boundary",
);
bun_private_dom_form_data_test_step.dependOn(&run_bun_private_dom_form_data_fixture.step);
const bun_private_fetch_headers_fixture = b.addExecutable(.{
.name = "bun-private-fetch-headers",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_fetch_headers.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_fetch_headers_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_fetch_headers_fixture = b.addRunArtifact(bun_private_fetch_headers_fixture);
run_bun_private_fetch_headers_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_fetch_headers_bridge_absent_fixture = b.addExecutable(.{
.name = "bun-private-fetch-headers-bridge-absent",
.root_module = b.createModule(.{
.root_source_file = b.path("tests/abi/bun_private_fetch_headers_bridge_absent.zig"),
.target = target,
.optimize = optimize,
.sanitize_thread = tsan,
}),
});
bun_private_fetch_headers_bridge_absent_fixture.root_module.linkLibrary(bun_private_lib);
const run_bun_private_fetch_headers_bridge_absent_fixture = b.addRunArtifact(bun_private_fetch_headers_bridge_absent_fixture);
run_bun_private_fetch_headers_bridge_absent_fixture.step.dependOn(&bun_private_abi_audit_cmd.step);
const bun_private_fetch_headers_test_step = b.step(
"test-bun-private-fetch-headers",
"Compile, link, and run Bun's private FetchHeaders boundary",
);
bun_private_fetch_headers_test_step.dependOn(&run_bun_private_fetch_headers_fixture.step);
bun_private_fetch_headers_test_step.dependOn(&run_bun_private_fetch_headers_bridge_absent_fixture.step);