From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id at5yMBWH7mjgEjIAWB0awg (envelope-from ) for ; Tue, 14 Oct 2025 13:23:33 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=V4pPEBlv; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id B1DB71E047; Tue, 14 Oct 2025 13:23:33 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 81E2D1E047 for ; Tue, 14 Oct 2025 13:23:32 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EB344385842C for ; Tue, 14 Oct 2025 17:23:31 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EB344385842C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=gnu.org header.i=@gnu.org header.a=rsa-sha256 header.s=fencepost-gnu-org header.b=V4pPEBlv Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id 838933858D38 for ; Tue, 14 Oct 2025 17:23:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 838933858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 838933858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:470:142:3::10 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760462581; cv=none; b=g3WU8TAoyLGa7AkXWToabG2z13IswORiRbDTQP7ch5T5/uvTNwwaYQ13gbg7FGQ1EAzdlPNoYKo5DsH5FXdmMBXBcIWV+fmwHA4yjMq447lWRktbljkF9zc6EOadmbrIk04fIxDrAEyzp1w4Wy+B+eMX0xi7WfvkFZr0DZjWeEE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1760462581; c=relaxed/simple; bh=Tj0kUiRa0Dijb5NQUuFJgdKe1VllbmV8qSK5I8bYeyg=; h=DKIM-Signature:Date:Message-Id:From:To:Subject; b=A6vU54QQtoLQYienOV5mZ8DDkVm8vF9Efa1svQq1O1gps6ftsuvTUCTbz5ZZUH8i0jaJwY7mB5lsdjK35jzb0T7PRJ4knol1Pq4i7rzmh5mSh/UtCwf5Kr+vzCn9tOtk9MJJKdpserWDyZ511Hc010Zez79RjFS79aIJWIQYXsw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 838933858D38 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1v8ijj-00086Z-Gh; Tue, 14 Oct 2025 13:22:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=WitiVy3j1qRxW9txRPzKIrfDVWBD5UguCg/4Mro/dIw=; b=V4pPEBlvg7eu bQgzrkLmCMBdPQWu4VYlpoZxxgcL/krNBjY19a2/dUGfCZtyasNSfvJfyjbv+yh11504+LL5FF3bG CebVTCnAb/nPJLq3LfqDjiMMDYFKf+duRiXy2xF1kA61Xx/ARob9ufVMwvuM48MUkMRwp+fDiYBXX HdbuyRiJJVpYceZLPqF9oQZJsXqx3bUj9WuxAuo5dlZ3l1yix/Kkos/ATEp0YV2KKJg5ks9er8FC3 v4dkEveFm4vwqwRSOj+vwbaa3hPzr/fkFfOzXcapkNl+MwhPPyWmMyNXQ80Dd85ceZaZm8gAwX00g 0XIRjIQmztnifnQypLzcdg==; Date: Tue, 14 Oct 2025 20:22:56 +0300 Message-Id: <868qhd2ya7.fsf@gnu.org> From: Eli Zaretskii To: Matthieu Longo Cc: gdb-patches@sourceware.org, tom@tromey.com, aburgess@redhat.com In-Reply-To: <20251014164458.2000229-1-matthieu.longo@arm.com> (message from Matthieu Longo on Tue, 14 Oct 2025 17:44:56 +0100) Subject: Re: [PATCH v2 0/2] Add experimental option --enable-py-limited-api References: <20251014164458.2000229-1-matthieu.longo@arm.com> X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org > From: Matthieu Longo > CC: Tom Tromey , Andrew Burgess , > Matthieu Longo > Date: Tue, 14 Oct 2025 17:44:56 +0100 > > This patch series introduces an experimental build option, '--enable-py-limited-api', which allows GDB to be compiled against the Python 3 stable C API. > > As explained in [1] and [2], using the stable API would make it possible to build GDB against one version of Python 3, while still allowing it to run with other versions available on the user's system. > > The migration to the stable API can be done incrementally. These patches do not attempt to port the entire codebase at once. Instead, they provide a development mode where contributors can experiment with the limited API and progressively fix incompatibilities. By default, this option is disabled (--enable-py-limited-api=no). > > The series contains two patches: > - Update the Python conftest to avoid use of unstable API calls, ensuring compatibility with the limited API. > - Introduce the --enable-py-limited-api option in GDB's configure. > > Tested with Python 3.4 and 3.13. > > Diff against revision 1: > - addressed comments of Tom Tromey regarding code formatting, and removal of config.h Thanks. Should this be in NEWS? Also, I'm guessing that this change will not allow to run the MinGW build of GDB with versions of Python other than the one against which GDB was compiled, because AFAIK linking against shared libraries on Windows records that library in the executable, and GDB will therefore refuse to run when that DLL cannot be found. So, for example, if GDB was linked against python34.dll, it will insist on finding it when Windows loads the executable, and if not found, will not run. If we want this to work on Windows, we need to load the Python DLL at runtime, using the likes of dlopen, and then manually import the APIs we need using dladdr. Which AFAIU, this patch doesn't do. Apologies if I'm missing something, and thus make no sense.