const ver_list_base = metadata.version_table.get(.{ .arch = target.cpu.arch, .os = target.os.tag, .abi = target.abi, }) orelse return error.GLibCUnavailableForThisTarget; const target_ver_index = for (metadata.all_versions) |ver, i| { switch (ver.order(target_version)) { .eq => break i, .lt => continue, .gt => { // TODO Expose via compile error mechanism instead of log. std.log.warn("invalid target glibc version: {}", .{target_version}); return error.InvalidTargetGLibCVersion; }, } } else blk: { const latest_index = metadata.all_versions.len - 1; std.log.warn("zig cannot build new glibc version {}; providing instead {}", .{ target_version, metadata.all_versions[latest_index], }); break :blk latest_index; };