From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4XRZNOqPCGO+gS0AWB0awg (envelope-from ) for ; Fri, 26 Aug 2022 05:18:34 -0400 Received: by simark.ca (Postfix, from userid 112) id C858B1E4A7; Fri, 26 Aug 2022 05:18:34 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=qm315qz8; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 403551E222 for ; Fri, 26 Aug 2022 05:18:34 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BF94538582BF for ; Fri, 26 Aug 2022 09:18:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BF94538582BF DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1661505512; bh=LaX7CYvylHah5xdsbu7BMNxarvrbdDRMCkwx81XrE9E=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=qm315qz8KvmxkdHbxJEq434YZ0tsl+AYX3Q9cnzOAPCAOFUE1zko9YushFpkuP7EZ gXn7DKPuoHaALDzV6oWV0Osa6pVbatNkzv+W00wMNPl616k6nwhDotCrkIsp+guA8D Gr1YHIS/aVZ5FC5klRk1xGlUzcte4i/1qU4VtKjg= Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2088.outbound.protection.outlook.com [40.107.243.88]) by sourceware.org (Postfix) with ESMTPS id 188EC3858D39 for ; Fri, 26 Aug 2022 09:18:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 188EC3858D39 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NufW+mjBPUrI095q4bKAoaI009hQx3iqiG0MICmAnNsEDlYf2lkOyyTowMN3Hypp/MgrNp1U68KMF44ZTGIsBuAe+t8N370drJfHmNs/K+bZGXMFuGXexmMNkGFzftIm0XXWb1e37Ew3O4BTnyDnra+UiEQ/V3nFywURb6TIgiOL+QN8PqLwbyoT1JySEilO8mO2KrKTrgxBLAuWbeZNc7slpu0SVVaDms0SFbVLFyHBeyxuEWLJezMowmWA90w+oWG0YuK4g6PWjA6+gbZBkPPNCUvuWWQ84E/T8Uzz1QkDkZVJX/FFp21nvGww6qYYRprlRHM13fWwx9Yj6GO/5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LaX7CYvylHah5xdsbu7BMNxarvrbdDRMCkwx81XrE9E=; b=G+9RxRCB5fXuj3pfrxK3nXhIh7siP0pJA+Ub80G92Pc2kNrAqPBb5vwGtPC96L0DZJv32w52y8RsY7y9hHFiBCvO8tQ4h9vojqNz+KpGw3DOBpwq1jxN772j9sRghE59m31DUpctStNoUOqG8RTaQ20N2awNKiLp+OHkRjoyak3c/MrK7U2nwGn50e214KPEes1WWTUBgkRxMJYb8HXNRgGbcNojilwR/2y+OOb3bYHDFo0qs6yfJmxTqW/4ChxJUGCYjUM1VW1B+gL5jIs27jYtpBu3Z9LqAJantebEgc75Q+owjjJlMKXLA5SPxaVavrgHK78zosa0Zh7i6pgY+g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=sourceware.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none Received: from BN9PR03CA0293.namprd03.prod.outlook.com (2603:10b6:408:f5::28) by BN8PR12MB2977.namprd12.prod.outlook.com (2603:10b6:408:4a::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5546.21; Fri, 26 Aug 2022 09:18:08 +0000 Received: from BN8NAM11FT045.eop-nam11.prod.protection.outlook.com (2603:10b6:408:f5:cafe::ae) by BN9PR03CA0293.outlook.office365.com (2603:10b6:408:f5::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5566.15 via Frontend Transport; Fri, 26 Aug 2022 09:18:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BN8NAM11FT045.mail.protection.outlook.com (10.13.177.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.5566.15 via Frontend Transport; Fri, 26 Aug 2022 09:18:08 +0000 Received: from Navi21-hollywood-6.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.28; Fri, 26 Aug 2022 04:17:58 -0500 To: Subject: [PATCH] gdb/python-config: replace deprecated distutils.sysconfig Date: Fri, 26 Aug 2022 05:17:37 -0400 Message-ID: <20220826091737.121771-1-lancelot.six@amd.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bbf30e20-9292-4e0d-e81b-08da8743e3f6 X-MS-TrafficTypeDiagnostic: BN8PR12MB2977:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7va6aub0XVwO1p1S/mVk2wOhBrrXtwUcCTtfs+XfW6OpSSeD+77VD8sx5iHk0tE5XcghGvpT6CDhZQ9PzKl9dgaAu31wH23E50dKGhTLAywb65mnMRI9TijPICK3GaL8MpjKpHWBHI7txdV6wdQRJYCBK+pnQFbXGz1WycGKxiiFYpkwLW/NWS1tsUaGPCeeVMIsNdF5Z7Ov/BvzU2t7NrPf1pCqe8LvBCIByYkk5W0jJuP7D5+3LN4gtPbaDuub1p2S4iZyTFA2lia3hO9dH0PuEoe9TQpdJ8vSZFnOiexE8GTlEU4wckYB6xfrm6Vqm5lh1Jmv7tZwVcg3grcEkCZfXRB3fpu9kIY6X9H3D865vQkTFRPGXayC4/VjfGkeLkzd169k1MxvpIdpjEt7vXS5SU4P32y2XOj3NDjwkVrHaffaMnVH1WHS35ej26c+Qy83lh3RjyJ3Ss2yn1NFlB4SftVgK3sRsQV5mh2kNSTkijCKvIQTYwariQJpROOzntNWo7FK73saWB5QYUyR0z4Cmb5Rvg3KxCoSyHQ+vPd+WB6tTmAv2R8OoijoG0e9T3jNIJ6A6hjtEQMgYtjI+Jn8JM4hEPosMHKSi1h9S0+Sf0fPd0xs4NKXVsXyO4hnjZK0OWQER42QqonrZ0f6tge8vmZ5XYpaqwSOf7CnREphn2+bh+fnieIyN2aGl0nING4C6JrgbBDI4/YlxbUY2tC2Ju1UGDZN1qKxRuDyo0CHXwyUsCaL1FyIgzBHTbfvuINvO6Lx0AG+Dm2A9mzFp2W4oAWQLmrEwqALKRIw3CD6ALRz+XTGxjz0o1mxVxLexQA5eIX3HbW8WAmk6cXOYg== X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230016)(4636009)(376002)(396003)(39860400002)(346002)(136003)(40470700004)(46966006)(36840700001)(4326008)(2906002)(8676002)(70206006)(70586007)(26005)(478600001)(5660300002)(8936002)(36860700001)(82740400003)(316002)(86362001)(40480700001)(54906003)(6916009)(82310400005)(36756003)(83380400001)(426003)(336012)(186003)(16526019)(2616005)(1076003)(47076005)(966005)(40460700003)(356005)(81166007)(41300700001)(6666004)(7696005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2022 09:18:08.2733 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bbf30e20-9292-4e0d-e81b-08da8743e3f6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT045.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB2977 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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: lsix@lancelotsix.com, Lancelot SIX Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" When running the gdb/configure script on ubuntu 22.04 with python-3.10.4, I see: checking for python... no checking for python3... /usr/bin/python3 [...]/gdb/python/python-config.py:7: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import sysconfig [...]/gdb/python/python-config.py:7: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils import sysconfig [...]/gdb/python/python-config.py:7: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import sysconfig [...]/gdb/python/python-config.py:7: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils import sysconfig [...]/gdb/python/python-config.py:7: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils import sysconfig [...]/gdb/python/python-config.py:7: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead from distutils import sysconfig checking for python... yes The distutils module is deprecated as per the PEP 632[1] and will be removed in python-3.12. This patch migrates gdb/python/python-config.py from distutils.sysconfig to the sysconfig module[2]. The sysconfig module has has been introduced in the standard library in python 3.2. Given that support for python < 3.2 has been removed by edae3fd6600f: "gdb/python: remove Python 2 support", this patch does not need to support both implementations for backward compatibility. Tested on ubuntu-22.04 and ubuntu 20.04. [1] https://peps.python.org/pep-0632/ [2] https://docs.python.org/3/library/sysconfig.html Change-Id: Id0df2baf3ee6ce68bd01c236b829ab4c0a4526f6 --- gdb/python/python-config.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/python/python-config.py b/gdb/python/python-config.py index 027d80dcc86..e89e0fd40bb 100644 --- a/gdb/python/python-config.py +++ b/gdb/python/python-config.py @@ -4,7 +4,7 @@ import sys import os import getopt -from distutils import sysconfig +import sysconfig valid_opts = ["prefix", "exec-prefix", "includes", "libs", "cflags", "ldflags", "help"] @@ -49,15 +49,15 @@ def to_unix_path(path): for opt in opt_flags: if opt == "--prefix": - print(to_unix_path(sysconfig.PREFIX)) + print(to_unix_path(os.path.normpath(sys.prefix))) elif opt == "--exec-prefix": - print(to_unix_path(sysconfig.EXEC_PREFIX)) + print(to_unix_path(os.path.normpath(sys.exec_prefix))) elif opt in ("--includes", "--cflags"): flags = [ - "-I" + sysconfig.get_python_inc(), - "-I" + sysconfig.get_python_inc(plat_specific=True), + "-I" + sysconfig.get_path("include"), + "-I" + sysconfig.get_path("platinclude"), ] if opt == "--cflags": flags.extend(getvar("CFLAGS").split()) @@ -76,7 +76,7 @@ for opt in opt_flags: if getvar("LIBPL") is not None: libs.insert(0, "-L" + getvar("LIBPL")) elif os.name == "nt": - libs.insert(0, "-L" + sysconfig.PREFIX + "/libs") + libs.insert(0, "-L" + os.path.normpath(sys.prefix) + "/libs") if getvar("LINKFORSHARED") is not None: libs.extend(getvar("LINKFORSHARED").split()) print(to_unix_path(" ".join(libs))) base-commit: 8d00b2b74b8cb55432d2a497eec22cac582d9ea7 -- 2.25.1