mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 20:37:54 +00:00
stage2: fix panic when the dependency is missing
This commit is contained in:
parent
0d96f1f4fb
commit
f7784a081f
@ -10379,7 +10379,9 @@ fn zirImport(sema: *Sema, block: *Block, inst: Zir.Inst.Index) CompileError!Air.
|
||||
}
|
||||
}
|
||||
unreachable;
|
||||
} else unreachable;
|
||||
} else {
|
||||
return sema.fail(block, operand_src, "no package named '{s}' available", .{operand});
|
||||
};
|
||||
return sema.fail(block, operand_src, "no package named '{s}' available within package '{s}'", .{ operand, parent });
|
||||
},
|
||||
else => {
|
||||
|
||||
14
src/main.zig
14
src/main.zig
@ -2750,8 +2750,22 @@ fn buildOutputType(
|
||||
|
||||
// Transfer packages added with --pkg-begin/--pkg-end to the root package
|
||||
if (main_pkg) |pkg| {
|
||||
var it = pkg_tree_root.table.valueIterator();
|
||||
while (it.next()) |p| {
|
||||
if (p.*.parent == &pkg_tree_root) {
|
||||
p.*.parent = pkg;
|
||||
}
|
||||
}
|
||||
pkg.table = pkg_tree_root.table;
|
||||
pkg_tree_root.table = .{};
|
||||
} else {
|
||||
// Remove any dangling pointers just in case.
|
||||
var it = pkg_tree_root.table.valueIterator();
|
||||
while (it.next()) |p| {
|
||||
if (p.*.parent == &pkg_tree_root) {
|
||||
p.*.parent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const self_exe_path = try introspect.findZigExePath(arena);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user