From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id o5ADBZde3mYsvyQAWB0awg (envelope-from ) for ; Sun, 08 Sep 2024 22:33:59 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=PQef6Fr2; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sNkiYAJr; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=PQef6Fr2; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=sNkiYAJr; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id E69CF1E353; Sun, 8 Sep 2024 22:33:58 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-11.8 required=5.0 tests=ARC_SIGNED,ARC_VALID, BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL, RCVD_IN_VALIDITY_SAFE,URIBL_BLOCKED,URIBL_DBL_BLOCKED_OPENDNS autolearn=ham autolearn_force=no version=4.0.0 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 5E48D1E05C for ; Sun, 8 Sep 2024 22:33:57 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 753E0385E44D for ; Mon, 9 Sep 2024 02:33:56 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id C283E385840C for ; Mon, 9 Sep 2024 02:33:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C283E385840C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C283E385840C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725849214; cv=none; b=D5cFSDMbdDYB77QjtmiQTJtSMKNfK3LPl+FLDDYAru3d+Jp9Kxdl85h0tUVHmkdW2kXNLicQn8H4b+v1YNGXSMF7rLyrIPJH44j8HdHsEQ3X57FAtB3oXqdRL8AIWdkV6Q12aWCMSdxwb36mjT6rJU1nobtNsY52rRvyVzYyKFU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725849214; c=relaxed/simple; bh=cI+mmCfbLGHjFP8E6a9nIMhbG/Qwpk7/Fm58EECnkp4=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=H2SaaMWB8py+acxn4sG2VIi5MRNuDaR6WrOU9Jd7AYwLxbdvR9OKjfhlfHZjPgVOi6eqSWbapU3v18rGxIbPxN3AfTl7GbkBe8Qod1WhZWPbeP10YOaZe6qneinD7cm9EzC29JNT3AZJmLVQlZV5Ku8Xxs7+pgRAjgY/ci71GP8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B92641F74D; Mon, 9 Sep 2024 02:33:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725849211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KK3edol3GqhTepRlXTl5uNvFNR5/fR9RFR+7GJOBOGw=; b=PQef6Fr2qo2YyXCe1ZHp+pIPSRwXEKCzpwED3xN+W5Cob4sCAV0B3+5dd1DwOZSYV0mL2W i18xmOB7HSxRyAAthHdeRFkzmQlJ8QyjT5J9FetYfdc1MKihi3mXcQ+Qv40jUZXPHBXlUl uYIIFa16jyI+cNANHbKd2g6paFoVFL0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725849211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KK3edol3GqhTepRlXTl5uNvFNR5/fR9RFR+7GJOBOGw=; b=sNkiYAJrGMlxKGpM8sZ1pGaKnC5KLDoaa07cSNRWPjuHUWpXHWIuouMM7iBfKupDldy9QP Ub1es6p+GMo4P8Cg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1725849211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KK3edol3GqhTepRlXTl5uNvFNR5/fR9RFR+7GJOBOGw=; b=PQef6Fr2qo2YyXCe1ZHp+pIPSRwXEKCzpwED3xN+W5Cob4sCAV0B3+5dd1DwOZSYV0mL2W i18xmOB7HSxRyAAthHdeRFkzmQlJ8QyjT5J9FetYfdc1MKihi3mXcQ+Qv40jUZXPHBXlUl uYIIFa16jyI+cNANHbKd2g6paFoVFL0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1725849211; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KK3edol3GqhTepRlXTl5uNvFNR5/fR9RFR+7GJOBOGw=; b=sNkiYAJrGMlxKGpM8sZ1pGaKnC5KLDoaa07cSNRWPjuHUWpXHWIuouMM7iBfKupDldy9QP Ub1es6p+GMo4P8Cg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id A014613A3A; Mon, 9 Sep 2024 02:33:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id x9iBJXte3mZNEQAAD6G6ig (envelope-from ); Mon, 09 Sep 2024 02:33:31 +0000 Message-ID: Date: Mon, 9 Sep 2024 04:33:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [gdb/testsuite] Handle missing curses in gdb.python/py-missing-debug.exp To: Andrew Burgess , gdb-patches@sourceware.org References: <20240907033713.4483-1-tdevries@suse.de> <87frq9swxc.fsf@redhat.com> Content-Language: en-US From: Tom de Vries In-Reply-To: <87frq9swxc.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.29 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.19)[-0.963]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; MID_RHS_MATCH_FROM(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:mid,suse.de:email] 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 On 9/8/24 22:38, Andrew Burgess wrote: > Tom de Vries writes: > >> On a system with python 3.6, module gdb.missing_debug imports module curses, >> so when running test-case gdb.python/py-missing-debug.exp on a system without >> that module installed, we run into: >> ... >> (gdb) source py-missing-debug.py^M >> Python Exception : Module 'curses' is not installed.^M >> Use:^M >> sudo zypper install python36-curses^M >> to install it.^M >> Error occurred in Python: Module 'curses' is not installed.^M >> Use:^M >> sudo zypper install python36-curses^M >> to install it.^M >> (gdb) FAIL: gdb.python/py-missing-debug.exp: source python script > Hi Andrew, > Do you know where the curses include is coming from? > Yes, from gdb/python/lib/gdb/missing_debug.py: ... if sys.version_info >= (3, 7): # Functions str.isascii() and str.isalnum are available starting Python # 3.7. def isascii(ch): return ch.isascii() def isalnum(ch): return ch.isalnum() else: # Fall back to curses.ascii.isascii() and curses.ascii.isalnum() for # earlier versions. from curses.ascii import isalnum, isascii ... Thanks, - Tom > The py-missing-debug.py imports 'os' for os.rename and 'enum' for 'Enum' > class. I'm guessing one of these, (maybe 'os' ?) is pulling in curses, > but maybe there's something better we could use other than os.rename > which would avoid this issue? > > If is 'os' that is pulling in 'curses', doesn't this feel like either > the system was broken anyway, or the package dependencies are broken? > > Just curious to understand this better as I was a little surprised to > see that curses was a dependency of this test. > > Thanks, > Andrew > > >> ... >> >> Fix this by issuing UNSUPPORTED instead, and bailing out. >> >> Tested on x86_64-linux. >> >> PR testsuite/31576 >> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31576 >> --- >> gdb/testsuite/gdb.python/py-missing-debug.exp | 17 +++++++++++++++-- >> 1 file changed, 15 insertions(+), 2 deletions(-) >> >> diff --git a/gdb/testsuite/gdb.python/py-missing-debug.exp b/gdb/testsuite/gdb.python/py-missing-debug.exp >> index dfc0a467b2a..9d853d3a311 100644 >> --- a/gdb/testsuite/gdb.python/py-missing-debug.exp >> +++ b/gdb/testsuite/gdb.python/py-missing-debug.exp >> @@ -58,8 +58,21 @@ with_test_prefix "initial checks" { >> } >> >> # Load the Python script into GDB. >> -gdb_test "source $remote_python_file" "^Success" \ >> - "source python script" >> +set python_script_loaded 0 >> +set re_no_curses [string_to_regexp "Module 'curses' is not installed."] >> +gdb_test_multiple "source $remote_python_file" "source python script" { >> + -re -wrap $re_no_curses.* { >> + unsupported $gdb_test_name >> + } >> + -re -wrap "^Success" { >> + set python_script_loaded 1 >> + pass $gdb_test_name >> + } >> +} >> + >> +if { ! $python_script_loaded } { >> + return >> +} >> >> # Setup the separate debug info directory. This isn't actually needed until >> # some of the later tests, but might as well get this done now. >> >> base-commit: 4723415cda09b09dbac743f30f877355a49fdee2 >> -- >> 2.35.3 >