From patchwork Sun Oct 4 21:49:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 1376546 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=NFFAaTwR; dkim-atps=neutral Received: from fraxinus.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 ozlabs.org (Postfix) with ESMTPS id 4C4HSH211wz9sSn for ; Mon, 5 Oct 2020 08:49:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CB0A184AAB; Sun, 4 Oct 2020 21:49:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ct7K5VDd6bKM; Sun, 4 Oct 2020 21:49:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 167A68462A; Sun, 4 Oct 2020 21:49:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 004111BF4E4 for ; Sun, 4 Oct 2020 21:49:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id BF4A0203E4 for ; Sun, 4 Oct 2020 21:49:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H7uo1ocQ7XNf for ; Sun, 4 Oct 2020 21:49:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f68.google.com (mail-ed1-f68.google.com [209.85.208.68]) by silver.osuosl.org (Postfix) with ESMTPS id 2F34D203A5 for ; Sun, 4 Oct 2020 21:49:10 +0000 (UTC) Received: by mail-ed1-f68.google.com with SMTP id l24so7296236edj.8 for ; Sun, 04 Oct 2020 14:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=W6RFopSXU0VJjadKyfrSBCaLbE0wsn2geH4SFSiWUBk=; b=NFFAaTwRu/cl6k+/eOM0JVD+kukZRoiK3Lh/jzJP+hQVq4s0daCDXbUl7ICa+quJxk E89sEao2BTVctJSZjMREO9XUKXzSjadVVmMVSTs/Ve79R7NNa0xJ05zEh6FhUecYCOEt ElulFNEt4qwRYEqJ6cu/n8hoIx3kaBBfJKztACQVuBDCZuzw2uklRPuEvZNJ0tzVoIAj Qz/rlxVOHRucbelDoP0+ptC5Jbe0j/moL83hx8eyOwZP4UX896xi5qRObbR3D+pyZ3rN sHXJfbakTSGRivhszkvDZOjfv29lMbKi6t1NzM0bNYd26gDbXGK55KsEpXIM8UTfAL6a ufOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=W6RFopSXU0VJjadKyfrSBCaLbE0wsn2geH4SFSiWUBk=; b=Q2pRVG63FlZzl7gHHUW58nlI5cWPlDMNqFoMhMxn4mZuPBkUE+p/q5vHcbbeOMElHH QSU74dM/hvR7jpX1k/o+pnqoo0FEmzzN+cgxKnC/ghL3jNGuHUh6mWsB+lb6SHb7bzxx lFrT8I6QGTaEcGoju1PzNkidxbdiN9uFWgGOHWnL53zxwsA//jSlTOwkRV8VECJYkW2N tFR4HqwUf3XKIO9Q0el3t15lW4nIrTlaPPepxb7FhC9C/9K16sgwtTGhpMBImqz7Ok+y qGz5ILrhexk0I6bmms9kVbIRwVpIb0mJQFay8FBRRzp8TkA1uLLRY4ygGZdKvv5+8SBE HERw== X-Gm-Message-State: AOAM532B3f2GlccI0U1UM93+uvi4IySOcNyZhTMj9IcUZcUJA3Y5gvwN lgtV7Ec6xjhp+kd7Xz12ukaIAeK5CwE= X-Google-Smtp-Source: ABdhPJzroMOLd2YYQIF8KIksGamSrOhnGzFluQxok/k4YS2JkyOwH62aHI8fDI9ZnQF0Bdb87fJaoA== X-Received: by 2002:a50:da45:: with SMTP id a5mr14288955edk.152.1601848148072; Sun, 04 Oct 2020 14:49:08 -0700 (PDT) Received: from dell.be.48ers.dk (d51A5BC31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id j11sm4661601ejk.63.2020.10.04.14.49.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 14:49:06 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.92) (envelope-from ) id 1kPBsQ-0008Pu-9C; Sun, 04 Oct 2020 23:49:06 +0200 From: Peter Korsgaard To: buildroot@buildroot.org Date: Sun, 4 Oct 2020 23:49:01 +0200 Message-Id: <20201004214903.32309-1-peter@korsgaard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/2] python-socketio: drop asgi/asyncio files for python 2.x to fix pycompile issue X-BeenThere: buildroot@busybox.net 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: Peter Korsgaard , Asaf Kahlon Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/455f3e09a590f7a6724ab8cd1b86bdf2bba8071a/ socketio has conditional logic to load asgi/asyncio files when running under Python 3.x: if sys.version_info >= (3, 5): # pragma: no cover from .asyncio_client import AsyncClient from .asyncio_server import AsyncServer from .asyncio_manager import AsyncManager from .asyncio_namespace import AsyncNamespace, AsyncClientNamespace from .asyncio_redis_manager import AsyncRedisManager from .asyncio_aiopika_manager import AsyncAioPikaManager from .asgi import ASGIApp else: # pragma: no cover AsyncClient = None AsyncServer = None AsyncManager = None AsyncNamespace = None AsyncRedisManager = None AsyncAioPikaManager = None pycompile unfortunately errors out on these files when running under Python 2.x: ../scripts/pycompile.py .. error: File "/usr/lib/python2.7/site-packages/socketio/asyncio_server.py", line 84 async def emit(self, event, data=None, to=None, room=None, skip_sid=None, ^ SyntaxError: invalid syntax As a workaround, simply drop the unusable file from TARGET_DIR if building for python 2.x. Signed-off-by: Peter Korsgaard --- package/python-socketio/python-socketio.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/package/python-socketio/python-socketio.mk b/package/python-socketio/python-socketio.mk index ece4f65b78..73dab26f3c 100644 --- a/package/python-socketio/python-socketio.mk +++ b/package/python-socketio/python-socketio.mk @@ -10,4 +10,14 @@ PYTHON_SOCKETIO_SETUP_TYPE = setuptools PYTHON_SOCKETIO_LICENSE = MIT PYTHON_SOCKETIO_LICENSE_FILES = LICENSE +ifeq ($(BR2_PACKAGE_PYTHON),y) +# only needed/valid for python 3.x +define PYTHON_SOCKETIO_RM_PY3_FILES + rm -f $(TARGET_DIR)/usr/lib/python*/site-packages/socketio/asgi.py \ + $(TARGET_DIR)/usr/lib/python*/site-packages/socketio/asyncio_*.py +endef + +PYTHON_SOCKETIO_POST_INSTALL_TARGET_HOOKS += PYTHON_SOCKETIO_RM_PY3_FILES +endif + $(eval $(python-package)) From patchwork Sun Oct 4 21:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 1376545 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=An/hn0Mx; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C4HSC6TJZz9sSn for ; Mon, 5 Oct 2020 08:49:15 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 7D35086FA9; Sun, 4 Oct 2020 21:49:13 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8IPYx5bbh9rG; Sun, 4 Oct 2020 21:49:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id E37DA86FAA; Sun, 4 Oct 2020 21:49:12 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id C8FB91BF4E4 for ; Sun, 4 Oct 2020 21:49:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C557186FAA for ; Sun, 4 Oct 2020 21:49:11 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NjKz7Nqzojho for ; Sun, 4 Oct 2020 21:49:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by hemlock.osuosl.org (Postfix) with ESMTPS id 7790B86FA9 for ; Sun, 4 Oct 2020 21:49:10 +0000 (UTC) Received: by mail-ed1-f65.google.com with SMTP id l17so7276368edq.12 for ; Sun, 04 Oct 2020 14:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=/puhfOby4KH+TVxAX7oygICo30kVDj1lg4fAEdQcgSg=; b=An/hn0Mx/+z3i4lBhqe5Xmfh25wP339HI/hmBxV9jcCRalQGRqD3C/vY8BeKvLj0tu NPgEVAuLES+dUsVcNiV1Sg1QFcmFLYmkdoAs3m8Iw6pRV3kQbOTzz3UHTU1E3o+xNjrq x90us8n+in4QPgyEJXj+cvGi8cWyAkElZ6zKCzzkTWg5xn3/9HJUiaBpktJnf4l+9NFQ 1gSD1tqsNpzYzosnOXWNjZAZ9rOqtGn9Luy1d28m5L0rYq5rCunpmuYk6EnGyDmxDSBu SzshpSr4chGGj0zVV13HybGg3d94L/WuoSYjrByaGbiqt+aBUT6zDxSMVauFComfflte 9OcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=/puhfOby4KH+TVxAX7oygICo30kVDj1lg4fAEdQcgSg=; b=LdgO7uqD6sF87MCJPqQ6UXjTcZgVDgyDhxbX7ywIFVqyPkFaRtbmLRrZH2MKPlI/C2 hIIYGD5ZQT32ycT2hSG2i23duofv7ldqTuO14Di7PHgVYjavDby8kUQak8vu22iB9vzA u0XyUOantbBlMdTQl2KFtxYi7zd8LYz6jdg3obD/QAnctytbS06iypHudvLZ6fDfYpCU XELsBZ8TlJqqc+W22RHT/SrXozDAVGvrsNu/4lrsVEN4BAowUy5kjJGiXl5n0kkTTnTx jI0j6NsfnkEipafSHLwfv8vVeclnQzTbWs0FHFDFsTwSlnWbSNzgwsz0m7EI0cGZiVW+ infw== X-Gm-Message-State: AOAM531GS+3O0Q5f3MtoO31qVsNcPZh9eK/8FjHQ7Onpm/9u6/Wfs4+h Nc/ayTXGqniFAwnv+StwXiNRZC34jDM= X-Google-Smtp-Source: ABdhPJxWwNN/o6SJjbh/Hpf2M43UZZQ6P5SuTAuvLt6j6WKwagwszkx3ymr27LNbjKTZ9UnzlTIaMw== X-Received: by 2002:a50:9e82:: with SMTP id a2mr13774748edf.117.1601848148616; Sun, 04 Oct 2020 14:49:08 -0700 (PDT) Received: from dell.be.48ers.dk (d51A5BC31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id u29sm616203eda.13.2020.10.04.14.49.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 14:49:08 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.92) (envelope-from ) id 1kPBsQ-0008Pz-NO; Sun, 04 Oct 2020 23:49:06 +0200 From: Peter Korsgaard To: buildroot@buildroot.org Date: Sun, 4 Oct 2020 23:49:02 +0200 Message-Id: <20201004214903.32309-2-peter@korsgaard.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201004214903.32309-1-peter@korsgaard.com> References: <20201004214903.32309-1-peter@korsgaard.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCH 2/2] python-engineio: drop asyncio files for python 2.x to fix pycompile issue X-BeenThere: buildroot@busybox.net 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: Peter Korsgaard , Asaf Kahlon Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Fixes: http://autobuild.buildroot.net/results/72c/72cfdffeb4d0fb7c3032b52f0a26a4758eea6762/ engineio has conditional logic to load asyncio files when running under Python 3.x: if sys.version_info >= (3, 5): # pragma: no cover from .asyncio_server import AsyncServer from .asyncio_client import AsyncClient from .async_drivers.asgi import ASGIApp try: from .async_drivers.tornado import get_tornado_handler except ImportError: get_tornado_handler = None else: # pragma: no cover AsyncServer = None AsyncClient = None get_tornado_handler = None ASGIApp = None pycompile unfortunately errors out on these files when running under Python 2.x: ../scripts/pycompile.py .. error: File "/usr/lib/python2.7/site-packages/engineio/asyncio_socket.py", line 13 async def poll(self): ^ SyntaxError: invalid syntax As a workaround, simply drop the unusable file from TARGET_DIR if building for python 2.x. Signed-off-by: Peter Korsgaard --- package/python-engineio/python-engineio.mk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/package/python-engineio/python-engineio.mk b/package/python-engineio/python-engineio.mk index 36ca326877..d0e073fa95 100644 --- a/package/python-engineio/python-engineio.mk +++ b/package/python-engineio/python-engineio.mk @@ -10,4 +10,14 @@ PYTHON_ENGINEIO_SETUP_TYPE = setuptools PYTHON_ENGINEIO_LICENSE = MIT PYTHON_ENGINEIO_LICENSE_FILES = LICENSE +ifeq ($(BR2_PACKAGE_PYTHON),y) +# only needed/valid for python 3.x +define PYTHON_ENGINEIO_RM_PY3_FILES + rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/engineio/async_drivers \ + $(TARGET_DIR)/usr/lib/python*/site-packages/engineio/asyncio_*.py +endef + +PYTHON_ENGINEIO_POST_INSTALL_TARGET_HOOKS += PYTHON_ENGINEIO_RM_PY3_FILES +endif + $(eval $(python-package))