From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id D24AB3857404 for ; Mon, 21 Mar 2022 16:31:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D24AB3857404 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca Received: from [172.16.0.144] (192-222-180-24.qc.cable.ebox.net [192.222.180.24]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 19E331EDF0; Mon, 21 Mar 2022 12:31:30 -0400 (EDT) Message-ID: Date: Mon, 21 Mar 2022 12:31:29 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 1/2] gdb/python: remove Python 2 support Content-Language: tl To: Pedro Alves , Eli Zaretskii , Simon Marchi Cc: gdb-patches@sourceware.org References: <20220107152921.2858909-1-simon.marchi@polymtl.ca> <20220321144624.1450968-1-simon.marchi@efficios.com> <20220321144624.1450968-2-simon.marchi@efficios.com> <83lex3fj3h.fsf@gnu.org> <89a0c3a3-b891-bdfc-e7cc-7ca628d30f16@simark.ca> <099c15b0-71e1-2249-82b2-d0456ec240b4@palves.net> From: Simon Marchi In-Reply-To: <099c15b0-71e1-2249-82b2-d0456ec240b4@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3639.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Mar 2022 16:31:32 -0000 On 2022-03-21 11:33, Pedro Alves wrote: > On 2022-03-21 15:04, Simon Marchi wrote: >> On 2022-03-21 10:58, Eli Zaretskii via Gdb-patches wrote: >>> Here, I think we should say "only against Python 3", or say "Python 2 >>> is not supported as of GDB 13", or something to that effect. Because >>> it is otherwise strange to mention Python 3, it sounds "out of the >>> blue". >> >> I'll say "can only be built against Python 3" then. I'd rather not say >> "GDB 13", since this text will live for many GDB versions. Updated >> locally. > > We document in gdb/README the minimum supported version, so I think you > could drop the "Python 3" reference completely if you wanted. Ok, I'll remove that sentence. > > Speaking of which, said gdb/README note should also be updated, as is documents > that the oldest supported version is 2.6: > > `--with-python[=PYTHON]' > Build GDB with Python scripting support. (Done by default if > libpython is present and found at configure time.) Python makes > GDB scripting much more powerful than the restricted CLI > scripting language. If your host does not have Python installed, > you can find it on `http://www.python.org/download/'. The oldest > version of Python supported by GDB is 2.6. The optional argument > PYTHON is used to find the Python headers and libraries. It can > be either the name of a Python executable, or the name of the > directory in which Python is installed. Indeed, we should update it. But we should probably be precise and which 3.x version we support exactly. The question is what do we support? My initial patch #3 removed support for below 3.4, so it must be below 3.4. Using this PPA https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa on Ubuntu 18.04, I tried Python 3.1 and above. Python 3.1 didn't build because of this: CXX python/py-record-btrace.o ../../gdb/python/py-record-btrace.c: In function 'PyObject* btpy_list_slice(PyObject*, PyObject*)': ../../gdb/python/py-record-btrace.c:504:25: error: cannot convert 'PyObject* {aka _object*}' to 'PySliceObject*' for argument '1' to 'int PySlice_GetIndicesEx(PySliceObject*, Py_ssize_t, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*, Py_ssize_t*)' &step, &slicelength)) ^ ... which is a "bug" in the Python 3.1 API, fixed in 3.2. Python 3.2 built fine (although I didn't test further, other than starting GDB). So I would replace "2.6" with "3.2" in there. Sounds good? Simon