| ... | ... | @@ -34,7 +34,6 @@ available_options_map: std.array_hash_map.String(AvailableOption) = .empty, |
| 34 | 34 | invalid_user_input: bool, |
| 35 | 35 | default_step: *Step, |
| 36 | 36 | top_level_steps: std.StringArrayHashMapUnmanaged(*Step.TopLevel), |
| 37 | | install_prefix: []const u8, |
| 38 | 37 | debug_log_scopes: []const []const u8 = &.{}, |
| 39 | 38 | /// Number of stack frames captured when a `StackTrace` is recorded for debug purposes, |
| 40 | 39 | /// in particular at `Step` creation. |
| ... | ... | @@ -217,7 +216,6 @@ pub fn create( |
| 217 | 216 | .user_input_options = UserInputOptionsMap.init(arena), |
| 218 | 217 | .top_level_steps = .{}, |
| 219 | 218 | .default_step = undefined, |
| 220 | | .install_prefix = undefined, |
| 221 | 219 | .install_tls = .{ |
| 222 | 220 | .step = .init(.{ |
| 223 | 221 | .tag = .top_level, |
| ... | ... | @@ -506,7 +504,7 @@ const OrderedUserValue = union(enum) { |
| 506 | 504 | hasher.update(sp.sub_path); |
| 507 | 505 | }, |
| 508 | 506 | .generated => |gen| { |
| 509 | | hasher.update(gen.file.step.owner.pkg_hash); |
| 507 | hasher.update(std.mem.asBytes(&gen.index)); |
| 510 | 508 | hasher.update(std.mem.asBytes(&gen.up)); |
| 511 | 509 | hasher.update(gen.sub_path); |
| 512 | 510 | }, |
| ... | ... | @@ -1728,9 +1726,9 @@ fn findPkgHashOrFatal(b: *Build, name: []const u8) []const u8 { |
| 1728 | 1726 | for (b.available_deps) |dep| { |
| 1729 | 1727 | if (mem.eql(u8, dep[0], name)) return dep[1]; |
| 1730 | 1728 | } |
| 1731 | | |
| 1732 | | const full_path = b.pathFromRoot("build.zig.zon"); |
| 1733 | | std.debug.panic("no dependency named '{s}' in '{s}'. All packages used in build.zig must be declared in this file", .{ name, full_path }); |
| 1729 | std.log.info("all dependencies used by build.zig must be declared in corresponding build.zig.zon", .{}); |
| 1730 | if (b.pkg_hash.len == 0) std.debug.panic("no dependency named {s}", .{name}); |
| 1731 | std.debug.panic("no dependency named {s} in {s} ({s})", .{ name, b.dep_prefix, b.pkg_hash }); |
| 1734 | 1732 | } |
| 1735 | 1733 | |
| 1736 | 1734 | inline fn findImportPkgHashOrFatal(b: *Build, comptime asking_build_zig: type, comptime dep_name: []const u8) []const u8 { |
| ... | ... | @@ -1931,10 +1929,10 @@ fn userLazyPathsAreTheSame(lhs_lp: LazyPath, rhs_lp: LazyPath) bool { |
| 1931 | 1929 | if (lhs_sp.owner != rhs_sp.owner) return false; |
| 1932 | 1930 | if (std.mem.eql(u8, lhs_sp.sub_path, rhs_sp.sub_path)) return false; |
| 1933 | 1931 | }, |
| 1934 | | .generated => |lhs_gen| { |
| 1935 | | const rhs_gen = rhs_lp.generated; |
| 1932 | .generated => |*lhs_gen| { |
| 1933 | const rhs_gen = &rhs_lp.generated; |
| 1936 | 1934 | |
| 1937 | | if (lhs_gen.file != rhs_gen.file) return false; |
| 1935 | if (lhs_gen.index != rhs_gen.index) return false; |
| 1938 | 1936 | if (lhs_gen.up != rhs_gen.up) return false; |
| 1939 | 1937 | if (std.mem.eql(u8, lhs_gen.sub_path, rhs_gen.sub_path)) return false; |
| 1940 | 1938 | }, |
| ... | ... | @@ -1962,7 +1960,6 @@ fn dependencyInner( |
| 1962 | 1960 | pkg_deps: AvailableDeps, |
| 1963 | 1961 | args: anytype, |
| 1964 | 1962 | ) *Dependency { |
| 1965 | | const io = b.graph.io; |
| 1966 | 1963 | const user_input_options = userInputOptionsFromArgs(b.allocator, args); |
| 1967 | 1964 | if (b.graph.dependency_cache.getContext(.{ |
| 1968 | 1965 | .build_root_string = build_root_string, |
| ... | ... | @@ -1970,13 +1967,7 @@ fn dependencyInner( |
| 1970 | 1967 | }, .{ .allocator = b.graph.arena })) |dep| |
| 1971 | 1968 | return dep; |
| 1972 | 1969 | |
| 1973 | | const build_root: std.Build.Cache.Directory = .{ |
| 1974 | | .path = build_root_string, |
| 1975 | | .handle = Io.Dir.cwd().openDir(io, build_root_string, .{}) catch |err| |
| 1976 | | process.fatal("unable to open {s}: {t}", .{ build_root_string, err }), |
| 1977 | | }; |
| 1978 | | |
| 1979 | | const sub_builder = b.createChild(name, build_root, pkg_hash, pkg_deps, user_input_options) catch |
| 1970 | const sub_builder = b.createChild(name, pkg_hash, pkg_deps, user_input_options) catch |
| 1980 | 1971 | @panic("unhandled error"); |
| 1981 | 1972 | if (build_zig) |bz| { |
| 1982 | 1973 | sub_builder.runBuild(bz) catch @panic("unhandled error"); |
| ... | ... | @@ -2142,7 +2133,7 @@ pub const LazyPath = union(enum) { |
| 2142 | 2133 | .sub_path = try fs.path.resolve(arena, &.{ src.sub_path, sub_path }), |
| 2143 | 2134 | } }, |
| 2144 | 2135 | .generated => |gen| .{ .generated = .{ |
| 2145 | | .file = gen.file, |
| 2136 | .index = gen.index, |
| 2146 | 2137 | .up = gen.up, |
| 2147 | 2138 | .sub_path = try fs.path.resolve(arena, &.{ gen.sub_path, sub_path }), |
| 2148 | 2139 | } }, |