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