authorgravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2025-06-02 13:02:44+02:00
committergravatar for kappaloris@gmail.comLoris Cro <kappaloris@gmail.com> 2025-06-02 13:13:56+02:00
log1116d881965ed8c0009f2d5bb4f97eed605c4ec0
treee99f9997eb178f71b76a0030cb95430e31161153
parent8709326088b71246bb4825c5a883bccef552f3a8

zig init: add new --strip flag and improve template files

This commit introduces a new flag to generate a new Zig project using `zig init` without comments for users who are already familiar with the Zig build system. Additionally, the generated files are now different. Previously we would generate a set of files that defined a static library and an executable, which real-life experience has shown to cause confusion to newcomers. The new template generates one Zig module and one executable both in order to accommodate the two most common use cases, but also to suggest that a library could use a CLI tool (e.g. a parser library could use a CLI tool that provides syntax checking) and vice-versa a CLI tool might want to expose its core functionality as a Zig module. All references to C interoperability are removed from the template under the assumption that if you're tall enough to do C interop, you're also tall enough to find your way around the build system. Experienced users will still be able to use the current template and adapt it with minimal changes in order to perform more advanced operations. As an example, one only needs to change `b.addExecutable` to `b.addLibrary` to switch from generating an executable to a dynamic (or static) library.

5 files changed, 160 insertions(+), 115 deletions(-)

