From patchwork Tue Sep 19 06:30:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 13390855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2074CD3440 for ; Tue, 19 Sep 2023 06:31:04 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.604371.941710 (Exim 4.92) (envelope-from ) id 1qiUG9-0003tb-4E; Tue, 19 Sep 2023 06:30:57 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 604371.941710; Tue, 19 Sep 2023 06:30:57 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUG9-0003tS-1e; Tue, 19 Sep 2023 06:30:57 +0000 Received: by outflank-mailman (input) for mailman id 604371; Tue, 19 Sep 2023 06:30:55 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUG7-000365-77 for xen-devel@lists.xenproject.org; Tue, 19 Sep 2023 06:30:55 +0000 Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [2a00:1450:4864:20::436]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 15834304-56b6-11ee-8789-cb3800f73035; Tue, 19 Sep 2023 08:30:54 +0200 (CEST) Received: by mail-wr1-x436.google.com with SMTP id ffacd0b85a97d-3216ba1b01eso43069f8f.2 for ; Mon, 18 Sep 2023 23:30:54 -0700 (PDT) Received: from EMEAENG6DZjqCfH.citrite.net (cpc92302-cmbg19-2-0-cust781.5-4.cable.virginm.net. [82.1.211.14]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003fe17901fcdsm17068780wmf.32.2023.09.18.23.30.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 23:30:53 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 15834304-56b6-11ee-8789-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1695105053; x=1695709853; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wbXhdLFbcKxuR4bu4gNNOrR4FaAxxc2YusNyZEuxj94=; b=D6wMLE6+JvuGZZrCb9uhp42jYU1uzMX8xGLlsBT8eSUXp3CKhdnqv5bHSjUD0ZlU+Z ygmSEYMg+eyiLZwdtiy6mAzFhdm6Xlc5BIp623zrc8YCqbsDuTNZcm1yxjrQH0W5Bju6 EMsVed/CRDXkg4FbCYSD51oufyJSQKdFDarZE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695105053; x=1695709853; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wbXhdLFbcKxuR4bu4gNNOrR4FaAxxc2YusNyZEuxj94=; b=DZlTE9AW3YGd4OWC/gwGazxKpKgT0SrjOrgEvPJ8jYhSrFYrepz29fhm1I1BXt+HMV mKX8pUqzWPYj12/dPCSkQpu873TlHgtBEh8Wnj7QvtZOEx0hUGrHfJSd0EPfe+kWt8xg tjx9QUlanB/eqXlsBtEyE1iUeIOPItMa5zdcVh5zwqgmJ9Yuopufr2EoQ5FtqQi9hLeB dIZH5+vCMWT60MMZYxDMzDO1ctTy+WrC1EiIEruMg7xGMiydW/c8oXvLhWXdbEhrqXPr Gg12dQ5eaUXnp1Ak+z7ggexa8a8iwdaxbWi7kLRCwZD9J8rQvU3fPupJfwcqcTDPBHT4 F3AQ== X-Gm-Message-State: AOJu0YwbPljVet7SoLEU/f+IPgMMFKl0vStUmTY+yPZIgzWZ2u0oeNH/ PqnXnAbn2MXZHUFIRHeA//w+xWZC8AWgYcyfXx4= X-Google-Smtp-Source: AGHT+IFmQF902aG8kG+pWr5CTNfjQKM3oCoZlzWo8/JW8bbcr9L8kaz2unjZPw+BNhmwgwTxarBiMQ== X-Received: by 2002:a5d:5091:0:b0:317:dada:2417 with SMTP id a17-20020a5d5091000000b00317dada2417mr8670791wrt.31.1695105053601; Mon, 18 Sep 2023 23:30:53 -0700 (PDT) From: Javi Merino To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Stefano Stabellini , Andrew Cooper , Javi Merino , Doug Goldstein Subject: [XEN PATCH v3 1/4] automation: add python3's setuptools to containers Date: Tue, 19 Sep 2023 07:30:26 +0100 Message-ID: <3abf37902cb921edabf0882e463e6fa6f8b3dee7.1695104399.git.javi.merino@cloud.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 In preparation of supporting both distutils and setuptools, add the python3 setuptools module to the containers that have recent python3 installations. Debian Stretch, Ubuntu trusty (14.04), Ubuntu xenial (16.04) and Ubuntu bionic (18.04) are kept without setuptools on purpose, to test installations that don't have it. Centos 7 in particular is kept with python2 only. Signed-off-by: Javi Merino --- automation/build/alpine/3.18-arm64v8.dockerfile | 1 + automation/build/alpine/3.18.dockerfile | 1 + automation/build/archlinux/current.dockerfile | 1 + automation/build/debian/bookworm-arm64v8.dockerfile | 1 + automation/build/debian/bookworm-i386.dockerfile | 1 + automation/build/debian/bookworm.dockerfile | 1 + automation/build/suse/opensuse-leap.dockerfile | 1 + automation/build/suse/opensuse-tumbleweed.dockerfile | 1 + automation/build/ubuntu/focal.dockerfile | 1 + 9 files changed, 9 insertions(+) diff --git a/automation/build/alpine/3.18-arm64v8.dockerfile b/automation/build/alpine/3.18-arm64v8.dockerfile index ce198f7d04..470f5d72a9 100644 --- a/automation/build/alpine/3.18-arm64v8.dockerfile +++ b/automation/build/alpine/3.18-arm64v8.dockerfile @@ -32,6 +32,7 @@ RUN apk --no-cache add \ ocaml-findlib \ patch \ python3-dev \ + py3-setuptools \ texinfo \ util-linux-dev \ xz-dev \ diff --git a/automation/build/alpine/3.18.dockerfile b/automation/build/alpine/3.18.dockerfile index ca5756955e..5d2a69a060 100644 --- a/automation/build/alpine/3.18.dockerfile +++ b/automation/build/alpine/3.18.dockerfile @@ -34,6 +34,7 @@ RUN apk --no-cache add \ ocaml-findlib \ patch \ python3-dev \ + py3-setuptools \ texinfo \ util-linux-dev \ xz-dev \ diff --git a/automation/build/archlinux/current.dockerfile b/automation/build/archlinux/current.dockerfile index 13fb472d9e..47e79637a4 100644 --- a/automation/build/archlinux/current.dockerfile +++ b/automation/build/archlinux/current.dockerfile @@ -34,6 +34,7 @@ RUN pacman -S --refresh --sysupgrade --noconfirm --noprogressbar --needed \ pixman \ pkgconfig \ python \ + python-setuptools \ sdl \ sdl2 \ spice \ diff --git a/automation/build/debian/bookworm-arm64v8.dockerfile b/automation/build/debian/bookworm-arm64v8.dockerfile index a6d4246d96..640b1e0ead 100644 --- a/automation/build/debian/bookworm-arm64v8.dockerfile +++ b/automation/build/debian/bookworm-arm64v8.dockerfile @@ -16,6 +16,7 @@ RUN apt-get update && \ libncurses5-dev \ libssl-dev \ python3-dev \ + python3-setuptools \ xorg-dev \ uuid-dev \ libyajl-dev \ diff --git a/automation/build/debian/bookworm-i386.dockerfile b/automation/build/debian/bookworm-i386.dockerfile index eb1c732f53..559bf670f0 100644 --- a/automation/build/debian/bookworm-i386.dockerfile +++ b/automation/build/debian/bookworm-i386.dockerfile @@ -18,6 +18,7 @@ RUN apt-get update && \ libncurses5-dev \ libssl-dev \ python3-dev \ + python3-setuptools \ xorg-dev \ uuid-dev \ libyajl-dev \ diff --git a/automation/build/debian/bookworm.dockerfile b/automation/build/debian/bookworm.dockerfile index f8415425e6..ae008c8d46 100644 --- a/automation/build/debian/bookworm.dockerfile +++ b/automation/build/debian/bookworm.dockerfile @@ -16,6 +16,7 @@ RUN apt-get update && \ libncurses5-dev \ libssl-dev \ python3-dev \ + python3-setuptools \ xorg-dev \ uuid-dev \ libyajl-dev \ diff --git a/automation/build/suse/opensuse-leap.dockerfile b/automation/build/suse/opensuse-leap.dockerfile index 98ee42970d..7010b71aca 100644 --- a/automation/build/suse/opensuse-leap.dockerfile +++ b/automation/build/suse/opensuse-leap.dockerfile @@ -60,6 +60,7 @@ RUN zypper install -y --no-recommends \ 'pkgconfig(sdl)' \ 'pkgconfig(sdl2)' \ python3-devel \ + python3-setuptools \ systemd-devel \ tar \ transfig \ diff --git a/automation/build/suse/opensuse-tumbleweed.dockerfile b/automation/build/suse/opensuse-tumbleweed.dockerfile index aed81f0240..959e1f6939 100644 --- a/automation/build/suse/opensuse-tumbleweed.dockerfile +++ b/automation/build/suse/opensuse-tumbleweed.dockerfile @@ -63,6 +63,7 @@ RUN zypper install -y --no-recommends \ 'pkgconfig(sdl)' \ 'pkgconfig(sdl2)' \ python3-devel \ + python3-setuptools \ systemd-devel \ tar \ transfig \ diff --git a/automation/build/ubuntu/focal.dockerfile b/automation/build/ubuntu/focal.dockerfile index 9c851c0620..e3d11194ee 100644 --- a/automation/build/ubuntu/focal.dockerfile +++ b/automation/build/ubuntu/focal.dockerfile @@ -16,6 +16,7 @@ RUN apt-get update && \ libncurses5-dev \ libssl-dev \ python3-dev \ + python3-setuptools \ xorg-dev \ uuid-dev \ libyajl-dev \ From patchwork Tue Sep 19 06:30:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 13390857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9F686CD343F for ; Tue, 19 Sep 2023 06:31:09 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.604372.941719 (Exim 4.92) (envelope-from ) id 1qiUGA-00049m-Bn; Tue, 19 Sep 2023 06:30:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 604372.941719; Tue, 19 Sep 2023 06:30:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUGA-00049d-8i; Tue, 19 Sep 2023 06:30:58 +0000 Received: by outflank-mailman (input) for mailman id 604372; Tue, 19 Sep 2023 06:30:56 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUG8-000365-7E for xen-devel@lists.xenproject.org; Tue, 19 Sep 2023 06:30:56 +0000 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [2a00:1450:4864:20::330]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 15f4f1f1-56b6-11ee-8789-cb3800f73035; Tue, 19 Sep 2023 08:30:54 +0200 (CEST) Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-403012f276dso57094825e9.0 for ; Mon, 18 Sep 2023 23:30:55 -0700 (PDT) Received: from EMEAENG6DZjqCfH.citrite.net (cpc92302-cmbg19-2-0-cust781.5-4.cable.virginm.net. [82.1.211.14]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003fe17901fcdsm17068780wmf.32.2023.09.18.23.30.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 23:30:54 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 15f4f1f1-56b6-11ee-8789-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1695105054; x=1695709854; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5qAv5TR4Jv8y9/IqrcBV7oAsUEo56bvO6XuiR+P26ck=; b=Dj4Uba0/uO3kgF+0WJkf3KThH9xm58sFemj2Au4nLUjCVFGLZteoMYfNn6D4sQaSwk QvB7rdSU7+g5m0aJNqa/MToZKE+PFqVkfEXtN1SF6LApMzSZA5Ta3hQGkJhqymIVU1UH Vz/AfrF2fWcTb+6cgYCW9SvjeByX5rctAiJjA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695105054; x=1695709854; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5qAv5TR4Jv8y9/IqrcBV7oAsUEo56bvO6XuiR+P26ck=; b=jXEipjwQUf21wtZqTKb+yqrYG41kn+S7w+gf9xWFq3BZkDbq3LrznSommJmWYlI6V4 dVNPB5W3S1G7YOT13yICcRfJ5Dp+4Uf8z/dWpb5zMt/sFr4+V7PmWcRW/EdLSlHrPXgF lcYKLYp6L/6je9nZO8296Po4z4tPvkKzFI7naOm6glWh6/j+aBtphr/K/uWZMUUSg3ZX JMZmaokij0hy7VEGkevk7rO033aTxRBJTvNLPXGiHpOmbuPFLTtxygDmpZMZcW2mDCDr qkVlhJmNG9lXjess1292yZRGakAW2mHR94NpY4TLOMpVEfYfFp9nPwlxpfE2Zv8XH1xV nhCA== X-Gm-Message-State: AOJu0YxMjwz2jJ6dVeaqGE7Ykymg3x6KKr225Zcyw/uAAskPMP8Z315O 9RsAxvus+Sg425BopDsDM+ymafSnKls9S2ivXOo= X-Google-Smtp-Source: AGHT+IF3F5TicFY2bZaPPfxI3vbGtjet1LnUeRlgKhqZkuTP7saiA9lgz54eojjPaWL++bqqsbFuOA== X-Received: by 2002:a05:600c:c8:b0:402:f5c2:c6d9 with SMTP id u8-20020a05600c00c800b00402f5c2c6d9mr10181859wmm.37.1695105054480; Mon, 18 Sep 2023 23:30:54 -0700 (PDT) From: Javi Merino To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Stefano Stabellini , Andrew Cooper , Javi Merino , Wei Liu , Anthony PERARD Subject: [XEN PATCH v3 2/4] tools: convert setup.py to use setuptools if available Date: Tue, 19 Sep 2023 07:30:27 +0100 Message-ID: <761d876ad8755a98824ed7705afaed2cdb545dd8.1695104399.git.javi.merino@cloud.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 From: Marek Marczykowski-Górecki Python distutils is deprecated and is going to be removed in Python 3.12. Add support for setuptools. Setuptools in Python 3.11 complains: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. Keep using setup.py anyway to build the C extension. Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: Javi Merino --- tools/pygrub/setup.py | 7 +++++-- tools/python/setup.py | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/pygrub/setup.py b/tools/pygrub/setup.py index 502aa4df2d..c9cac47eee 100644 --- a/tools/pygrub/setup.py +++ b/tools/pygrub/setup.py @@ -1,5 +1,8 @@ -from distutils.core import setup, Extension -from distutils.ccompiler import new_compiler +# Prefer setuptools, fall back to distutils +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup, Extension import os import sys diff --git a/tools/python/setup.py b/tools/python/setup.py index 721a3141d7..02354f6986 100644 --- a/tools/python/setup.py +++ b/tools/python/setup.py @@ -1,5 +1,8 @@ - -from distutils.core import setup, Extension +# Prefer setuptools, fall back to distutils +try: + from setuptools import setup, Extension +except ImportError: + from distutils.core import setup, Extension import os, sys XEN_ROOT = "../.." From patchwork Tue Sep 19 06:30:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 13390856 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3E43CD3440 for ; Tue, 19 Sep 2023 06:31:07 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.604373.941725 (Exim 4.92) (envelope-from ) id 1qiUGA-0004Gx-Tp; Tue, 19 Sep 2023 06:30:58 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 604373.941725; Tue, 19 Sep 2023 06:30:58 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUGA-0004EW-OV; Tue, 19 Sep 2023 06:30:58 +0000 Received: by outflank-mailman (input) for mailman id 604373; Tue, 19 Sep 2023 06:30:57 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUG9-000365-Ds for xen-devel@lists.xenproject.org; Tue, 19 Sep 2023 06:30:57 +0000 Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [2a00:1450:4864:20::331]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 16cf209c-56b6-11ee-8789-cb3800f73035; Tue, 19 Sep 2023 08:30:56 +0200 (CEST) Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-403012f276dso57094985e9.0 for ; Mon, 18 Sep 2023 23:30:56 -0700 (PDT) Received: from EMEAENG6DZjqCfH.citrite.net (cpc92302-cmbg19-2-0-cust781.5-4.cable.virginm.net. [82.1.211.14]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003fe17901fcdsm17068780wmf.32.2023.09.18.23.30.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 23:30:55 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 16cf209c-56b6-11ee-8789-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1695105056; x=1695709856; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tvhbCNuYjHTCOHSrJQTmuxTZfNtPGxI3jc+wOT5X06U=; b=lWXOZVAb3RHD+IuLLUaDWM/wxVc4ppx58ZDN9zc/66UMzIP+aNw1hNqYrRcYPDSwuG YB5cspJFKVo3AVF7541/RF4w5aFMapyShNuJQaYEIQzPCyRdjGAN2RqeBZmNqw29lX9o oAl2Ue0U72g42Fy80ni9miP0MRvSIwR1BAqB8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695105056; x=1695709856; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tvhbCNuYjHTCOHSrJQTmuxTZfNtPGxI3jc+wOT5X06U=; b=AkBOpfHoysw5E/n4gu+bjJ+CPGbHd7XvDDV1JCM735NApBsKcjGM8GMVABEils2vMd E6rbZVGvqaKu4++MvRBZU7A7fAkf3IgUA4N1RpGinqAdD4prsE0q3vlrHapFIPgiHsHl IugWQDSZSnD/hfn66YOZsbCWn9M8SxM+fl4ER8VL4hNmHG8UfSFnlFgoTH1sroWdKhIB 9HI9OI4xv1ArktQYCNcg6tM+uKTQh02VK+qxehnTDEXc8Wj1NGP+560l5Ih9crZ60n1i kgEmc2IE0CGfBLKlK3ud8L7rSnlm3tsi2l6ReaXBEFdshwwWVOaCwPyHItE1a5XbqOXR c0/A== X-Gm-Message-State: AOJu0Yw6AoyJ7zT6DErad+dzUaOx1JUrkxx2g4Pp1yEU4RURcM7pceDI XbM5goW+h7JsqWyTbE8AhkKodG+CFXqFoEMTHtk= X-Google-Smtp-Source: AGHT+IFi/Nob+ea/5Pk06GDURe4HI2/PcXwQbwQcWEynA5ihJDMmtRJnRrDqm6ualnJ904MlOMAWyw== X-Received: by 2002:adf:e181:0:b0:320:9fa:d928 with SMTP id az1-20020adfe181000000b0032009fad928mr7015652wrb.68.1695105055868; Mon, 18 Sep 2023 23:30:55 -0700 (PDT) From: Javi Merino To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Stefano Stabellini , Andrew Cooper , Javi Merino , George Dunlap , Jan Beulich , Julien Grall , Wei Liu , Anthony PERARD , Juergen Gross Subject: [XEN PATCH v3 3/4] tools: don't use distutils in configure nor Makefile Date: Tue, 19 Sep 2023 07:30:28 +0100 Message-ID: <9647bf6e5ae1f06ed95db3f9bd67920dfb6b613b.1695104399.git.javi.merino@cloud.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 From: Marek Marczykowski-Górecki Python distutils is deprecated and is going to be removed in Python 3.12. distutils.sysconfig is available as the sysconfig module in stdlib since Python 2.7 and Python 3.2, so use that directly. Update the README to reflect that we now depend on Python 2.7. Regenerate configure after the m4/python_devel.m4 change. Signed-off-by: Marek Marczykowski-Górecki Signed-off-by: Javi Merino --- README | 4 ++-- m4/python_devel.m4 | 28 +++++++++++----------- tools/configure | 52 ++++++++++++++++------------------------ tools/libs/stat/Makefile | 4 ++-- 4 files changed, 38 insertions(+), 50 deletions(-) diff --git a/README b/README index f8cc426f78..f75fa536d9 100644 --- a/README +++ b/README @@ -50,7 +50,7 @@ provided by your OS distributor: - GNU Binutils 2.24 or later * POSIX compatible awk * Development install of zlib (e.g., zlib-dev) - * Development install of Python 2.6 or later (e.g., python-dev) + * Development install of Python 2.7 or later (e.g., python-dev) * Development install of curses (e.g., libncurses-dev) * Development install of openssl (e.g., openssl-dev) * Development install of x11 (e.g. xorg-x11-dev) @@ -180,7 +180,7 @@ Python Runtime Libraries Various tools, such as pygrub, have the following runtime dependencies: - * Python 2.6 or later. + * Python 2.7 or later. URL: https://www.python.org/ Debian: python diff --git a/m4/python_devel.m4 b/m4/python_devel.m4 index bbf1e0354b..bb60857b03 100644 --- a/m4/python_devel.m4 +++ b/m4/python_devel.m4 @@ -5,21 +5,21 @@ ac_previous_libs=$LIBS AC_PATH_PROG([pyconfig], [$PYTHON-config], [no]) AS_IF([test x"$pyconfig" = x"no"], [ dnl For those that don't have python-config - CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print("-I" + distutils.sysconfig.get_config_var("INCLUDEPY"))'`" - CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("CFLAGS"))'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1,\ + CPPFLAGS="$CFLAGS `$PYTHON -c 'import sysconfig; \ + print("-I" + sysconfig.get_config_var("INCLUDEPY"))'`" + CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("CFLAGS"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print("-L" + sysconfig.get_python_lib(plat_specific=1,\ standard_lib=1) + "/config")'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LINKFORSHARED"))'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LDFLAGS"))'`" - LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LIBS"))'`" - LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("SYSLIBS"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LINKFORSHARED"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LDFLAGS"))'`" + LIBS="$LIBS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LIBS"))'`" + LIBS="$LIBS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("SYSLIBS"))'`" ], [ dnl If python-config is found use it CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`" diff --git a/tools/configure b/tools/configure index 96218cadc4..ae10f6cecd 100755 --- a/tools/configure +++ b/tools/configure @@ -774,7 +774,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -905,7 +904,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1158,15 +1156,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1304,7 +1293,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1457,7 +1446,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -3397,7 +3385,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3443,7 +3431,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3467,7 +3455,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3512,7 +3500,7 @@ else We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -3536,7 +3524,7 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T ((((off_t) 1 << 31) << 31) - 1 + (((off_t) 1 << 31) << 31)) +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; @@ -7852,21 +7840,21 @@ fi if test x"$pyconfig" = x"no"; then : - CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print("-I" + distutils.sysconfig.get_config_var("INCLUDEPY"))'`" - CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("CFLAGS"))'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1,\ + CPPFLAGS="$CFLAGS `$PYTHON -c 'import sysconfig; \ + print("-I" + sysconfig.get_config_var("INCLUDEPY"))'`" + CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("CFLAGS"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print("-L" + sysconfig.get_python_lib(plat_specific=1,\ standard_lib=1) + "/config")'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LINKFORSHARED"))'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LDFLAGS"))'`" - LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LIBS"))'`" - LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("SYSLIBS"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LINKFORSHARED"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LDFLAGS"))'`" + LIBS="$LIBS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LIBS"))'`" + LIBS="$LIBS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("SYSLIBS"))'`" else diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile index ee5c42bf7b..a968eaff48 100644 --- a/tools/libs/stat/Makefile +++ b/tools/libs/stat/Makefile @@ -73,8 +73,8 @@ $(PYLIB): $(PYSRC) python-bindings: $(PYLIB) $(PYMOD) pythonlibdir = $(shell $(PYTHON) -c \ - 'import distutils.sysconfig as cfg; \ - print(cfg.get_python_lib(False, False, prefix="$(prefix)"))') + 'import sysconfig; \ + print(sysconfig.get_python_lib("platlib", vars={"platbase": "$(prefix)"}))') .PHONY: install-python-bindings install-python-bindings: $(PYLIB) $(PYMOD) From patchwork Tue Sep 19 06:30:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 13390858 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DBAABCD3441 for ; Tue, 19 Sep 2023 06:31:10 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.604374.941740 (Exim 4.92) (envelope-from ) id 1qiUGD-0004j0-4S; Tue, 19 Sep 2023 06:31:01 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 604374.941740; Tue, 19 Sep 2023 06:31:01 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUGD-0004it-18; Tue, 19 Sep 2023 06:31:01 +0000 Received: by outflank-mailman (input) for mailman id 604374; Tue, 19 Sep 2023 06:30:59 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qiUGB-0003Oo-MV for xen-devel@lists.xenproject.org; Tue, 19 Sep 2023 06:30:59 +0000 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [2a00:1450:4864:20::332]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 17d562e5-56b6-11ee-9b0d-b553b5be7939; Tue, 19 Sep 2023 08:30:58 +0200 (CEST) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-401da71b85eso58487245e9.1 for ; Mon, 18 Sep 2023 23:30:58 -0700 (PDT) Received: from EMEAENG6DZjqCfH.citrite.net (cpc92302-cmbg19-2-0-cust781.5-4.cable.virginm.net. [82.1.211.14]) by smtp.gmail.com with ESMTPSA id 26-20020a05600c229a00b003fe17901fcdsm17068780wmf.32.2023.09.18.23.30.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 23:30:56 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 17d562e5-56b6-11ee-9b0d-b553b5be7939 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1695105057; x=1695709857; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=g919MIKAx5+o9AO35iGPbruaS4fHlMldEN8yav8BWcE=; b=hpratWt2hxDKzaAwAL7070sUHJgWEwWM4F8+d7yHVZr7ejLJniIhy1j7yuspk3vJGl 7QtssuUQBuxy0Q5v3ojjoKwmYSr4xF1QCWKPkQd+dC9/KaFaksRVuINaPLi3ldyOX4hh HHvkOhlK8p92xN5Fla9ju3r7/YxFTRenleVy8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695105057; x=1695709857; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=g919MIKAx5+o9AO35iGPbruaS4fHlMldEN8yav8BWcE=; b=wMS95TIz6pV0myGZvA1oScUcAWmwQvsOPc/kbojYlekxGwfwLzatR0Mf0caofr9Oly OUtAmvqxMr+iJ/utKLEOWzooVQPjUz22d9TvuILpDSVFcU/Fu0Hgpkg+Et27sv3Xpx6v X1NRE5HdyakUWtXNUJdxD4tfirfLFj79YwMY2K0R7THEl4h14GSSHo+Fb1hjnonmBSpz 5Cso/99Eh6kEWidqJK+2m/QijC/MV6yK5nS5rHkCAbcmo5EkGZuKwIFHfH9U9CQ26k/m 9k5FapuIL+/Bt/ELnZaYuHdUGjdol2Chc98nB4KZ2S8nEVT9EZK0WOR8SfMX9AvH4m8k Msmg== X-Gm-Message-State: AOJu0YxEmEUiEQdFO+crmAaVIYoaqCi5tOvC4OjOB3XCIX5RFbRJ9J9B 75DvSm9NuHbkQEDCa3TucL+w9eu58T83kr6RmP8= X-Google-Smtp-Source: AGHT+IEoOuhldT/ru27XY4+XrosqgpSchXwnBkCf6HQeFWZOdoSoVccmrFmpW4UMah+9ZSKGVPijIg== X-Received: by 2002:a1c:f204:0:b0:3fe:d57e:d933 with SMTP id s4-20020a1cf204000000b003fed57ed933mr9861362wmc.15.1695105057145; Mon, 18 Sep 2023 23:30:57 -0700 (PDT) From: Javi Merino To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Stefano Stabellini , Andrew Cooper , Javi Merino , George Dunlap , Jan Beulich , Julien Grall , Wei Liu Subject: [XEN PATCH v3 4/4] README: remove old note about the build system's python expectation Date: Tue, 19 Sep 2023 07:30:29 +0100 Message-ID: <83e6857f16eb000f8368fcd9995e0411f0177c2e.1695104399.git.javi.merino@cloud.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: References: MIME-Version: 1.0 5852ca485263 (build: fix tools/configure in case only python3 exists, 2019-12-11) changed the configure script to test for the availability of python3, python and python2 in that order. It sets PYTHON to the first one found in path. You don't need to have a symlink to python. Remove the outdated note from the README. Signed-off-by: Javi Merino --- README | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README b/README index f75fa536d9..a491c8dce5 100644 --- a/README +++ b/README @@ -184,13 +184,6 @@ Various tools, such as pygrub, have the following runtime dependencies: URL: https://www.python.org/ Debian: python -Note that the build system expects `python` to be available. If your system -only has `python2` or `python3` but not `python` (as in Linux From Scratch), -you will need to create a symlink for it, or specify PYTHON= when invoking -make, like (note the position of PYTHON= matters): - - # make PYTHON=/usr/bin/python3 - Intel(R) Trusted Execution Technology Support =============================================