aboutsummaryrefslogtreecommitdiff
path: root/lib/compiler/std-docs.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2024-03-28 02:17:50 -0700
committerGitHub <noreply@github.com>2024-03-28 02:17:50 -0700
commit17053887d080bd125d2f5ccbb39238f23c706328 (patch)
tree97ed7faba6053f50b668cd76bbfc5bbe5ebbbc89 /lib/compiler/std-docs.zig
parent9dac8db2df2332d6dd4aa52a0b524e5c88a9349b (diff)
parent3fb6bb144998de72d03b58e7c1daf134e2438373 (diff)
downloadzig-17053887d080bd125d2f5ccbb39238f23c706328.tar.gz
zig-17053887d080bd125d2f5ccbb39238f23c706328.zip
Merge pull request #19458 from ianprime0509/all-module-docs
Autodoc: include all modules in output
Diffstat (limited to 'lib/compiler/std-docs.zig')
-rw-r--r--lib/compiler/std-docs.zig20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/compiler/std-docs.zig b/lib/compiler/std-docs.zig
index 93a04a28e5..d86be67702 100644
--- a/lib/compiler/std-docs.zig
+++ b/lib/compiler/std-docs.zig
@@ -177,6 +177,26 @@ fn serveSourcesTar(request: *std.http.Server.Request, context: *Context) !void {
try w.writeFile(file);
try w.writeByteNTimes(0, padding);
}
+
+ {
+ // Since this command is JIT compiled, the builtin module available in
+ // this source file corresponds to the user's host system.
+ const builtin_zig = @embedFile("builtin");
+
+ var file_header = std.tar.output.Header.init();
+ file_header.typeflag = .regular;
+ try file_header.setPath("builtin", "builtin.zig");
+ try file_header.setSize(builtin_zig.len);
+ try file_header.updateChecksum();
+ try w.writeAll(std.mem.asBytes(&file_header));
+ try w.writeAll(builtin_zig);
+ const padding = p: {
+ const remainder = builtin_zig.len % 512;
+ break :p if (remainder > 0) 512 - remainder else 0;
+ };
+ try w.writeByteNTimes(0, padding);
+ }
+
// intentionally omitting the pointless trailer
//try w.writeByteNTimes(0, 512 * 2);
try response.end();