Skip to content

Commit 99fac50

Browse files
committed
std.Build: remove the "push installed file" mechanism
Tracked by #14943
1 parent c7ae355 commit 99fac50

File tree

3 files changed

+2
-36
lines changed

3 files changed

+2
-36
lines changed

lib/std/Build.zig

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ install_path: []const u8,
5050
sysroot: ?[]const u8 = null,
5151
search_prefixes: std.ArrayListUnmanaged([]const u8),
5252
libc_file: ?[]const u8 = null,
53-
installed_files: ArrayList(InstalledFile),
5453
/// Path to the directory containing build.zig.
5554
build_root: Cache.Directory,
5655
cache_root: Cache.Directory,
@@ -331,7 +330,6 @@ pub fn create(
331330
.exe_dir = undefined,
332331
.h_dir = undefined,
333332
.dest_dir = graph.env_map.get("DESTDIR"),
334-
.installed_files = ArrayList(InstalledFile).init(arena),
335333
.install_tls = .{
336334
.step = Step.init(.{
337335
.id = TopLevelStep.base_id,
@@ -433,7 +431,6 @@ fn createChildOnly(
433431
.sysroot = parent.sysroot,
434432
.search_prefixes = parent.search_prefixes,
435433
.libc_file = parent.libc_file,
436-
.installed_files = ArrayList(InstalledFile).init(allocator),
437434
.build_root = build_root,
438435
.cache_root = parent.cache_root,
439436
.zig_lib_dir = parent.zig_lib_dir,
@@ -1138,15 +1135,8 @@ fn makeUninstall(uninstall_step: *Step, prog_node: std.Progress.Node) anyerror!v
11381135
const uninstall_tls: *TopLevelStep = @fieldParentPtr("step", uninstall_step);
11391136
const b: *Build = @fieldParentPtr("uninstall_tls", uninstall_tls);
11401137

1141-
for (b.installed_files.items) |installed_file| {
1142-
const full_path = b.getInstallPath(installed_file.dir, installed_file.path);
1143-
if (b.verbose) {
1144-
log.info("rm {s}", .{full_path});
1145-
}
1146-
fs.cwd().deleteTree(full_path) catch {};
1147-
}
1148-
1149-
// TODO remove empty directories
1138+
_ = b;
1139+
@panic("TODO implement https://github.com/ziglang/zig/issues/14943");
11501140
}
11511141

11521142
/// Creates a configuration option to be passed to the build.zig script.
@@ -1719,15 +1709,6 @@ pub fn addCheckFile(
17191709
return Step.CheckFile.create(b, file_source, options);
17201710
}
17211711

1722-
/// deprecated: https://github.com/ziglang/zig/issues/14943
1723-
pub fn pushInstalledFile(b: *Build, dir: InstallDir, dest_rel_path: []const u8) void {
1724-
const file = InstalledFile{
1725-
.dir = dir,
1726-
.path = dest_rel_path,
1727-
};
1728-
b.installed_files.append(file.dupe(b)) catch @panic("OOM");
1729-
}
1730-
17311712
pub fn truncateFile(b: *Build, dest_path: []const u8) !void {
17321713
if (b.verbose) {
17331714
log.info("truncate {s}", .{dest_path});
@@ -2567,19 +2548,6 @@ pub const InstallDir = union(enum) {
25672548
}
25682549
};
25692550

2570-
pub const InstalledFile = struct {
2571-
dir: InstallDir,
2572-
path: []const u8,
2573-
2574-
/// Duplicates the installed file path and directory.
2575-
pub fn dupe(file: InstalledFile, builder: *Build) InstalledFile {
2576-
return .{
2577-
.dir = file.dir.dupe(builder),
2578-
.path = builder.dupe(file.path),
2579-
};
2580-
}
2581-
};
2582-
25832551
/// This function is intended to be called in the `configure` phase only.
25842552
/// It returns an absolute directory path, which is potentially going to be a
25852553
/// source of API breakage in the future, so keep that in mind when using this

lib/std/Build/Step/InstallDir.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ pub const Options = struct {
4141
};
4242

4343
pub fn create(owner: *std.Build, options: Options) *InstallDir {
44-
owner.pushInstalledFile(options.install_dir, options.install_subdir);
4544
const install_dir = owner.allocator.create(InstallDir) catch @panic("OOM");
4645
install_dir.* = .{
4746
.step = Step.init(.{

lib/std/Build/Step/InstallFile.zig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ pub fn create(
1919
dest_rel_path: []const u8,
2020
) *InstallFile {
2121
assert(dest_rel_path.len != 0);
22-
owner.pushInstalledFile(dir, dest_rel_path);
2322
const install_file = owner.allocator.create(InstallFile) catch @panic("OOM");
2423
install_file.* = .{
2524
.step = Step.init(.{

0 commit comments

Comments
 (0)