lib/init/build.zig+116-75
...@@ -1,84 +1,113 @@...@@ -1,84 +1,113 @@
1//! Use `zig init --strip` next time to generate a project without comments.
1const std = @import("std");2const std = @import("std");
23
3// Although this function looks imperative, note that its job is to4// Although this function looks imperative, it does not perform the build
4// declaratively construct a build graph that will be executed by an external5// directly and instead it mutates the build graph (`b`) that will be then
5// runner.6// executed by an external runner. The functions in `std.Build` implement a DSL
7// for defining build steps and express dependencies between them, allowing the
8// build runner to parallelize the build automatically (and the cache system to
9// know when a step doesn't need to be re-run).
6pub fn build(b: *std.Build) void {10pub fn build(b: *std.Build) void {
7 // Standard target options allows the person running `zig build` to choose11 // Standard target options allow the person running `zig build` to choose
8 // what target to build for. Here we do not override the defaults, which12 // what target to build for. Here we do not override the defaults, which
9 // means any target is allowed, and the default is native. Other options13 // means any target is allowed, and the default is native. Other options
10 // for restricting supported target set are available.14 // for restricting supported target set are available.
11 const target = b.standardTargetOptions(.{});15 const target = b.standardTargetOptions(.{});
12
13 // Standard optimization options allow the person running `zig build` to select16 // Standard optimization options allow the person running `zig build` to select
14 // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not17 // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall. Here we do not
15 // set a preferred release mode, allowing the user to decide how to optimize.18 // set a preferred release mode, allowing the user to decide how to optimize.
16 const optimize = b.standardOptimizeOption(.{});19 const optimize = b.standardOptimizeOption(.{});
20 // It's also possible to define more custom flags to toggle optional features
21 // of this build script using `b.option()`. All defined flags (including
22 // target and optimize options) will be listed when running `zig build --help`
23 // in this directory.
1724
18 // This creates a "module", which represents a collection of source files alongside25 // This creates a module, which represents a collection of source files alongside
19 // some compilation options, such as optimization mode and linked system libraries.26 // some compilation options, such as optimization mode and linked system libraries.
20 // Every executable or library we compile will be based on one or more modules.27 // Zig modules are the preferred way of making Zig code available to consumers.
21 const lib_mod = b.createModule(.{28 // addModule defines a module that we intend to make available for importing
22 // `root_source_file` is the Zig "entry point" of the module. If a module29 // to our consumers. We must give it a name because a Zig package can expose
23 // only contains e.g. external object files, you can make this `null`.30 // multiple modules and consumers will need to be able to specify which
24 // In this case the main source file is merely a path, however, in more31 // module they want to access.
25 // complicated build scripts, this could be a generated file.32 const mod = b.addModule(".NAME", .{
33 // The root source file is the "entry point" of this module. Users of
34 // this module will only be able to access public declarations contained
35 // in this file, which means that if you have declarations that you
36 // intend to expose to consumers that were defined in other files part
37 // of this module, you will have to make sure to re-export them from
38 // the root file.
26 .root_source_file = b.path("src/root.zig"),39 .root_source_file = b.path("src/root.zig"),
40 // Later on we'll use this module as the root module of a test executable
41 // which requires us to specify a target.
27 .target = target,42 .target = target,
28 .optimize = optimize,
29 });
30
31 // We will also create a module for our other entry point, 'main.zig'.
32 const exe_mod = b.createModule(.{
33 // `root_source_file` is the Zig "entry point" of the module. If a module
34 // only contains e.g. external object files, you can make this `null`.
35 // In this case the main source file is merely a path, however, in more
36 // complicated build scripts, this could be a generated file.
37 .root_source_file = b.path("src/main.zig"),
38 .target = target,
39 .optimize = optimize,
40 });
41
42 // Modules can depend on one another using the `std.Build.Module.addImport` function.
43 // This is what allows Zig source code to use `@import("foo")` where 'foo' is not a
44 // file path. In this case, we set up `exe_mod` to import `lib_mod`.
45 exe_mod.addImport(".NAME_lib", lib_mod);
46
47 // Now, we will create a static library based on the module we created above.
48 // This creates a `std.Build.Step.Compile`, which is the build step responsible
49 // for actually invoking the compiler.
50 const lib = b.addLibrary(.{
51 .linkage = .static,
52 .name = ".NAME",
53 .root_module = lib_mod,
54 });43 });
5544
56 // This declares intent for the library to be installed into the standard45 // Here we define an executable. An executable needs to have a root module
57 // location when the user invokes the "install" step (the default step when46 // which needs to expose a `main` function. While we could add a main function
58 // running `zig build`).47 // to the module defined above, it's sometimes preferable to split business
59 b.installArtifact(lib);48 // business logic and the CLI into two separate modules.
6049 //
61 // This creates another `std.Build.Step.Compile`, but this one builds an executable50 // If your goal is to create a Zig library for others to use, consider if
62 // rather than a static library.51 // it might benefit from also exposing a CLI tool. A parser library for a
52 // data serialization format could also bundle a CLI syntax checker, for example.
53 //
54 // If instead your goal is to create an executable, consider if users might
55 // be interested in also being able to embed the core functionality of your
56 // program in their own executable in order to avoid the overhead involved in
57 // subprocessing your CLI tool.
58 //
59 // If neither case applies to you, feel free to delete the declaration you
60 // don't need and to put everything under a single module.
63 const exe = b.addExecutable(.{61 const exe = b.addExecutable(.{
64 .name = ".NAME",62 .name = ".NAME",
65 .root_module = exe_mod,63 .root_module = b.createModule(.{
64 // b.createModule defines a new module just like b.addModule but,
65 // unlike b.addModule, it does not expose the module to consumers of
66 // this package, which is why in this case we don't have to give it a name.
67 .root_source_file = b.path("src/main.zig"),
68 // Target and optimization levels must be explicitly wired in when
69 // defining an executable or library (in the root module), and you
70 // can also hardcode a specific target for an executable or library
71 // definition if desireable (e.g. firmware for embedded devices).
72 .target = target,
73 .optimize = optimize,
74 // List of modules available for import in source files part of the
75 // root module.
76 .imports = &.{
77 // Here ".NAME" is the name you will use in your source code to
78 // import this module (e.g. `@import(".NAME")`). The name is
79 // repeated because you are allowed to rename your imports, which
80 // can be extremely useful in case of collisions (which can happen
81 // importing modules from different packages).
82 .{ .name = ".NAME", .module = mod },
83 },
84 }),
66 });85 });
6786
68 // This declares intent for the executable to be installed into the87 // This declares intent for the executable to be installed into the
69 // standard location when the user invokes the "install" step (the default88 // install prefix when running `zig build` (i.e. when executing the default
70 // step when running `zig build`).89 // step). By default the install prefix is `zig-out/` but can be overridden
90 // by passing `--prefix` or `-p`.
71 b.installArtifact(exe);91 b.installArtifact(exe);
7292
73 // This *creates* a Run step in the build graph, to be executed when another93 // This creates a top level step. Top level steps have a name and can be
74 // step is evaluated that depends on it. The next line below will establish94 // invoked by name when running `zig build` (e.g. `zig build run`).
75 // such a dependency.95 // This will evaluate the `run` step rather than the default step.
96 // For a top level step to actually do something, it must depend on other
97 // steps (e.g. a Run step, as we will see in a moment).
98 const run_step = b.step("run", "Run the app");
99
100 // This creates a RunArtifact step in the build graph. A RunArtifact step
101 // invokes an executable compiled by Zig. Steps will only be executed by the
102 // runner if invoked directly by the user (in the case of top level steps)
103 // or if another step depends on it, so it's up to you to define when and
104 // how this Run step will be executed. In our case we want to run it when
105 // the user runs `zig build run`, so we create a dependency link.
76 const run_cmd = b.addRunArtifact(exe);106 const run_cmd = b.addRunArtifact(exe);
107 run_step.dependOn(&run_cmd.step);
77108
78 // By making the run step depend on the install step, it will be run from the109 // By making the run step depend on the default step, it will be run from the
79 // installation directory rather than directly from within the cache directory.110 // installation directory rather than directly from within the cache directory.
80 // This is not necessary, however, if the application depends on other installed
81 // files, this ensures they will be present and in the expected location.
82 run_cmd.step.dependOn(b.getInstallStep());111 run_cmd.step.dependOn(b.getInstallStep());
83112
84 // This allows the user to pass arguments to the application in the build113 // This allows the user to pass arguments to the application in the build
...@@ -87,30 +116,42 @@ pub fn build(b: *std.Build) void {...@@ -87,30 +116,42 @@ pub fn build(b: *std.Build) void {
87 run_cmd.addArgs(args);116 run_cmd.addArgs(args);
88 }117 }
89118
90 // This creates a build step. It will be visible in the `zig build --help` menu,119 // Creates an executable that will run `test` blocks from the provided module.
91 // and can be selected like this: `zig build run`120 // Here `mod` needs to define a target, which is why earlier we made sure to
92 // This will evaluate the `run` step rather than the default, which is "install".121 // set the releative field.
93 const run_step = b.step("run", "Run the app");122 const mod_tests = b.addTest(.{
94 run_step.dependOn(&run_cmd.step);123 .root_module = mod,
95
96 // Creates a step for unit testing. This only builds the test executable
97 // but does not run it.
98 const lib_unit_tests = b.addTest(.{
99 .root_module = lib_mod,
100 });124 });
101125
102 const run_lib_unit_tests = b.addRunArtifact(lib_unit_tests);126 // A run step that will run the test executable.
127 const run_mod_tests = b.addRunArtifact(mod_tests);
103128
104 const exe_unit_tests = b.addTest(.{129 // Creates an executable that will run `test` blocks from the executable's
105 .root_module = exe_mod,130 // root module. Note that test executables only test one module at a time,
131 // hence why we have to create two separate ones.
132 const exe_tests = b.addTest(.{
133 .root_module = exe.root_module,
106 });134 });
107135
108 const run_exe_unit_tests = b.addRunArtifact(exe_unit_tests);136 // A run step that will run the second test executable.
109137 const run_exe_tests = b.addRunArtifact(exe_tests);
110 // Similar to creating the run step earlier, this exposes a `test` step to138
111 // the `zig build --help` menu, providing a way for the user to request139 // A top level step for running all tests. dependOn can be called multiple
112 // running the unit tests.140 // times and since the two run steps do not depend on one another, this will
113 const test_step = b.step("test", "Run unit tests");141 // make the two of them run in parallel.
114 test_step.dependOn(&run_lib_unit_tests.step);142 const test_step = b.step("test", "Run tests");
115 test_step.dependOn(&run_exe_unit_tests.step);143 test_step.dependOn(&run_mod_tests.step);
144 test_step.dependOn(&run_exe_tests.step);
145
146 // Just like flags, top level steps are also listed in the `--help` menu.
147 //
148 // The Zig build system is entirely implemented in userland, which means
149 // that it cannot hook into private compiler APIs. All compilation work
150 // orchestrated by the build system will result in other Zig compiler
151 // subcommands being invoked with the right flags defined. You can observe
152 // these invocations when one fails (or you pass a flag to increase
153 // verbosity) to validate assumptions and diagnose problems.
154 //
155 // Lastly, the Zig build system is relatively simple and self-contained,
156 // and reading its source code will allow you to master it.
116}157}
lib/init/build.zig.zon-5
...@@ -7,11 +7,9 @@...@@ -7,11 +7,9 @@
7 // It is redundant to include "zig" in this name because it is already7 // It is redundant to include "zig" in this name because it is already
8 // within the Zig package namespace.8 // within the Zig package namespace.
9 .name = .LITNAME,9 .name = .LITNAME,
10
11 // This is a [Semantic Version](https://semver.org/).10 // This is a [Semantic Version](https://semver.org/).
12 // In a future version of Zig it will be used for package deduplication.11 // In a future version of Zig it will be used for package deduplication.
13 .version = "0.0.0",12 .version = "0.0.0",
14
15 // Together with name, this represents a globally unique package13 // Together with name, this represents a globally unique package
16 // identifier. This field is generated by the Zig toolchain when the14 // identifier. This field is generated by the Zig toolchain when the
17 // package is first created, and then *never changes*. This allows15 // package is first created, and then *never changes*. This allows
...@@ -25,11 +23,9 @@...@@ -25,11 +23,9 @@
25 // on the following line intact, so that it shows up in code reviews that23 // on the following line intact, so that it shows up in code reviews that
26 // modify the field.24 // modify the field.
27 .fingerprint = .FINGERPRINT, // Changing this has security and trust implications.25 .fingerprint = .FINGERPRINT, // Changing this has security and trust implications.
28
29 // Tracks the earliest Zig version that the package considers to be a26 // Tracks the earliest Zig version that the package considers to be a
30 // supported use case.27 // supported use case.
31 .minimum_zig_version = ".ZIGVER",28 .minimum_zig_version = ".ZIGVER",
32
33 // This field is optional.29 // This field is optional.
34 // Each dependency must either provide a `url` and `hash`, or a `path`.30 // Each dependency must either provide a `url` and `hash`, or a `path`.
35 // `zig build --fetch` can be used to fetch all dependencies of a package, recursively.31 // `zig build --fetch` can be used to fetch all dependencies of a package, recursively.
...@@ -66,7 +62,6 @@...@@ -66,7 +62,6 @@
66 // .lazy = false,62 // .lazy = false,
67 //},63 //},
68 },64 },
69
70 // Specifies the set of files and directories that are included in this package.65 // Specifies the set of files and directories that are included in this package.
71 // Only files and directories listed here are included in the `hash` that66 // Only files and directories listed here are included in the `hash` that
72 // is computed for this package. Only files listed here will remain on disk67 // is computed for this package. Only files listed here will remain on disk
lib/init/src/main.zig+4-24
...@@ -1,21 +1,10 @@...@@ -1,21 +1,10 @@
1//! By convention, main.zig is where your main function lives in the case that1const std = @import("std");
2//! you are building an executable. If you are making a library, the convention2const .NAME = @import(".NAME");
3//! is to delete this file and start with root.zig instead.
43
5pub fn main() !void {4pub fn main() !void {
6 // Prints to stderr (it's a shortcut based on `std.io.getStdErr()`)5 // Prints to stderr, ignoring potential errors.
7 std.debug.print("All your {s} are belong to us.\n", .{"codebase"});6 std.debug.print("All your {s} are belong to us.\n", .{"codebase"});
87 try .NAME.advancedPrint();
9 // stdout is for the actual output of your application, for example if you
10 // are implementing gzip, then only the compressed bytes should be sent to
11 // stdout, not any debugging messages.
12 const stdout_file = std.io.getStdOut().writer();
13 var bw = std.io.bufferedWriter(stdout_file);
14 const stdout = bw.writer();
15
16 try stdout.print("Run `zig build test` to run the tests.\n", .{});
17
18 try bw.flush(); // Don't forget to flush!
19}8}
209
21test "simple test" {10test "simple test" {
...@@ -25,10 +14,6 @@ test "simple test" {...@@ -25,10 +14,6 @@ test "simple test" {
25 try std.testing.expectEqual(@as(i32, 42), list.pop());14 try std.testing.expectEqual(@as(i32, 42), list.pop());
26}15}
2716
28test "use other module" {
29 try std.testing.expectEqual(@as(i32, 150), lib.add(100, 50));
30}
31
32test "fuzz example" {17test "fuzz example" {
33 const Context = struct {18 const Context = struct {
34 fn testOne(context: @This(), input: []const u8) anyerror!void {19 fn testOne(context: @This(), input: []const u8) anyerror!void {
...@@ -39,8 +24,3 @@ test "fuzz example" {...@@ -39,8 +24,3 @@ test "fuzz example" {
39 };24 };
40 try std.testing.fuzz(Context{}, Context.testOne, .{});25 try std.testing.fuzz(Context{}, Context.testOne, .{});
41}26}
42
43const std = @import("std");
44
45/// This imports the separate module containing `root.zig`. Take a look in `build.zig` for details.
46const lib = @import(".NAME_lib");
lib/init/src/root.zig+16-6
...@@ -1,13 +1,23 @@...@@ -1,13 +1,23 @@
1//! By convention, root.zig is the root source file when making a library. If1//! By convention, root.zig is the root source file when making a library.
2//! you are making an executable, the convention is to delete this file and
3//! start with main.zig instead.
4const std = @import("std");2const std = @import("std");
5const testing = std.testing;
63
7pub export fn add(a: i32, b: i32) i32 {4pub fn advancedPrint() !void {
5 // Stdout is for the actual output of your application, for example if you
6 // are implementing gzip, then only the compressed bytes should be sent to
7 // stdout, not any debugging messages.
8 const stdout_file = std.io.getStdOut().writer();
9 var bw = std.io.bufferedWriter(stdout_file);
10 const stdout = bw.writer();
11
12 try stdout.print("Run `zig build test` to run the tests.\n", .{});
13
14 try bw.flush(); // Don't forget to flush!
15}
16
17pub fn add(a: i32, b: i32) i32 {
8 return a + b;18 return a + b;
9}19}
1020
11test "basic add functionality" {21test "basic add functionality" {
12 try testing.expect(add(3, 7) == 10);22 try std.testing.expect(add(3, 7) == 10);
13}23}
src/main.zig+24-5
...@@ -4749,6 +4749,7 @@ const usage_init =...@@ -4749,6 +4749,7 @@ const usage_init =
4749 \\ directory.4749 \\ directory.
4750 \\4750 \\
4751 \\Options:4751 \\Options:
4752 \\ -s, --strip Generate files without comments
4752 \\ -h, --help Print this help and exit4753 \\ -h, --help Print this help and exit
4753 \\4754 \\
4754 \\4755 \\
...@@ -4757,12 +4758,15 @@ const usage_init =...@@ -4757,12 +4758,15 @@ const usage_init =
4757fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {4758fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
4758 dev.check(.init_command);4759 dev.check(.init_command);
47594760
4761 var strip = false;
4760 {4762 {
4761 var i: usize = 0;4763 var i: usize = 0;
4762 while (i < args.len) : (i += 1) {4764 while (i < args.len) : (i += 1) {
4763 const arg = args[i];4765 const arg = args[i];
4764 if (mem.startsWith(u8, arg, "-")) {4766 if (mem.startsWith(u8, arg, "-")) {
4765 if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) {4767 if (mem.eql(u8, arg, "-s") or mem.eql(u8, arg, "--strip")) {
4768 strip = true;
4769 } else if (mem.eql(u8, arg, "-h") or mem.eql(u8, arg, "--help")) {
4766 try io.getStdOut().writeAll(usage_init);4770 try io.getStdOut().writeAll(usage_init);
4767 return cleanExit();4771 return cleanExit();
4768 } else {4772 } else {
...@@ -4774,7 +4778,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {...@@ -4774,7 +4778,7 @@ fn cmdInit(gpa: Allocator, arena: Allocator, args: []const []const u8) !void {
4774 }4778 }
4775 }4779 }
47764780
4777 var templates = findTemplates(gpa, arena);4781 var templates = findTemplates(gpa, arena, strip);
4778 defer templates.deinit();4782 defer templates.deinit();
47794783
4780 const cwd_path = try introspect.getResolvedCwd(arena);4784 const cwd_path = try introspect.getResolvedCwd(arena);
...@@ -7332,7 +7336,7 @@ fn loadManifest(...@@ -7332,7 +7336,7 @@ fn loadManifest(
7332 ) catch |err| switch (err) {7336 ) catch |err| switch (err) {
7333 error.FileNotFound => {7337 error.FileNotFound => {
7334 const fingerprint: Package.Fingerprint = .generate(options.root_name);7338 const fingerprint: Package.Fingerprint = .generate(options.root_name);
7335 var templates = findTemplates(gpa, arena);7339 var templates = findTemplates(gpa, arena, true);
7336 defer templates.deinit();7340 defer templates.deinit();
7337 templates.write(arena, options.dir, options.root_name, Package.Manifest.basename, fingerprint) catch |e| {7341 templates.write(arena, options.dir, options.root_name, Package.Manifest.basename, fingerprint) catch |e| {
7338 fatal("unable to write {s}: {s}", .{7342 fatal("unable to write {s}: {s}", .{
...@@ -7378,6 +7382,7 @@ const Templates = struct {...@@ -7378,6 +7382,7 @@ const Templates = struct {
7378 zig_lib_directory: Cache.Directory,7382 zig_lib_directory: Cache.Directory,
7379 dir: fs.Dir,7383 dir: fs.Dir,
7380 buffer: std.ArrayList(u8),7384 buffer: std.ArrayList(u8),
7385 strip: bool,
73817386
7382 fn deinit(templates: *Templates) void {7387 fn deinit(templates: *Templates) void {
7383 templates.zig_lib_directory.handle.close();7388 templates.zig_lib_directory.handle.close();
...@@ -7406,9 +7411,22 @@ const Templates = struct {...@@ -7406,9 +7411,22 @@ const Templates = struct {
7406 };7411 };
7407 templates.buffer.clearRetainingCapacity();7412 templates.buffer.clearRetainingCapacity();
7408 try templates.buffer.ensureUnusedCapacity(contents.len);7413 try templates.buffer.ensureUnusedCapacity(contents.len);
7414 var new_line = templates.strip;
7409 var i: usize = 0;7415 var i: usize = 0;
7410 while (i < contents.len) {7416 while (i < contents.len) {
7411 if (contents[i] == '.') {7417 if (new_line) {
7418 const trimmed = std.mem.trimLeft(u8, contents[i..], " ");
7419 if (std.mem.startsWith(u8, trimmed, "//")) {
7420 i += std.mem.indexOfScalar(u8, contents[i..], '\n') orelse break;
7421 i += 1;
7422 continue;
7423 } else {
7424 new_line = false;
7425 }
7426 }
7427 if (templates.strip and contents[i] == '\n') {
7428 new_line = true;
7429 } else if (contents[i] == '.') {
7412 if (std.mem.startsWith(u8, contents[i..], ".LITNAME")) {7430 if (std.mem.startsWith(u8, contents[i..], ".LITNAME")) {
7413 try templates.buffer.append('.');7431 try templates.buffer.append('.');
7414 try templates.buffer.appendSlice(root_name);7432 try templates.buffer.appendSlice(root_name);
...@@ -7440,7 +7458,7 @@ const Templates = struct {...@@ -7440,7 +7458,7 @@ const Templates = struct {
7440 }7458 }
7441};7459};
74427460
7443fn findTemplates(gpa: Allocator, arena: Allocator) Templates {7461fn findTemplates(gpa: Allocator, arena: Allocator, strip: bool) Templates {
7444 const cwd_path = introspect.getResolvedCwd(arena) catch |err| {7462 const cwd_path = introspect.getResolvedCwd(arena) catch |err| {
7445 fatal("unable to get cwd: {s}", .{@errorName(err)});7463 fatal("unable to get cwd: {s}", .{@errorName(err)});
7446 };7464 };
...@@ -7464,6 +7482,7 @@ fn findTemplates(gpa: Allocator, arena: Allocator) Templates {...@@ -7464,6 +7482,7 @@ fn findTemplates(gpa: Allocator, arena: Allocator) Templates {
7464 .zig_lib_directory = zig_lib_directory,7482 .zig_lib_directory = zig_lib_directory,
7465 .dir = template_dir,7483 .dir = template_dir,
7466 .buffer = std.ArrayList(u8).init(gpa),7484 .buffer = std.ArrayList(u8).init(gpa),
7485 .strip = strip,
7467 };7486 };
7468}7487}
74697488