| ... | ... | @@ -1385,17 +1385,34 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig { |
| 1385 | 1385 | // The first one is a dummy package for the current project. |
| 1386 | 1386 | continue; |
| 1387 | 1387 | } |
| 1388 | | if (!f.has_build_zig) |
| 1389 | | continue; |
| 1390 | | const hash_slice = try arena.dupe(u8, hash.toSlice()); |
| 1391 | | |
| 1392 | | const m = try arena.create(CliModule); |
| 1393 | | m.* = .{ |
| 1394 | | .root_path = try f.package_root.toString(arena), |
| 1395 | | .name = hash_slice, |
| 1396 | | }; |
| 1397 | | deps_mod.deps.putAssumeCapacityNoClobber(hash_slice, m); |
| 1398 | | f.cli_module = m; |
| 1388 | if (!f.has_build_zig) continue; |
| 1389 | |
| 1390 | const project_id: Package.ProjectId = .init(f.manifest.name, f.manifest.id); |
| 1391 | if (fork_set.getKeyPtrAdapted(project_id, @as(Fetch.JobQueue.Fork.Adapter, .{}))) |fork| { |
| 1392 | const path = try fork.path.toString(arena); |
| 1393 | const gop = deps_mod.deps.getOrPutAssumeCapacity(path); |
| 1394 | if (gop.found_existing) { |
| 1395 | assert(fork.uses > 1); |
| 1396 | f.cli_module = gop.value_ptr.*; |
| 1397 | } else { |
| 1398 | const m = try arena.create(CliModule); |
| 1399 | m.* = .{ |
| 1400 | .root_path = try f.package_root.toString(arena), |
| 1401 | .name = path, |
| 1402 | }; |
| 1403 | gop.value_ptr.* = m; |
| 1404 | f.cli_module = m; |
| 1405 | } |
| 1406 | } else { |
| 1407 | const hash_slice = try arena.dupe(u8, hash.toSlice()); |
| 1408 | const m = try arena.create(CliModule); |
| 1409 | m.* = .{ |
| 1410 | .root_path = try f.package_root.toString(arena), |
| 1411 | .name = hash_slice, |
| 1412 | }; |
| 1413 | deps_mod.deps.putAssumeCapacityNoClobber(hash_slice, m); |
| 1414 | f.cli_module = m; |
| 1415 | } |
| 1399 | 1416 | } |
| 1400 | 1417 | |
| 1401 | 1418 | // Each build.zig module needs access to each of its dependencies' build.zig modules by |