Skip to content

upgrade 3.11.4 to 3.11.13 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/artifact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ jobs:
- run: |
zig build ci --summary all
- run: |
zig build ci -Dversion=3.11.4 --summary all
zig build ci -Dversion=3.11.13 --summary all
52 changes: 25 additions & 27 deletions build.zig
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const Version = enum {
@"3.11.4",
@"3.11.13",
@"3.12.11",
pub fn libName(self: Version) []const u8 {
return switch (self) {
.@"3.11.4" => "3.11",
.@"3.11.13" => "3.11",
.@"3.12.11" => "3.12",
};
}
Expand Down Expand Up @@ -59,7 +59,7 @@ pub fn build(b: *std.Build) !void {
});

const upstream: *std.Build.Dependency = switch (version) {
.@"3.11.4" => if (b.lazyDependency("upstream_3.11.4", .{})) |d| d else noUpstream(b),
.@"3.11.13" => if (b.lazyDependency("upstream_3.11.13", .{})) |d| d else noUpstream(b),
.@"3.12.11" => if (b.lazyDependency("upstream_3.12.11", .{})) |d| d else noUpstream(b),
};

Expand Down Expand Up @@ -155,7 +155,7 @@ pub fn build(b: *std.Build) !void {
const run = std.Build.Step.Run.create(b, "run deepfreeze.py");
run.addFileArg(bootstrap_packaged.exe);
run.addFileArg(upstream.path(switch (version) {
.@"3.11.4" => "Tools/scripts/deepfreeze.py",
.@"3.11.13" => "Tools/scripts/deepfreeze.py",
else => "Tools/build/deepfreeze.py",
}));
run.addArg("-o");
Expand Down Expand Up @@ -336,7 +336,7 @@ fn addMakesetup(
.xxlimited_35 = false,
._xxsubinterpreters = false,
};
const @"stdlib_modules_3.11.4" = .{
const @"stdlib_modules_3.11.13" = .{
._typing = true,
._sha256 = true,
._sha512 = true,
Expand Down Expand Up @@ -366,7 +366,7 @@ fn addMakesetup(
replace.addArg("MODULE_BUILDTYPE=static");
addReplaceModuleArgs(b, replace, @TypeOf(stdlib_modules_common), stdlib_modules_common);
switch (version) {
.@"3.11.4" => addReplaceModuleArgs(b, replace, @TypeOf(@"stdlib_modules_3.11.4"), @"stdlib_modules_3.11.4"),
.@"3.11.13" => addReplaceModuleArgs(b, replace, @TypeOf(@"stdlib_modules_3.11.13"), @"stdlib_modules_3.11.13"),
.@"3.12.11" => {
replace.addArg("MODULE__CTYPES_MALLOC_CLOSURE=");
addReplaceModuleArgs(b, replace, @TypeOf(@"stdlib_modules_3.12.11"), @"stdlib_modules_3.12.11");
Expand Down Expand Up @@ -436,7 +436,7 @@ fn addPythonExe(
});

switch (args.pyconfig.version) {
.@"3.11.4" => {
.@"3.11.13" => {
// workaround dictobject.c memcpy alignment issue
exe.root_module.sanitize_c = false;
},
Expand All @@ -449,7 +449,7 @@ fn addPythonExe(
.Debug => {},
.ReleaseSafe, .ReleaseSmall, .ReleaseFast => {
const release_date = switch (args.pyconfig.version) {
.@"3.11.4" => "June 6, 2023",
.@"3.11.13" => "June 3, 2025",
.@"3.12.11" => "June 3, 2025",
};
// need to redefine __DATE__ and __TIME__ for a reproducible build
Expand Down Expand Up @@ -480,7 +480,7 @@ fn addPythonExe(
switch (args.stage) {
.freeze_module, .bootstrap => {},
.final => |final| switch (args.pyconfig.version) {
.@"3.11.4" => {},
.@"3.11.13" => {},
else => for (final.frozen_headers) |h| {
exe.addIncludePath(h.dirname().dirname());
},
Expand Down Expand Up @@ -566,7 +566,7 @@ fn addPythonExe(
"Modules/getpath_noop.c",
},
switch (args.pyconfig.version) {
.@"3.11.4" => &library_src_omit_frozen.@"3.11.4",
.@"3.11.13" => &library_src_omit_frozen.@"3.11.13",
.@"3.12.11" => &library_src_omit_frozen.@"3.12.11",
},
}),
Expand All @@ -576,7 +576,7 @@ fn addPythonExe(
"Modules/getbuildinfo.c",
},
switch (args.pyconfig.version) {
.@"3.11.4" => &library_src_omit_frozen.@"3.11.4",
.@"3.11.13" => &library_src_omit_frozen.@"3.11.13",
.@"3.12.11" => &library_src_omit_frozen.@"3.12.11",
},
}),
Expand All @@ -587,7 +587,7 @@ fn addPythonExe(
"Python/frozen.c",
},
switch (args.pyconfig.version) {
.@"3.11.4" => &library_src_omit_frozen.@"3.11.4",
.@"3.11.13" => &library_src_omit_frozen.@"3.11.13",
.@"3.12.11" => &library_src_omit_frozen.@"3.12.11",
},
}),
Expand Down Expand Up @@ -689,6 +689,7 @@ const header_config_set = struct {
.{ .HAVE_LANGINFO_H, "langinfo.h" },
.{ .HAVE_LIBINTL_H, "libintl.h" },
.{ .HAVE_LIBUTIL_H, "libutil.h" },
.{ .HAVE_LINUX_LIMITS_H, "linux/limits.h" },
.{ .HAVE_NETDB_H, "netdb.h" },
.{ .HAVE_NETINET_IN_H, "netinet/in.h" },
.{ .HAVE_NETPACKET_PACKET_H, "netpacket/packet.h" },
Expand Down Expand Up @@ -767,13 +768,12 @@ const header_config_set = struct {
.{ .HAVE_UUID_UUID_H, "uuid/uuid.h" },
.{ .HAVE_ZLIB_H, "zlib.h" },
};
pub const @"3.11.4" = concatConfigs(common, .{
pub const @"3.11.13" = concatConfigs(common, .{
.{ .HAVE_MEMORY_H, "memory.h" },
});
pub const @"3.12.11" = concatConfigs(common, .{
.{ .HAVE_EDITLINE_READLINE_H, "editline/readline.h" },
.{ .HAVE_LINUX_FS_H, "linux/fs.h" },
.{ .HAVE_LINUX_LIMITS_H, "linux/limits.h" },
.{ .HAVE_MINIX_CONFIG_H, "minix/config.h" },
.{ .HAVE_NET_ETHERNET_H, "net/ethernet.h" },
.{ .HAVE_PANEL_H, "panel.h" },
Expand Down Expand Up @@ -1202,7 +1202,7 @@ const exe_config_set = struct {
.{ .HAVE_WORKING_TZSET, "#include <time.h>\nint main(){tzset(); return 0;}" },
.{ .HAVE_ZLIB_COPY, "#include <zlib.h>\nint main(){z_stream strm; inflateCopy(&strm, &strm); return 0;}" },
};
pub const @"3.11.4" = concatConfigs(common, .{
pub const @"3.11.13" = concatConfigs(common, .{
.{ .HAVE_TTYNAME, "#include <unistd.h>\nint main(){ttyname(0);}" },
.{ .HAVE_LIBGDBM_COMPAT, "#include <gdbm.h>\nint main(){GDBM_FILE gf; return 0;}" },
.{ .HAVE_LIBNDBM, "#include <ndbm.h>\nint main(){DBM *db; return 0;}" },
Expand Down Expand Up @@ -1314,6 +1314,7 @@ fn addPyconfig(
.Py_ENABLE_SHARED = null,
.Py_HASH_ALGORITHM = null,
.Py_STATS = null,
.Py_SUNOS_VERSION = null,
.Py_TRACE_REFS = null,
.SETPGRP_HAVE_ARG = null,
.SIGNED_RIGHT_SHIFT_ZERO_FILLS = null,
Expand Down Expand Up @@ -1364,9 +1365,11 @@ fn addPyconfig(
.HAVE_USABLE_WCHAR_T = null,
.HAVE_NON_UNICODE_WCHAR_T_REPRESENTATION = null,
.HAVE_CHROOT = have(t.os.tag == .linux),
// Readline type (static configuration, not function test)
.HAVE_RL_COMPDISP_FUNC_T = null,
});
switch (version) {
.@"3.11.4" => config_header.addValues(.{
.@"3.11.13" => config_header.addValues(.{
.PY_FORMAT_SIZE_T = "z",
.TIME_WITH_SYS_TIME = 1,
.FLOAT_WORDS_BIGENDIAN = null,
Expand All @@ -1381,14 +1384,9 @@ fn addPyconfig(
// ncurses library (static configuration, not function test)
.HAVE_NCURSESW = null,

// Readline type (static configuration, not function test)
.HAVE_RL_COMPDISP_FUNC_T = null,

// Performance trampoline feature
.PY_HAVE_PERF_TRAMPOLINE = null,

// Platform-specific version defines
.Py_SUNOS_VERSION = null,
._HPUX_ALT_XOPEN_SOCKET_API = null,
._OPENBSD_SOURCE = null,

Expand All @@ -1404,11 +1402,11 @@ fn addPyconfig(
}

const header_configs: []const Config = switch (version) {
.@"3.11.4" => &header_config_set.@"3.11.4",
.@"3.11.13" => &header_config_set.@"3.11.13",
.@"3.12.11" => &header_config_set.@"3.12.11",
};
const exe_configs: []const Config = switch (version) {
.@"3.11.4" => &exe_config_set.@"3.11.4",
.@"3.11.13" => &exe_config_set.@"3.11.13",
.@"3.12.11" => &exe_config_set.@"3.12.11",
};

Expand Down Expand Up @@ -1548,7 +1546,7 @@ const python_src = struct {
"Python/fileutils.c",
"Python/suggestions.c",
};
pub const @"3.11.4" = common;
pub const @"3.11.13" = common;
pub const @"3.12.11" = common ++ .{
"Python/assemble.c",
"Python/flowgraph.c",
Expand Down Expand Up @@ -1607,7 +1605,7 @@ const object_src = struct {
"Objects/unionobject.c",
"Objects/weakrefobject.c",
};
pub const @"3.11.4" = common ++ .{
pub const @"3.11.13" = common ++ .{
"Objects/accu.c",
};
pub const @"3.12.11" = common ++ .{
Expand Down Expand Up @@ -1638,7 +1636,7 @@ const module_src = [_][]const u8{
};

const library_src_omit_frozen = struct {
pub const @"3.11.4" = parser_src ++ object_src.@"3.11.4" ++ python_src.@"3.11.4" ++ module_src;
pub const @"3.11.13" = parser_src ++ object_src.@"3.11.13" ++ python_src.@"3.11.13" ++ module_src;
pub const @"3.12.11" = parser_src ++ object_src.@"3.12.11" ++ python_src.@"3.12.11" ++ module_src;
};

Expand Down Expand Up @@ -1670,7 +1668,7 @@ const frozen_modules = [_][]const u8{

fn frozenModuleNames(version: Version) *const [frozen_modules.len][]const u8 {
return switch (version) {
.@"3.11.4" => &frozen_module_name_sets.@"3.11",
.@"3.11.13" => &frozen_module_name_sets.@"3.11",
else => &frozen_module_name_sets.@"after_3.11",
};
}
Expand Down
6 changes: 3 additions & 3 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
.version = "0.0.0",
.minimum_zig_version = "0.14.1",
.dependencies = .{
.@"upstream_3.11.4" = .{
.url = "git+https://github.com/python/cpython#d2340ef25721b6a72d45d4508c672c4be38c67d3",
.hash = "N-V-__8AABDkxQWDw9b21RiSHxBb2ErJ78saCf1XL88YMoT7",
.@"upstream_3.11.13" = .{
.url = "git+https://github.com/python/cpython#498b971ea3673012a1d4b21860b229d55fc6e575",
.hash = "N-V-__8AACr32QWySXRzLeDQuZNoyM6FlWz3U4smc4qJ0EXe",
.lazy = true,
},
.@"upstream_3.12.11" = .{
Expand Down
Loading