diff --git a/BRANCH_TODO b/BRANCH_TODO index 2b02293e9a8f20d66192d1710d32d93aa4304a08..1b5f0d8e3df2bc55849c238d52a856e788c9945c 100644 --- a/BRANCH_TODO +++ b/BRANCH_TODO @@ -2,7 +2,6 @@ * inspect b4ffb402c082605c4b324e88120306fc8fb3cf32 diff and apply changes as needed (merge conflict) * make zig-pkg path root configurable in maker (make sure --system still works) * eliminate calls to getPath, getPath2, getPath3 -* [build system compile step data races with getGraph function](https://codeberg.org/ziglang/zig/issues/31397) * test lazyImport * solve the TODOs added in this branch * get zig tests passing @@ -17,6 +16,7 @@ * refactor with DefaultingEnum * implement {q} or delete {q} uses +* make the generated dependencies.zig be dependencies.zon and don't put absolute paths in there ## Followup Issues * reduce the size of Maker.Step.Extended (make Run smaller) probably by using an arena per make @@ -49,3 +49,5 @@ run_cmd.addPassthruArgs(); This removes a capability from build scripts since they can no longer observe those arguments. In exchange, it means that when changing those arguments, build scripts no longer must be rebuilt from source. + +closes #31397 diff --git a/lib/compiler/Maker/ScannedConfig.zig b/lib/compiler/Maker/ScannedConfig.zig index 183146af278abe426d194ed932ed83300525b5aa..487f0b16122ae7987ab048412cc86c7501b17ab6 100644 --- a/lib/compiler/Maker/ScannedConfig.zig +++ b/lib/compiler/Maker/ScannedConfig.zig @@ -79,6 +79,15 @@ fn printValue(sc: *const ScannedConfig, s: *Serializer, comptime Field: type, fi try printStruct(sc, &sub_struct, Configuration.Step.Run.Arg, field_value.get(c)); try sub_struct.end(); }, + Configuration.LazyPath.Index => { + switch (field_value.get(c)) { + inline else => |u| { + var sub_struct = try s.beginStruct(.{}); + try printStruct(sc, &sub_struct, @TypeOf(u), u); + try sub_struct.end(); + }, + } + }, else => switch (@typeInfo(Field)) { .int => try s.int(field_value), .pointer => |info| switch (info.size) { diff --git a/lib/compiler/configurer.zig b/lib/compiler/configurer.zig index 3fde1e989bde460555f53d0f8bd2150dc541de08..6b034e7cabfb82240e726fd88cc48a153197cc99 100644 --- a/lib/compiler/configurer.zig +++ b/lib/compiler/configurer.zig @@ -164,7 +164,6 @@ const Serialize = struct { .src_path => |src_path| i: { const sub_path = try wc.addString(src_path.sub_path); break :i try wc.addExtra(@as(Configuration.LazyPath.SourcePath, .{ - .flags = .{}, .owner = try s.builderToPackage(src_path.owner), .sub_path = sub_path, })); @@ -187,7 +186,6 @@ const Serialize = struct { .dependency => |dependency| i: { const sub_path = try wc.addString(dependency.sub_path); break :i try wc.addExtra(@as(Configuration.LazyPath.SourcePath, .{ - .flags = .{}, .owner = try s.builderToPackage(dependency.dependency.builder), .sub_path = sub_path, })); diff --git a/lib/std/Build/Configuration.zig b/lib/std/Build/Configuration.zig index 4ce04aa05af0f2b590ca479186e0104b3d9d9577..d3a5a2086b19ca8910b6318bd34d7bcf2890d226 100644 --- a/lib/std/Build/Configuration.zig +++ b/lib/std/Build/Configuration.zig @@ -1173,7 +1173,7 @@ pub const LazyPath = union(@This().Tag) { }; pub const SourcePath = struct { - flags: @This().Flags, + flags: @This().Flags = .{}, owner: Package.Index, sub_path: String, @@ -2318,10 +2318,9 @@ pub const Storage = enum { /// Valid to call only when deserializing. pub fn tag(this: *const @This(), extra: []const u32, i: usize) Tag { - _ = this; - _ = extra; - _ = i; - @panic("TODO implement UnionList.tag"); + const start = @intFromPtr(this.data); + const meta_start = start - (this.len * @bitSizeOf(Meta) + 31) / 32; + return loadBits(u32, extra[meta_start..], i * @bitSizeOf(Meta), Meta).tag; } fn extraLen(len: usize) usize {