| ... | ... | @@ -1446,32 +1446,34 @@ fn configure(graph: *Graph, options: ConfigureOptions) !ScannedConfig { |
| 1446 | 1446 | } |
| 1447 | 1447 | if (!f.has_build_zig) continue; |
| 1448 | 1448 | |
| 1449 | | const project_id: Package.ProjectId = .init(f.manifest.name, f.manifest.id); |
| 1450 | | if (fork_set.getKeyPtrAdapted(project_id, @as(Fetch.JobQueue.Fork.Adapter, .{}))) |fork| { |
| 1451 | | const path = try fork.path.toString(arena); |
| 1452 | | const gop = deps_mod.deps.getOrPutAssumeCapacity(path); |
| 1453 | | if (gop.found_existing) { |
| 1454 | | assert(fork.uses > 1); |
| 1455 | | f.cli_module = gop.value_ptr.*; |
| 1456 | | } else { |
| 1457 | | const m = try arena.create(CliModule); |
| 1458 | | m.* = .{ |
| 1459 | | .root_path = try f.package_root.toString(arena), |
| 1460 | | .name = path, |
| 1461 | | }; |
| 1462 | | gop.value_ptr.* = m; |
| 1463 | | f.cli_module = m; |
| 1449 | if (f.have_manifest) { |
| 1450 | const project_id: Package.ProjectId = .init(f.manifest.name, f.manifest.id); |
| 1451 | if (fork_set.getKeyPtrAdapted(project_id, @as(Fetch.JobQueue.Fork.Adapter, .{}))) |fork| { |
| 1452 | const path = try fork.path.toString(arena); |
| 1453 | const gop = deps_mod.deps.getOrPutAssumeCapacity(path); |
| 1454 | if (gop.found_existing) { |
| 1455 | assert(fork.uses > 1); |
| 1456 | f.cli_module = gop.value_ptr.*; |
| 1457 | } else { |
| 1458 | const m = try arena.create(CliModule); |
| 1459 | m.* = .{ |
| 1460 | .root_path = try f.package_root.toString(arena), |
| 1461 | .name = path, |
| 1462 | }; |
| 1463 | gop.value_ptr.* = m; |
| 1464 | f.cli_module = m; |
| 1465 | } |
| 1466 | continue; |
| 1464 | 1467 | } |
| 1465 | | } else { |
| 1466 | | const hash_slice = try arena.dupe(u8, hash.toSlice()); |
| 1467 | | const m = try arena.create(CliModule); |
| 1468 | | m.* = .{ |
| 1469 | | .root_path = try f.package_root.toString(arena), |
| 1470 | | .name = hash_slice, |
| 1471 | | }; |
| 1472 | | deps_mod.deps.putAssumeCapacityNoClobber(hash_slice, m); |
| 1473 | | f.cli_module = m; |
| 1474 | 1468 | } |
| 1469 | const hash_slice = try arena.dupe(u8, hash.toSlice()); |
| 1470 | const m = try arena.create(CliModule); |
| 1471 | m.* = .{ |
| 1472 | .root_path = try f.package_root.toString(arena), |
| 1473 | .name = hash_slice, |
| 1474 | }; |
| 1475 | deps_mod.deps.putAssumeCapacityNoClobber(hash_slice, m); |
| 1476 | f.cli_module = m; |
| 1475 | 1477 | } |
| 1476 | 1478 | |
| 1477 | 1479 | // Each build.zig module needs access to each of its dependencies' build.zig modules by |