╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ Builtin.zig ──────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭ find file ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ ╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╮ │ │ │http│ ssh │ │ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ╯
348 349 // `make_path` matters because the dir hasn't actually been created yet. 350 var af = try root_dir.createFileAtomic(io, sub_path, .{ .make_path = true, .replace = true }); 351 defer af.deinit(io); 352 try af.file.writeStreamingAll(io, file.source.?); 353 af.replace(io) catch |err| switch (err) { 354 error.AccessDenied => switch (builtin.os.tag) { 355 .windows => { 356 // Very likely happened due to another process or thread 357 // simultaneously creating the same, correct builtin.zig file. 358 // This is not a problem; ignore it. 359 }, 360 else => return err, 361 }, 362 else => return err, 363 }; 364 365 file.stat = .{ 366 .size = file.source.?.len, 367 .inode = 0, // dummy value 368 .mtime = .zero, // dummy value 369 }; 370 } 371 372 const builtin = @import("builtin"); 373 const std = @import("std"); 374 const Allocator = std.mem.Allocator; 375 const Cache = std.Build.Cache; 376 const build_options = @import("build_options"); 377 const Module = @import("Module.zig"); 378 const assert = std.debug.assert; 379 const AstGen = std.zig.AstGen; 380 const File = @import("Zcu.zig").File; 381 const Compilation = @import("Compilation.zig"); 382 const log = std.log.scoped(.builtin); 383