| ... | @@ -3731,24 +3731,24 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { | ... | @@ -3731,24 +3731,24 @@ fn docsCopyFallible(comp: *Compilation) anyerror!void { |
| 3731 | }; | 3731 | }; |
| 3732 | defer tar_file.close(); | 3732 | defer tar_file.close(); |
| 3733 | | 3733 | |
| 3734 | var seen_table: std.AutoArrayHashMapUnmanaged(*Package.Module, void) = .{}; | 3734 | var seen_table: std.AutoArrayHashMapUnmanaged(*Package.Module, []const u8) = .{}; |
| 3735 | defer seen_table.deinit(comp.gpa); | 3735 | defer seen_table.deinit(comp.gpa); |
| 3736 | | 3736 | |
| 3737 | try seen_table.put(comp.gpa, zcu.main_mod, {}); | 3737 | try seen_table.put(comp.gpa, zcu.main_mod, comp.root_name); |
| 3738 | try seen_table.put(comp.gpa, zcu.std_mod, {}); | 3738 | try seen_table.put(comp.gpa, zcu.std_mod, zcu.std_mod.fully_qualified_name); |
| 3739 | | 3739 | |
| 3740 | var i: usize = 0; | 3740 | var i: usize = 0; |
| 3741 | while (i < seen_table.count()) : (i += 1) { | 3741 | while (i < seen_table.count()) : (i += 1) { |
| 3742 | const mod = seen_table.keys()[i]; | 3742 | const mod = seen_table.keys()[i]; |
| 3743 | try comp.docsCopyModule(mod, tar_file); | 3743 | try comp.docsCopyModule(mod, seen_table.values()[i], tar_file); |
| 3744 | | 3744 | |
| 3745 | const deps = mod.deps.values(); | 3745 | const deps = mod.deps.values(); |
| 3746 | try seen_table.ensureUnusedCapacity(comp.gpa, deps.len); | 3746 | try seen_table.ensureUnusedCapacity(comp.gpa, deps.len); |
| 3747 | for (deps) |dep| seen_table.putAssumeCapacity(dep, {}); | 3747 | for (deps) |dep| seen_table.putAssumeCapacity(dep, dep.fully_qualified_name); |
| 3748 | } | 3748 | } |
| 3749 | } | 3749 | } |
| 3750 | | 3750 | |
| 3751 | fn docsCopyModule(comp: *Compilation, module: *Package.Module, tar_file: std.fs.File) !void { | 3751 | fn docsCopyModule(comp: *Compilation, module: *Package.Module, name: []const u8, tar_file: std.fs.File) !void { |
| 3752 | const root = module.root; | 3752 | const root = module.root; |
| 3753 | const sub_path = if (root.sub_path.len == 0) "." else root.sub_path; | 3753 | const sub_path = if (root.sub_path.len == 0) "." else root.sub_path; |
| 3754 | var mod_dir = root.root_dir.handle.openDir(sub_path, .{ .iterate = true }) catch |err| { | 3754 | var mod_dir = root.root_dir.handle.openDir(sub_path, .{ .iterate = true }) catch |err| { |
| ... | @@ -3788,7 +3788,7 @@ fn docsCopyModule(comp: *Compilation, module: *Package.Module, tar_file: std.fs. | ... | @@ -3788,7 +3788,7 @@ fn docsCopyModule(comp: *Compilation, module: *Package.Module, tar_file: std.fs. |
| 3788 | | 3788 | |
| 3789 | var file_header = std.tar.output.Header.init(); | 3789 | var file_header = std.tar.output.Header.init(); |
| 3790 | file_header.typeflag = .regular; | 3790 | file_header.typeflag = .regular; |
| 3791 | try file_header.setPath(module.fully_qualified_name, entry.path); | 3791 | try file_header.setPath(name, entry.path); |
| 3792 | try file_header.setSize(stat.size); | 3792 | try file_header.setSize(stat.size); |
| 3793 | try file_header.updateChecksum(); | 3793 | try file_header.updateChecksum(); |
| 3794 | | 3794 | |