From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 10 Nov 2023 09:44:50 +0100 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1r1N8C-005ZCu-1i for lore@lore.pengutronix.de; Fri, 10 Nov 2023 09:44:50 +0100 Received: from localhost ([127.0.0.1] helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1r1N8C-0004gT-Ud; Fri, 10 Nov 2023 09:44:48 +0100 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r1N7r-0004fp-MC; Fri, 10 Nov 2023 09:44:29 +0100 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A7A1E5C01C2; Fri, 10 Nov 2023 03:44:23 -0500 (EST) Received: from imap50 ([10.202.2.100]) by compute2.internal (MEProxy); Fri, 10 Nov 2023 03:44:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emailplus.org; h=cc:cc:content-type:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1699605863; x= 1699692263; bh=+bL+zVL7oA4g3LmuH7CmkuVfL1SVCYjyUZxtvfveEdc=; b=Z 1yDrwVqZgbNXgPmvGCUFKaXFvtQ1cjcXTcpLG6IqM2tsg5+RJ1rJVf2A8S2Xe8cf QxlwwhUPvsIa9venTfv6RvXxKm8Shx81qMo4zjpE9mnr/C8AplfUbY7Za6Mw0ymU NJbjndKY705aMNmquHG9eoJPiWjMWRpLlbMgwR1eNCO0E536j5SeqOkBG9Vy3dPc 6hwjl6cUpkKfsyj+xnH5yx0zTQfcYM5+zYmKA6r3eb59cL4fIX/+WqArSKVyImOO Qxkt28lSrqVsG84jUs8DqDta1lgIVSfqrEzFDiWXukpamotTA7x+GX0KAwKfbw8r Y7u1vEAJH141rtQ3JbCYQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1699605863; x=1699692263; bh=+bL+zVL7oA4g3 LmuH7CmkuVfL1SVCYjyUZxtvfveEdc=; b=usqhk3qnkxpDVkwZbJ4zIavv4qRjq Qs23ycUKaQT1fcD+pcScqSSh5LtgKMxE5MnkbWJ7+czvXmWC/rOKWf7GEIM6tTF+ QcXPWQOp5QSMapTRkxVFhekj4ZfSCYTUnv9+w60AUK3wY0JFixIgDePXp0CUO/h+ TtbyWZKx7ytAZKft5m8RBpEu5Z7pUem1D4N6R4EQFFbcV765y4sKL4jC7kr7hB6u ULgLM+UfLMusfHRdzoP5Lh4ypv4mCqJOg6CLtnU2X95G/mIej18/IVie/Skj3jgF VfE6KwypNBbaPh5FBBE1kNIfv/v2yheta69Wrn76smHlPXLlKn4yEyN6A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedruddvvddguddvtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdfl vggrnhdqvehlrghuuggvucfoohhnnhhinhdfuceojhgtpghmohhnnhhinhesvghmrghilh hplhhushdrohhrgheqnecuggftrfgrthhtvghrnhepueehjeegffeffeejvdelhedutdff udeitdffgedtjedtieegffeuhfegkedtffevnecuffhomhgrihhnpehpvghnghhuthhroh hnihigrdguvgenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehjtggpmhhonhhnihhnsegvmhgrihhlphhluhhsrdhorhhg X-ME-Proxy: Feedback-ID: i00d441ac:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 4939E1700089; Fri, 10 Nov 2023 03:44:23 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-1108-g3a29173c6d-fm-20231031.005-g3a29173c MIME-Version: 1.0 Message-Id: <17cbff84-d77c-4dce-9a7c-b45b1055f693@app.fastmail.com> In-Reply-To: References: <2140a7cd-a17c-4400-a223-7692942b1ade@app.fastmail.com> Date: Fri, 10 Nov 2023 09:44:03 +0100 From: "Jean-Claude Monnin" To: "Michael Olbrich" Content-Type: text/plain X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on metis.whiteo.stw.pengutronix.de X-Spam-Level: X-Spam-Status: No, score=-1.1 required=4.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_SBL,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.2 Subject: Re: [ptxdist] Error building nodejs in 2023.10.0 X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Cc: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Hi Michael, Thanks for the reply. I'm using ptxdist-2023.10.0. Python is called by the node build system, and it looks like it was using the host python in my case. Possibly it's because another package selects host python; maybe it works if host python isn't there at all. I'm happy with the workaround, but I see your point of wanting to use system python instead. Is there any way to check/fix why it selects host python on my system? Jean-Claude On Fri, Nov 10, 2023, at 9:00 AM, Michael Olbrich wrote: > Hallo, > > On Wed, Nov 01, 2023 at 05:04:30PM +0100, Jean-Claude Monnin wrote: >> When trying to build nodejs with the latest ptxdist, I faced an error about missing a python module `ModuleNotFoundError: No module named '_bz2'` (see [1]). >> >> I'm not very proficient with ptxdist, so I would like to check if the solution I came up is correct. Feedback welcome. If solution is ok, feel free to apply it upstream or ask for a proper email patch. >> >> I think it's due to following issues: >> - The host python is missing the option to support BZIP2. I added an option for that. >> - nodejs.in says it depends on HOST_SYSTEM_PYTHON3, however it seems like the build isn't using system python but host python built by ptxdist. I think it should depend on HOST_PYTHON3 and the new HOST_PYTHON3_BZIP2. >> >> See [2] for the patch I applied. > > Python in PTXdist is a bit tricky. We don't want to compile Python itself > just to run a few Python scripts at build-time. That's what > "host-system-python3" is for. It does not build anything, it just checks > if Python3 and required packages are installed. > > "host-python3" is used when building Python packages for the target. > > In this case, it looks like the wrong Python is used. Which ptxdist version > are you using? > > Michael > >> Kind regards, >> Jean-Claude >> >> >> [1] Error message >> >> ---------------------- >> target: nodejs.prepare >> ---------------------- >> >> Node.js configure: Found Python 3.11.2... >> Traceback (most recent call last): >> File "/home/jean-claude/code/test-ptxdist/platform-nanopi-rk3588/build-target/node-v18.13.0/./configure", line 28, in >> import configure >> File "/home/jean-claude/code/test-ptxdist/platform-nanopi-rk3588/build-target/node-v18.13.0/configure.py", line 14, in >> import bz2 >> File "/home/jean-claude/code/test-ptxdist/platform-nanopi-rk3588/sysroot-target/usr/lib/python3.11/bz2.py", line 17, in >> from _bz2 import BZ2Compressor, BZ2Decompressor >> ModuleNotFoundError: No module named '_bz2' >> >> >> [2] possible patch >> >> diff --git a/rules/host-python3.in b/rules/host-python3.in >> index e15b90571..64f34affa 100644 >> --- a/rules/host-python3.in >> +++ b/rules/host-python3.in >> @@ -6,6 +6,7 @@ config HOST_PYTHON3 >> select HOST_LIBFFI >> select HOST_OPENSSL >> select HOST_ZLIB if HOST_PYTHON3_ZLIB >> + select HOST_BZIP2 if HOST_PYTHON3_BZIP2 >> default y if ALLYES >> help >> Python is an interpreted, interactive, >> @@ -16,4 +17,7 @@ if HOST_PYTHON3 >> config HOST_PYTHON3_ZLIB >> bool >> >> +config HOST_PYTHON3_BZIP2 >> + bool >> + >> endif >> diff --git a/rules/nodejs.in b/rules/nodejs.in >> index 80c6aec21..c75480953 100644 >> --- a/rules/nodejs.in >> +++ b/rules/nodejs.in >> @@ -3,7 +3,8 @@ >> config NODEJS >> tristate >> prompt "Node.js " >> - select HOST_SYSTEM_PYTHON3 >> + select HOST_PYTHON3 >> + select HOST_PYTHON3_BZIP2 >> select HOST_QEMU >> select HOST_QEMU_USR >> select C_ARES >> >> > > -- > Pengutronix e.K. | | > Steuerwalder Str. 21 | http://www.pengutronix.de/ | > 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | > Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |