From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id uqtYNmoL3mZVhyQAWB0awg (envelope-from ) for ; Sun, 08 Sep 2024 16:39:06 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=cQG/Edlm; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id BB3261E353; Sun, 8 Sep 2024 16:39:06 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-10.1 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, 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 921651E08F for ; Sun, 8 Sep 2024 16:39:05 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E1160385C6C7 for ; Sun, 8 Sep 2024 20:39:04 +0000 (GMT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id 5EAD93858C66 for ; Sun, 8 Sep 2024 20:38:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5EAD93858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5EAD93858C66 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725827927; cv=none; b=ef5dnOcI+2nBhFbE8lKzZprw7rfoEoO1Y4UBDRBlDMi0spTiYL5A6EMqDb8i+fX4kTlpVYQFrwi3FaVHzqSALntW5o60rKylEkOOCXk3UZBr88ss2sHP4n0RrfsuhAsIq2aXLpMDe8dL097Gm9ZL4LuAYc+8NHlYeYmrhepRQ80= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1725827927; c=relaxed/simple; bh=kuCKdoMRlO6Pbvj0kzjfkoRzK7UC6+OGqVkHQUPbt+4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=QdiQo1AMp3AlwtJkg1g2FBk7Lz3+vAKxp2ioy4ueLIs5IZ14KsmISsAJkqOeghtx81dVz3JpuiFubANy7Ga5jg9+HpfmP4ZeSjHoEf7XVgf1hx1UuySeX6aB0bKeIMCWbYdQO1FTAoEJewzyRQVJu+e4MQw7GFzi6q/W5B7e8y8= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1725827925; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KG7fy5afkPJcyHqYfZngzvA4bvaFlVBIJFKZWSt/dsM=; b=cQG/Edlmjh/kVVGBlrV/w5ls/m2hTiTa4M5RSqIuja/oFLCfXIb5ZdHMeCalHMjYDRIlDL 1UQu8ecY9voUS1kzNQRndRgr1GGx57aV/Jm3TF9stxUWdE2+WvyohUWqQKINqVjBMR3qXU Cxvwztg6hae1z2w9/g8F3c9rRpkKqdA= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-692-ZqciQU-MNAqMkvksDWMK_Q-1; Sun, 08 Sep 2024 16:38:43 -0400 X-MC-Unique: ZqciQU-MNAqMkvksDWMK_Q-1 Received: by mail-lf1-f71.google.com with SMTP id 2adb3069b0e04-53659c3c9bdso1734434e87.3 for ; Sun, 08 Sep 2024 13:38:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725827922; x=1726432722; h=mime-version:message-id:date:references:in-reply-to:subject:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KG7fy5afkPJcyHqYfZngzvA4bvaFlVBIJFKZWSt/dsM=; b=K69D4TzOF3eZdtp8nSLz04JaPRij+QiqUz99mlUTJ/JuBdaIyAXhVSMG92qdzGZ8oD F/9jdUOkxCEwy3T8CgcUPa9bVSL95AyFqPAY8hh8zEYKurC+BpV0juVKfmCAteXOGsey 1hD+mHowp/dhkAw8h/zgp09tzrF/Z2I1Sk1GM4Cdulv9uO2rJm8Fa4PBtfqjVjPiLD/f eoeWyqS/nyDd8XiDOlUuU/JkxRVvvxtoSWiJkw15miGHxcAg9oGG6vvgpowTiaJnlcGW hEHDR/k5Jd4y9BgMJqJJGu2X0ZOp0rVeBjtlpUHqZMZKy2dXEloUm1d83zlmVQru5323 IPSg== X-Forwarded-Encrypted: i=1; AJvYcCVi+JZTJms8OVv87lUKoiBAcln2c2w/RJIE2BCU1VHS3Gk9stU8jMpJl28TkyY+aDb6/XYZ0aP+5UP6ng==@sourceware.org X-Gm-Message-State: AOJu0YxTVrzpvUSn65Of5hkQjtaOZiSzyy9MGZQuIX+BETxCQ445PPCX XbgYYOk1izyOgBZoKXV98dbxpW2K8wnr1+xAu+Ch84R6Onu88TB0GZWMzwzLreu0P0tmoPVBC0A MUDjnAjfFC2yYWSQBj+PgUKgh24yLXSrsukXwFTcals6LN4azU/nsd7DXsgM= X-Received: by 2002:a05:6512:3c96:b0:536:52ec:2870 with SMTP id 2adb3069b0e04-536587b3525mr7136932e87.28.1725827922040; Sun, 08 Sep 2024 13:38:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFv3ViYI4WvZffVhgFcDk+iwe9fkIyGr+qPf2v0G2tQ8iRB0FadP7wfrMran/ndJZHTgzVdmg== X-Received: by 2002:a05:6512:3c96:b0:536:52ec:2870 with SMTP id 2adb3069b0e04-536587b3525mr7136916e87.28.1725827920647; Sun, 08 Sep 2024 13:38:40 -0700 (PDT) Received: from localhost (178.126.90.146.dyn.plus.net. [146.90.126.178]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a8d25d66d7csm243681966b.224.2024.09.08.13.38.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Sep 2024 13:38:40 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/testsuite] Handle missing curses in gdb.python/py-missing-debug.exp In-Reply-To: <20240907033713.4483-1-tdevries@suse.de> References: <20240907033713.4483-1-tdevries@suse.de> Date: Sun, 08 Sep 2024 21:38:39 +0100 Message-ID: <87frq9swxc.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain 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 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 Do you know where the curses include is coming from? 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