| ... | @@ -3008,10 +3008,19 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE | ... | @@ -3008,10 +3008,19 @@ pub fn update(comp: *Compilation, main_progress_node: std.Progress.Node) UpdateE |
| 3008 | | 3008 | |
| 3009 | // For compiling C objects, we rely on the cache hash system to avoid duplicating work. | 3009 | // For compiling C objects, we rely on the cache hash system to avoid duplicating work. |
| 3010 | // Add a Job for each C object. | 3010 | // Add a Job for each C object. |
| 3011 | try comp.c_object_work_queue.ensureUnusedCapacity(gpa, comp.c_object_table.count()); | 3011 | if (comp.bin_file != null and comp.bin_file.?.post_prelink) { |
| 3012 | for (comp.c_object_table.keys()) |c_object| { | 3012 | assert(comp.config.incremental); |
| 3013 | comp.c_object_work_queue.pushBackAssumeCapacity(c_object); | 3013 | // TODO: this indicates that we are using incremental compilation and this is not the first |
| 3014 | try comp.appendFileSystemInput(try .fromUnresolved(arena, comp.dirs, &.{c_object.src.src_path})); | 3014 | // incremental update. The incremental linkers do not (currently?) support updating C inputs |
| | 3015 | // incrementally. The frontend needs to learn to trigger a full rebuild if a C link input |
| | 3016 | // changes. For now, to avoid crashing the linker in this case, don't kick off C object |
| | 3017 | // updates if we've done prelink already. https://codeberg.org/ziglang/zig/issues/32081 |
| | 3018 | } else { |
| | 3019 | try comp.c_object_work_queue.ensureUnusedCapacity(gpa, comp.c_object_table.count()); |
| | 3020 | for (comp.c_object_table.keys()) |c_object| { |
| | 3021 | comp.c_object_work_queue.pushBackAssumeCapacity(c_object); |
| | 3022 | try comp.appendFileSystemInput(try .fromUnresolved(arena, comp.dirs, &.{c_object.src.src_path})); |
| | 3023 | } |
| 3015 | } | 3024 | } |
| 3016 | | 3025 | |
| 3017 | for (comp.link_inputs) |input| if (input.path()) |path| { | 3026 | for (comp.link_inputs) |input| if (input.path()) |path| { |
| ... | @@ -7595,6 +7604,9 @@ pub fn queuePrelinkTaskMode(comp: *Compilation, path: Cache.Path, must_link: boo | ... | @@ -7595,6 +7604,9 @@ pub fn queuePrelinkTaskMode(comp: *Compilation, path: Cache.Path, must_link: boo |
| 7595 | | 7604 | |
| 7596 | /// Only valid to call during `update`. | 7605 | /// Only valid to call during `update`. |
| 7597 | pub fn queuePrelinkTasks(comp: *Compilation, tasks: []const link.PrelinkTask) Io.Cancelable!void { | 7606 | pub fn queuePrelinkTasks(comp: *Compilation, tasks: []const link.PrelinkTask) Io.Cancelable!void { |
| | 7607 | if (tasks.len > 0) { |
| | 7608 | if (comp.bin_file) |lf| assert(!lf.post_prelink); |
| | 7609 | } |
| 7598 | comp.link_prog_node.increaseEstimatedTotalItems(tasks.len); | 7610 | comp.link_prog_node.increaseEstimatedTotalItems(tasks.len); |
| 7599 | try comp.link_queue.enqueuePrelink(comp, tasks); | 7611 | try comp.link_queue.enqueuePrelink(comp, tasks); |
| 7600 | } | 7612 | } |