Commit beed47e8c3

Andrew Kelley <andrew@ziglang.org>
2023-12-27 02:25:53
std.Build: add error_tracing field to addExecutable and friends
To support easily overriding error return tracing for the main module.
1 parent 190f603
Changed files (1)
lib
lib/std/Build.zig
@@ -607,6 +607,7 @@ pub const ExecutableOptions = struct {
     unwind_tables: ?bool = null,
     omit_frame_pointer: ?bool = null,
     sanitize_thread: ?bool = null,
+    error_tracing: ?bool = null,
     use_llvm: ?bool = null,
     use_lld: ?bool = null,
     zig_lib_dir: ?LazyPath = null,
@@ -632,6 +633,7 @@ pub fn addExecutable(b: *Build, options: ExecutableOptions) *Step.Compile {
             .unwind_tables = options.unwind_tables,
             .omit_frame_pointer = options.omit_frame_pointer,
             .sanitize_thread = options.sanitize_thread,
+            .error_tracing = options.error_tracing,
         },
         .version = options.version,
         .kind = .exe,
@@ -659,6 +661,7 @@ pub const ObjectOptions = struct {
     unwind_tables: ?bool = null,
     omit_frame_pointer: ?bool = null,
     sanitize_thread: ?bool = null,
+    error_tracing: ?bool = null,
     use_llvm: ?bool = null,
     use_lld: ?bool = null,
     zig_lib_dir: ?LazyPath = null,
@@ -678,6 +681,7 @@ pub fn addObject(b: *Build, options: ObjectOptions) *Step.Compile {
             .unwind_tables = options.unwind_tables,
             .omit_frame_pointer = options.omit_frame_pointer,
             .sanitize_thread = options.sanitize_thread,
+            .error_tracing = options.error_tracing,
         },
         .kind = .obj,
         .max_rss = options.max_rss,
@@ -703,6 +707,7 @@ pub const SharedLibraryOptions = struct {
     unwind_tables: ?bool = null,
     omit_frame_pointer: ?bool = null,
     sanitize_thread: ?bool = null,
+    error_tracing: ?bool = null,
     use_llvm: ?bool = null,
     use_lld: ?bool = null,
     zig_lib_dir: ?LazyPath = null,
@@ -728,6 +733,7 @@ pub fn addSharedLibrary(b: *Build, options: SharedLibraryOptions) *Step.Compile
             .unwind_tables = options.unwind_tables,
             .omit_frame_pointer = options.omit_frame_pointer,
             .sanitize_thread = options.sanitize_thread,
+            .error_tracing = options.error_tracing,
         },
         .kind = .lib,
         .linkage = .dynamic,
@@ -756,6 +762,7 @@ pub const StaticLibraryOptions = struct {
     unwind_tables: ?bool = null,
     omit_frame_pointer: ?bool = null,
     sanitize_thread: ?bool = null,
+    error_tracing: ?bool = null,
     use_llvm: ?bool = null,
     use_lld: ?bool = null,
     zig_lib_dir: ?LazyPath = null,
@@ -775,6 +782,7 @@ pub fn addStaticLibrary(b: *Build, options: StaticLibraryOptions) *Step.Compile
             .unwind_tables = options.unwind_tables,
             .omit_frame_pointer = options.omit_frame_pointer,
             .sanitize_thread = options.sanitize_thread,
+            .error_tracing = options.error_tracing,
         },
         .kind = .lib,
         .linkage = .static,
@@ -802,6 +810,7 @@ pub const TestOptions = struct {
     unwind_tables: ?bool = null,
     omit_frame_pointer: ?bool = null,
     sanitize_thread: ?bool = null,
+    error_tracing: ?bool = null,
     use_llvm: ?bool = null,
     use_lld: ?bool = null,
     zig_lib_dir: ?LazyPath = null,
@@ -822,6 +831,7 @@ pub fn addTest(b: *Build, options: TestOptions) *Step.Compile {
             .unwind_tables = options.unwind_tables,
             .omit_frame_pointer = options.omit_frame_pointer,
             .sanitize_thread = options.sanitize_thread,
+            .error_tracing = options.error_tracing,
         },
         .max_rss = options.max_rss,
         .filter = options.filter,