From e8446ac17b6a2764d0712caed9dac6cfc69aafb6 Mon Sep 17 00:00:00 2001 From: Jonathan Marler Date: Sun, 20 Jul 2025 08:05:50 -0600 Subject: [PATCH] upgrade 3.11.4 to 3.11.13 --- .github/workflows/artifact.yml | 2 +- build.zig | 52 ++++++++++++++++------------------ build.zig.zon | 6 ++-- 3 files changed, 29 insertions(+), 31 deletions(-) diff --git a/.github/workflows/artifact.yml b/.github/workflows/artifact.yml index 3009778..fa85aaf 100644 --- a/.github/workflows/artifact.yml +++ b/.github/workflows/artifact.yml @@ -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 diff --git a/build.zig b/build.zig index e6e96b6..ae605c1 100644 --- a/build.zig +++ b/build.zig @@ -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", }; } @@ -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), }; @@ -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"); @@ -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, @@ -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"); @@ -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; }, @@ -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 @@ -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()); }, @@ -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", }, }), @@ -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", }, }), @@ -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", }, }), @@ -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" }, @@ -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" }, @@ -1202,7 +1202,7 @@ const exe_config_set = struct { .{ .HAVE_WORKING_TZSET, "#include \nint main(){tzset(); return 0;}" }, .{ .HAVE_ZLIB_COPY, "#include \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 \nint main(){ttyname(0);}" }, .{ .HAVE_LIBGDBM_COMPAT, "#include \nint main(){GDBM_FILE gf; return 0;}" }, .{ .HAVE_LIBNDBM, "#include \nint main(){DBM *db; return 0;}" }, @@ -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, @@ -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, @@ -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, @@ -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", }; @@ -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", @@ -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 ++ .{ @@ -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; }; @@ -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", }; } diff --git a/build.zig.zon b/build.zig.zon index 52a8e02..2e8e99b 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -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" = .{