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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 14F87C433EF for ; Sun, 3 Apr 2022 23:27:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 78CDE4157A; Sun, 3 Apr 2022 23:27:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id k_4AU4CN8-S8; Sun, 3 Apr 2022 23:27:57 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id E8FB04156F; Sun, 3 Apr 2022 23:27:55 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id DB1291BF25F for ; Sun, 3 Apr 2022 23:27:54 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id C5AB260A9D for ; Sun, 3 Apr 2022 23:27:54 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp3.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NlqM5yzI15wg for ; Sun, 3 Apr 2022 23:27:54 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by smtp3.osuosl.org (Postfix) with ESMTPS id 02D3960A6B for ; Sun, 3 Apr 2022 23:27:53 +0000 (UTC) Received: by mail-il1-x12b.google.com with SMTP id e13so1950497ils.8 for ; Sun, 03 Apr 2022 16:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6g1qqKZJHH9b6BoXwiYhtLZFzqMMh76bIhbpnmDevMM=; b=H/C0lSjh8x5hr7BXO4fQhQYLXtlnr50avsb57w00z2w65rzKYQ1F1axNdbaik43TPa WtM0RPI2NmUU3o2AWSQJ0BZZkhCY7ktXB6JG1ab9Nb4vfhkTY37INyDxdm2x8WmR4sWP VMugCWPrSVexh50MSquNV5VMr4SwYvTHTDP/7pqSCnMl+M0n+Y0MGmF7BrzPGYLOK1jF iMZ8tmpkbd+dkCuKRfDYL3Gvirb1tQY4hlIbSHZIWM0KPspHt0Qtg1jBTvcOQDq7svkP xoGEaO4Tr76sGyZcgec30Q5cIwSAOTYOnFkM1k7XHwOlXHMAtN0yH195GOXWPdrIee41 Pg3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=6g1qqKZJHH9b6BoXwiYhtLZFzqMMh76bIhbpnmDevMM=; b=dPUZEELKE5tVISosAvigWewDzlwD9M9swyHJIl883L22UCPSts2Jj5hLUc8ZRqzUk7 fYNDSPoWcfNe2pq3W0R2QfIa1sx6GjKD/2RBU9UxBHmAottYy8WSdm/gj2eU9GRA7xK7 90OFioTncLCL+xi+ysXSFunOHP7No3NEKvQg7Nim2B3ZoXAU/NFFUpBpRVzPGZiAcQ6b a6fRDRjJMIVIFbsi7tQBN7GkXxmvJ5FX0yV9WmsDVjrU0FsvsGULSTSagXAq7/UiWNW/ 0StoeCh9P7O0BuJ63yvDja/gv7enw+grMG32QBcivJ97T3lOPZGX9KRaJTFwPQSRmVLh 6OnA== X-Gm-Message-State: AOAM530AcbQsLLoxh4dKWZ7il5wY9AWa/TxMGCk16este9eaKQ3BoX/j MNheoPt2WBqYsCug/YQWJos6p/odPRKODg== X-Google-Smtp-Source: ABdhPJysRjHbQHIjJKxmY3P8LrOPhosNv0VppYFAFrakwvEB1thEywdO5Yh3N/VMEMgyHtXgO/dSUQ== X-Received: by 2002:a05:6e02:1aa6:b0:2c9:cfd3:5d0b with SMTP id l6-20020a056e021aa600b002c9cfd35d0bmr4414386ilv.38.1649028472833; Sun, 03 Apr 2022 16:27:52 -0700 (PDT) Received: from james-x399.localdomain (71-218-122-133.hlrn.qwest.net. [71.218.122.133]) by smtp.gmail.com with ESMTPSA id r3-20020a92d983000000b002c98eaa72ddsm4902669iln.84.2022.04.03.16.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Apr 2022 16:27:52 -0700 (PDT) From: James Hilliard To: buildroot@buildroot.org Date: Sun, 3 Apr 2022 17:27:47 -0600 Message-Id: <20220403232747.560562-1-james.hilliard1@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH v4 1/1] package/pkg-python: migrate flit to new bootstrapping sequence X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: James Hilliard , "Yann E. MORIN" , Thomas Petazzoni Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" There are a number of flit toolchain dependencies currently in the process of deprecating distutils based fallbacks. This will be needed in order to update tomli. We need to migrate these to use a new bootstrap based build+install sequence which relies on flit's bootstrap wheel build+install features to build and install host-python-pypa-build and host-python-installer which gives us a full pep517 toolchain. Note that one can run host-python-flit-core commands for building and installing itself since the package build directory is the cwd. We need to add a special flit-bootstrap SETUP_TYPE for dependencies of host-python-pypa-build and host-python-installer which can not use the normal flit SETUP_TYPE which would cause a circular dependency issue. We need to special case dependency exclusions for host-python-flit-core and host-python-installer to avoid circular dependencies in the flit-bootstrap SETUP_TYPE. We also need to special case the installation command for host-python-flit-core since it can not depend on host-python-installer due to host-python-installer requiring host-python-flit-core. Signed-off-by: James Hilliard Cc: "Yann E. MORIN" Cc: Arnout Vandecappelle --- Changes v3 -> v4: - rebase Changes v2 -> v3: - add special flit-bootstrap SETUP_TYPE - don't change package SETUP_TYPE's yet Changes v1 -> v2: - formatting/cleanup - add comments --- package/pkg-python.mk | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/package/pkg-python.mk b/package/pkg-python.mk index 867341fc7b..2e7704a0a9 100644 --- a/package/pkg-python.mk +++ b/package/pkg-python.mk @@ -154,6 +154,9 @@ HOST_PKG_PYTHON_PEP517_INSTALL_OPTS = \ --scripts=$(HOST_DIR)/bin \ --data=$(HOST_DIR) +HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS = \ + --installdir=$(HOST_DIR)/lib/python$(PYTHON3_VERSION_MAJOR)/site-packages + ################################################################################ # inner-python-package -- defines how the configuration, compilation # and installation of a Python package should be done, implements a @@ -203,7 +206,7 @@ $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) $(2)_BASE_BUILD_CMD = setup.py build $(2)_BASE_INSTALL_CMD = setup.py install $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPTS) endif -else ifneq ($$(filter flit pep517,$$($(2)_SETUP_TYPE)),) +else ifneq ($$(filter flit flit-bootstrap pep517,$$($(2)_SETUP_TYPE)),) ifeq ($(4),target) $(2)_BASE_ENV = $$(PKG_PYTHON_PEP517_ENV) $(2)_BASE_BUILD_CMD = -m build -n -w @@ -211,9 +214,24 @@ $(2)_BASE_INSTALL_TARGET_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $ $(2)_BASE_INSTALL_STAGING_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(PKG_PYTHON_PEP517_INSTALL_STAGING_OPTS) else $(2)_BASE_ENV = $$(HOST_PKG_PYTHON_PEP517_ENV) +# Use flit built in wheel builder for packages that are flit-bootstrap packages. +# This is needed to avoid a circular with host-python-pypa-build and those dependencies. +# +ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) +$(2)_BASE_BUILD_CMD = -m flit_core.wheel +ifeq ($(1),host-python-flit-core) +# Use flit built in bootstrap_install for installing host-python-flit-core. +# This is due to host-python-installer depending on host-python-flit-core. +# +$(2)_BASE_INSTALL_CMD = -m bootstrap_install dist/* $$(HOST_PKG_PYTHON_PEP517_BOOTSTRAP_INSTALL_OPTS) +else +$(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) +endif +else $(2)_BASE_BUILD_CMD = -m build -n -w $(2)_BASE_INSTALL_CMD = $(TOPDIR)/support/scripts/pyinstaller.py dist/* $$(HOST_PKG_PYTHON_PEP517_INSTALL_OPTS) endif +endif else $$(error "Invalid $(2)_SETUP_TYPE. Valid options are 'distutils', 'setuptools', 'pep517' or 'flit'.") endif @@ -239,6 +257,12 @@ $(2)_DEPENDENCIES += host-python-pypa-build host-python-installer ifeq ($$($(2)_SETUP_TYPE),flit) $(2)_DEPENDENCIES += host-python-flit-core endif +else ifeq ($$($(2)_SETUP_TYPE),flit-bootstrap) +ifneq ($$(filter host-python-flit-core host-python-installer,$(1)),) +$(2)_DEPENDENCIES += $$(if $$(filter host-python-flit-core,$(1)),,host-python-flit-core) +else +$(2)_DEPENDENCIES += host-python-flit-core host-python-installer +endif endif # SETUP_TYPE # Python interpreter to use for building the package. -- 2.25.1 _______________________________________________ buildroot mailing list buildroot@buildroot.org https://lists.buildroot.org/mailman/listinfo/buildroot