| ... | ... | @@ -2110,15 +2110,15 @@ fn markNeededLazyDep(b: *Build, pkg_hash: []const u8) void { |
| 2110 | 2110 | } |
| 2111 | 2111 | |
| 2112 | 2112 | /// When this function is called, it means that the current build does, in |
| 2113 | | /// fact, require this dependency. If the dependency is already fetched, it |
| 2114 | | /// proceeds in the same manner as `dependency`. However if the dependency was |
| 2115 | | /// not fetched, then when the build script is finished running, the build will |
| 2116 | | /// not proceed to the make phase. Instead, the parent process will |
| 2117 | | /// additionally fetch all the lazy dependencies that were actually required by |
| 2118 | | /// running the build script, rebuild the build script, and then run it again. |
| 2119 | | /// In other words, if this function returns `null` it means that the only |
| 2120 | | /// purpose of completing the configure phase is to find out all the other lazy |
| 2121 | | /// dependencies that are also required. |
| 2113 | /// fact, require this dependency. If the dependency is already fetched, it is |
| 2114 | /// returned. However if the dependency is not yet fetched, then when the build |
| 2115 | /// script is finished running, the build will not proceed to the make phase. |
| 2116 | /// Instead, the parent process will additionally fetch all the lazy |
| 2117 | /// dependencies that were actually required by running the build script, |
| 2118 | /// rebuild the build script, and then run it again. In other words, if this |
| 2119 | /// function returns `null` it means that the only purpose of completing the |
| 2120 | /// configure phase is to find out all the other lazy dependencies that are |
| 2121 | /// also required. |
| 2122 | 2122 | /// |
| 2123 | 2123 | /// It is allowed to use this function for non-lazy dependencies, in which case |
| 2124 | 2124 | /// it will never return `null`. This allows toggling laziness via |
| ... | ... | @@ -2358,12 +2358,15 @@ pub inline fn runPackageScript(b: *Build, comptime build_zig: anytype) void { |
| 2358 | 2358 | result catch |err| switch (err) { |
| 2359 | 2359 | error.LazyDependencyNeeded => assert(b.graph.needed_lazy_dependencies.count() != 0), |
| 2360 | 2360 | else => { |
| 2361 | | if (@errorReturnTrace()) |trace| std.debug.dumpErrorReturnTrace(trace); |
| 2362 | 2361 | if (b.dep_prefix.len == 0) { |
| 2363 | | process.fatal("package {q} configuration failed: {t}", .{ b.dep_prefix, err }); |
| 2362 | log.err("package {q} configuration failed: {t}", .{ b.dep_prefix, err }); |
| 2364 | 2363 | } else { |
| 2365 | | process.fatal("configuration failed: {t}", .{err}); |
| 2364 | log.err("configuration failed: {t}", .{err}); |
| 2366 | 2365 | } |
| 2366 | if (@errorReturnTrace()) |trace| std.debug.dumpErrorReturnTrace(trace); |
| 2367 | const lazy_count = b.graph.needed_lazy_dependencies.count(); |
| 2368 | if (lazy_count == 0) process.exit(1); |
| 2369 | log.info("{d} lazy dependencies detected; fetching and retrying configuration", .{lazy_count}); |
| 2367 | 2370 | }, |
| 2368 | 2371 | }; |
| 2369 | 2372 | } |